-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
30 lines (24 loc) · 1.3 KB
/
Copy pathbuild.bat
File metadata and controls
30 lines (24 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
if not exist "dist" mkdir "dist"
if not exist "dist\cuda" mkdir "dist\cuda"
echo [build] compiling vec_kernel.cu...
nvcc -O2 -c vec_kernel.cu -o vec_kernel.obj -Wno-deprecated-gpu-targets -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_100,code=sm_100
if %errorlevel% neq 0 goto fail
echo [build] linking dist\vec.exe...
nvcc -O2 vec_kernel.obj vec.cpp -o dist\vec.exe -lws2_32 -lmpr -Wno-deprecated-gpu-targets -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_100,code=sm_100
if %errorlevel% neq 0 goto fail
echo [build] compiling dist\vec-cpu.exe...
cl /O2 /arch:AVX2 /fp:fast /EHsc vec-cpu.cpp /Fe:dist\vec-cpu.exe ws2_32.lib mpr.lib /nologo
if %errorlevel% neq 0 goto fail
echo [build] compiling test.exe...
cl /O2 /EHsc test.cpp /Fe:test.exe ws2_32.lib /nologo
if %errorlevel% neq 0 goto fail
if not exist "dist\vec.exe" goto fail
if not exist "dist\vec-cpu.exe" goto fail
echo [build] done.
del /q vec.exe vec-cpu.exe 2>nul
del /q *.obj *.lib *.exp *.pdb 2>nul
exit /b 0
:fail
echo [build] FAILED
exit /b 1