Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$")
"Select one of the following devices: CPU, GPU, FPGA_EMU or FPGA_HW")
endif()

# check device backend
if (ONEDPL_DEVICE_BACKEND AND ONEDPL_DEVICE_BACKEND MATCHES "^(opencl|level_zero?)$")
message(STATUS "Compilation using ${ONEDPL_DEVICE_BACKEND} device backend")
elseif(ONEDPL_DEVICE_BACKEND)
message(FATAL_ERROR "Unsupported device backend: ${ONEDPL_DEVICE_BACKEND}.\n"
"Select one of the following device backends: *, opencl or level_zero")
else()
set(ONEDPL_DEVICE_BACKEND "*")
message(STATUS "Use a default device backend")
endif()

# Check correctness of STATIC_REPORT
if (ONEDPL_FPGA_STATIC_REPORT)
if (NOT ONEDPL_USE_DEVICE_FPGA_HW)
Expand Down
3 changes: 2 additions & 1 deletion cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The following variables are provided for oneDPL configuration:
| Variable | Type | Description | Default value |
|------------------------------|--------|-----------------------------------------------------------------------------------------------|---------------|
| ONEDPL_BACKEND | STRING | Threading backend; supported values: tbb, dpcpp, dpcpp_only, serial, ...; the default value is defined by compiler: dpcpp for DPC++ and tbb for others | tbb/dpcpp |
| ONEDPL_DEVICE_TYPE | STRING | Device type, applicable only for sycl backends; supported values: GPU, CPU, FPGA_HW, FPGA_EMU | GPU |
| ONEDPL_DEVICE_TYPE | STRING | Device type, applicable only for DPC++ backends; supported values: GPU, CPU, FPGA_HW, FPGA_EMU | GPU |
| ONEDPL_DEVICE_BACKEND | STRING | Device backend type, applicable only for oneDPL DPC++ backends; supported values: opencl, level_zero. | Any(*) |
| ONEDPL_USE_UNNAMED_LAMBDA | BOOL | Pass `-fsycl-unnamed-lambda`, `-fno-sycl-unnamed-lambda` compile options or nothing | |
| ONEDPL_FPGA_STATIC_REPORT | BOOL | Enable the static report generation for the FPGA_HW device type | OFF |
| ONEDPL_USE_AOT_COMPILATION | BOOL | Enable the ahead of time compilation via OpenCL™ Offline Compiler (OCLOC) | OFF |
Expand Down
10 changes: 5 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ macro(onedpl_add_test test_source_file)
add_test(NAME ${_test_name} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${_test_name})
set_tests_properties(${_test_name} PROPERTIES SKIP_RETURN_CODE 77)
if (ONEDPL_DEVICE_TYPE)
# TODO: Consider replacement of SYCL_DEVICE_TYPE with a new variable.
# See for details: https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md
set(SYCL_DEVICE_TYPE ${ONEDPL_DEVICE_TYPE})
if (ONEDPL_DEVICE_TYPE MATCHES "FPGA")
set(SYCL_DEVICE_TYPE ACC)
set(SYCL_DEVICE_FILTER *:acc)
else()
string(TOLOWER ${ONEDPL_DEVICE_TYPE} ONEDPL_DEVICE_TYPE)
set(SYCL_DEVICE_FILTER ${ONEDPL_DEVICE_BACKEND}:${ONEDPL_DEVICE_TYPE})
endif()
set_tests_properties(${_test_name} PROPERTIES ENVIRONMENT SYCL_DEVICE_TYPE=${SYCL_DEVICE_TYPE})
set_tests_properties(${_test_name} PROPERTIES ENVIRONMENT SYCL_DEVICE_FILTER=${SYCL_DEVICE_FILTER})
endif()

add_custom_target(run-${_test_name}
Expand Down