Skip to content

Commit

Permalink
Merge pull request #771 from steffenlarsen/steffen/enable_all_oneapi_…
Browse files Browse the repository at this point in the history
…tests_option

Add SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS CMake option
  • Loading branch information
bader authored Sep 7, 2023
2 parents 282acab + 5650a0a commit af335a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
34 changes: 23 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,49 @@ add_cts_option(SYCL_CTS_ENABLE_FULL_CONFORMANCE
"Enable full conformance with extensive tests" OFF
WARN_IF_OFF "Full conformance mode (SYCL_CTS_ENABLE_FULL_CONFORMANCE) should be used for conformance submission")

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_PROPERTIES_TESTS
"Enable extension oneAPI compile-time property list tests" OFF)

# TODO: Should SYCL_CTS_ENABLE_FULL_CONFORMANCE=ON imply this?
add_cts_option(SYCL_CTS_ENABLE_DEPRECATED_FEATURES_TESTS
"Enable tests for deprecated SYCL features" ON
WARN_IF_OFF "Tests for deprecated SYCL features should be enabled for conformance submission")

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS
"Enable all extension oneAPI tests" OFF)

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_PROPERTIES_TESTS
"Enable extension oneAPI compile-time property list tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_SUB_GROUP_MASK_TESTS
"Enable extension oneAPI sub_group_mask tests" OFF)
"Enable extension oneAPI sub_group_mask tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_DEVICE_GLOBAL_TESTS
"Enable extension oneAPI device_global tests" OFF)
"Enable extension oneAPI device_global tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_MEMCPY2D_TESTS
"Enable extension oneAPI memcpy2d tests" OFF)
"Enable extension oneAPI memcpy2d tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_ENQUEUE_BARRIER_TESTS
"Enable extension oneAPI enqueue_barrier tests" OFF)
"Enable extension oneAPI enqueue_barrier tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_WEAK_OBJECT_TESTS
"Enable extension oneAPI weak_object tests" OFF)
"Enable extension oneAPI weak_object tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_QUEUE_EMPTY
"Enable extension oneAPI queue_empty tests" OFF)
"Enable extension oneAPI queue_empty tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_DISCARD_QUEUE_EVENTS_TESTS
"Enable extension oneAPI discard_queue_events tests" OFF)
"Enable extension oneAPI discard_queue_events tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

add_cts_option(SYCL_CTS_ENABLE_EXT_ONEAPI_BFLOAT16_TESTS
"Enable extension oneAPI bfloat16 tests" OFF)
"Enable extension oneAPI bfloat16 tests" OFF
FORCE_ON ${SYCL_CTS_ENABLE_EXT_ONEAPI_TESTS})

# TODO: Deprecated - remove
add_cts_option(SYCL_CTS_ENABLE_VERBOSE_LOG
Expand Down
9 changes: 7 additions & 2 deletions cmake/AddCTSOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ set(SYCL_CTS_DETAIL_OPTION_COMPILE_DEFINITIONS "")
# Use `#if <OPTION>` instead of `#ifdef <OPTION>`.
#
# Optional parameters:
# - WARN_IF_OFF <msg> Print a warning message if this option is set to OFF.
# - WARN_IF_OFF <msg> Print a warning message if this option is set to OFF.
# - FORCE_ON <value> If <value> is ON the option will be overwritten as ON.
#
function(add_cts_option option_name option_description option_default)
cmake_parse_arguments(PARSE_ARGV 3 args "" "WARN_IF_OFF" "")
cmake_parse_arguments(PARSE_ARGV 3 args "" "WARN_IF_OFF;FORCE_ON" "")

option(${option_name} ${option_description} ${option_default})
list(APPEND SYCL_CTS_DETAIL_AVAILABLE_OPTIONS ${option_name})
Expand All @@ -26,6 +27,10 @@ function(add_cts_option option_name option_description option_default)
set("${option_name}_WARN_IF_OFF" ${args_WARN_IF_OFF} PARENT_SCOPE)
endif()

if (args_FORCE_ON)
set(${option_name} ON CACHE BOOL "" FORCE)
endif()

list(APPEND SYCL_CTS_DETAIL_OPTION_COMPILE_DEFINITIONS "${option_name}=$<BOOL:${${option_name}}>")
set(SYCL_CTS_DETAIL_OPTION_COMPILE_DEFINITIONS ${SYCL_CTS_DETAIL_OPTION_COMPILE_DEFINITIONS} PARENT_SCOPE)
endfunction()
Expand Down

0 comments on commit af335a7

Please sign in to comment.