-
Notifications
You must be signed in to change notification settings - Fork 6
/
run_test.bat
62 lines (48 loc) · 1.15 KB
/
run_test.bat
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
setlocal EnableDelayedExpansion
call common.bat
SET OLDDIR=%CD%
cd %AF_DIR%\%BUILD_DIR%
SET PATH=%PATH%;%PATH_EXT%;
set ARGC=1
for %%x in (%*) do SET /A ARGC+=1
if %ARGC% EQU 1 goto error
if "%1"=="" goto error
if "%AF_CUDA_DEFAULT_DEVICE%"=="" SET AF_CUDA_DEFAULT_DEVICE=-1
if "%AF_OPENCL_DEFAULT_DEVICE%"=="" SET AF_OPENCL_DEFAULT_DEVICE=-1
if %ARGC% EQU 2 goto default
if %ARGC% GEQ 4 (
if "%2"=="CUDA" (
SET AF_CUDA_DEFAULT_DEVICE=%3
)
if "%2"=="OPENCL" (
SET AF_OPENCL_DEFAULT_DEVICE=%3
)
)
if %ARGC% GEQ 6 (
echo 2
REM IF BOTH ARE CUDA or BOTH ARE OPENCL
if %2==%4 goto error
if "%4"=="CUDA" (
SET AF_CUDA_DEFAULT_DEVICE=%5
)
if "%4"=="OPENCL" (
SET AF_OPENCL_DEFAULT_DEVICE=%5
)
)
:default
if %AF_CUDA_DEFAULT_DEVICE% LSS 0 (
SET AF_CUDA_DEFAULT_DEVICE=0
)
if %AF_OPENCL_DEFAULT_DEVICE% LSS 0 (
SET AF_OPENCL_DEFAULT_DEVICE=0
)
set CTEST_OUTPUT_ON_FAILURE=ON
%CTEST% -C %BUILD_TYPE% -R %1
cd %OLDDIR%
goto end
:error
echo "Usage: .\run_test.bat <expr> CUDA=<id> OPENCL=<id>"
echo "Use . or _ as expr to run all tests"
echo "CUDA and OpenCL Device ID is optional"
:end