use prebuilt magma binary on windows (from PyTorch)
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