Skip to content

Commit

Permalink
Merge pull request #65 from yuriykoch/testcov/cmake/fp16_fp64-options
Browse files Browse the repository at this point in the history
Enable half/double cmake options
  • Loading branch information
bader authored Jan 20, 2021
2 parents 346f616 + baef033 commit 74fe226
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ include(AddSYCLExecutable)

# ------------------
# Double and Half variables
option(SYCL_CTS_ENABLE_DOUBLE_TESTS "Enable Double tests." OFF)
option(SYCL_CTS_ENABLE_HALF_TESTS "Enable Half tests." OFF)
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()
Expand Down
10 changes: 9 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,20 @@ add_executable(test_all)
function(add_cts_test)
get_filename_component(test_dir ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_exe_name test_${test_dir})
set(test_cases_list ${ARGN})

if(NOT SYCL_CTS_ENABLE_HALF_TESTS)
list(FILTER test_cases_list EXCLUDE REGEX .*_fp16\\.cpp$)
endif()
if(NOT SYCL_CTS_ENABLE_DOUBLE_TESTS)
list(FILTER test_cases_list EXCLUDE REGEX .*_fp64\\.cpp$)
endif()

message(STATUS "Adding test: " ${test_exe_name})

add_sycl_executable(NAME ${test_exe_name}
OBJECT_LIBRARY ${test_exe_name}_objects
TESTS ${ARGN})
TESTS ${test_cases_list})

target_include_directories(${test_exe_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

Expand Down

0 comments on commit 74fe226

Please sign in to comment.