-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
54 lines (43 loc) · 1.78 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
project(opencl-testsuite)
# https://gitorious.org/findopencl/findopencl
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package( OpenCL REQUIRED )
message(STATUS "OpenCL includes: ${OPENCL_INCLUDE_DIRS}")
include_directories( ${OPENCL_INCLUDE_DIRS} )
# Maybe we could git c++11 flag... opencl platforms are pretty modern
# add_definitions(-std=c99)
# find python executable
find_program( PYTHON_EXECUTABLE python )
SET(LIT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/tools/lit/lit.py)
SET(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
SET(REPORTER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/tools/report-results.py)
SET(RESULTS_JSON ${CMAKE_BINARY_DIR}/test_out.json)
SET(DEVICES_JSON ${CMAKE_BINARY_DIR}/system_info.json)
add_subdirectory(tools/ocl-tester)
get_target_property(OCL_TESTER_EXEC ocl-tester LOCATION)
message(STATUS "Found python: ${PYTHON_EXECUTABLE}")
message(STATUS "Ocl tester executable: ${OCL_TESTER_EXEC}")
# one can call 'make USE_DEVICE="Apple.*" check' to run test only with selected platforms
add_custom_target(check
${PYTHON_EXECUTABLE} ${LIT_SCRIPT} -o ${RESULTS_JSON} -sv
--param OCL_TESTER=${OCL_TESTER_EXEC}
--param DEVICE=\${USE_DEVICE}
${TEST_DIR}
DEPENDS ocl-tester)
# one can call 'make list-checks' to print out information about devices
add_custom_target(list-checks
${PYTHON_EXECUTABLE} ${LIT_SCRIPT} -o ${RESULTS_JSON} -sv
--param OCL_TESTER=${OCL_TESTER_EXEC}
--param DEVICE=\${USE_DEVICE}
--show-suites
--show-suites
${TEST_DIR}
DEPENDS ocl-tester)
# create device info file to send with test results
add_custom_target(create-device-info
${OCL_TESTER_EXEC} list-devices > ${DEVICES_JSON}
DEPENDS ocl-tester)
add_custom_target(send-report
${PYTHON_EXECUTABLE} ${REPORTER_SCRIPT} ${RESULTS_JSON}
DEPENDS create-device-info)