Created
October 1, 2019 15:59
-
-
Save oxyflour/b98a26f51a0e4b20066401a63954360e to your computer and use it in GitHub Desktop.
use prebuilt magma binary on windows (from PyTorch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem update blas dir and cuda version | |
set BLAS_DIR=D:\Programs\OpenBLAS-0.3.7-x64 | |
set CUDA_PREFIX=cuda100 | |
set OUTPUT_EXE=build\main | |
set MAGMA_DIR=%~dp0\build\magma | |
if not exist %MAGMA_DIR% ( | |
rem using static library precompiled for pytorch | |
rem https://github.com/pytorch/pytorch/blob/master/docs/source/notes/windows.rst | |
rem Make sure you have 7z and curl installed. | |
curl -k https://s3.amazonaws.com/ossci-windows/magma_2.5.0_%CUDA_PREFIX%_release.7z -o build/magma.7z | |
7z x -aoa build/magma.7z -obuild/magma | |
) | |
nvcc main.c -o %OUTPUT_EXE% ^ | |
-I%MAGMA_DIR%\include ^ | |
-L%BLAS_DIR%\lib -L%MAGMA_DIR%\lib ^ | |
-lcusparse -lcublas -lmagma -lmagma_sparse -llibopenblas ^ | |
-Xcompiler /MD | |
%OUTPUT_EXE% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment