forked from KhronosGroup/SYCL-CTS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (45 loc) · 1.47 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
55
56
57
# check CMake Version
cmake_minimum_required(VERSION 3.13)
project(sycl_cts)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON) # Required for hex floats in C++11 mode on gcc 6+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
find_package(OpenCLTargets REQUIRED)
find_package(PythonInterp 3 REQUIRED)
# set host compiler flags
if(WIN32)
add_compile_options(/bigobj)
endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR
${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_compile_options(-Wall -Wno-unused-variable)
endif()
include(AddSYCLExecutable)
# ------------------
# Double and Half variables
option(SYCL_CTS_ENABLE_DOUBLE_TESTS "Enable Double tests." ON)
option(SYCL_CTS_ENABLE_HALF_TESTS "Enable Half tests." ON)
if(SYCL_CTS_ENABLE_DOUBLE_TESTS)
add_definitions(-DSYCL_CTS_TEST_DOUBLE)
endif()
if(SYCL_CTS_ENABLE_HALF_TESTS)
add_definitions(-DSYCL_CTS_TEST_HALF)
endif()
# ------------------
# ------------------
# OpenCL interoperability
option(SYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS
"Enable OpenCL interoperability tests." ON)
if(SYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS)
add_definitions(-DSYCL_CTS_TEST_OPENCL_INTEROP)
endif()
# ------------------
if(${INTEL_SYCL_TRIPLE} MATCHES ".*-nvidia-cuda-.*")
add_definitions(-DSYCL_CTS_INTEL_PI_CUDA)
endif()
enable_testing()
add_subdirectory(util)
add_subdirectory(tests)
add_subdirectory(oclmath)