From 884355427c8066a0687c89997809d84b243b5152 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 6 Oct 2025 12:42:38 -0400 Subject: [PATCH 01/13] removing ONEDPL_DEVICE_TYPE and ONEDPL_DEVICE_BACKEND Signed-off-by: Dan Hoeflinger --- .github/workflows/ci-testing.yml | 7 +-- CMakeLists.txt | 48 +++---------------- CONTRIBUTING.md | 2 +- cmake/README.md | 2 - .../library_guide/introduction/onedpl_gsg.rst | 4 +- documentation/library_guide/onedpl_gsg.rst | 3 +- test/CMakeLists.txt | 15 ------ 7 files changed, 16 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index ab0b4ec93ba..684dd20e030 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -222,9 +222,9 @@ jobs: if [[ "${{ matrix.cxx_compiler }}" == "icpx" ]]; then warning_flags="${warning_flags} -Wno-error=recommended-option" fi - + set ONEAPI_DEVICE_SELECTOR=*:${{ matrix.device_type }} cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DONEDPL_DEVICE_TYPE=${{ matrix.device_type }} -DCMAKE_CXX_FLAGS="${warning_flags}" .. + -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DCMAKE_CXX_FLAGS="${warning_flags}" .. make VERBOSE=1 -j${BUILD_CONCURRENCY} ${make_targets} |& tee build.log ctest --timeout ${TEST_TIMEOUT} --output-on-failure ${ctest_flags} |& tee ctest.log @@ -341,12 +341,13 @@ jobs: set warning_flags=-Wall -Werror -Wno-error=sign-compare -Wno-error=pass-failed ) - cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DONEDPL_DEVICE_TYPE=${{ matrix.device_type }} -DCMAKE_CXX_FLAGS="%warning_flags%" .. + cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DCMAKE_CXX_FLAGS="%warning_flags%" .. if !errorlevel! neq 0 set exit_code=!errorlevel! for %%t in (%ninja_targets%) do ( ninja -j 2 -v "%%t" >> build.log 2>&1 if !errorlevel! neq 0 set exit_code=!errorlevel! ) + set ONEAPI_DEVICE_SELECTOR=*:${{ matrix.device_type }} ctest --timeout %TEST_TIMEOUT% -C ${{ matrix.build_type }} --output-on-failure %ctest_flags% > ctest.log 2>&1 if !errorlevel! neq 0 set exit_code=!errorlevel! type ctest.log diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e1c646595e..3bbd8c11fc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,50 +210,14 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") ) if (ONEDPL_BACKEND MATCHES "^(dpcpp|dpcpp_only)$") - # check device type for oneDPL test targets - if (ONEDPL_DEVICE_TYPE MATCHES "^(CPU|GPU|FPGA_EMU|FPGA_HW)$") - if (NOT _ONEDPL_PSTL_OFFLOAD STREQUAL off) - message(FATAL_ERROR "PSTL offload does device selection on its own, ONEDPL_DEVICE_TYPE ${ONEDPL_DEVICE_TYPE} is useless.") - endif() - message(STATUS "Using ${ONEDPL_DEVICE_TYPE} device type") - set(ONEDPL_USE_DEVICE_${ONEDPL_DEVICE_TYPE} TRUE) - elseif (DEFINED ONEDPL_DEVICE_BACKEND) - message(FATAL_ERROR "Unsupported device type: ${ONEDPL_DEVICE_TYPE}.\n" - "Select one of the following devices: CPU, GPU, FPGA_EMU or FPGA_HW") - elseif (NOT _ONEDPL_PSTL_OFFLOAD STREQUAL off) - # PSTL offload does device selection on its own - else() - set(ONEDPL_DEVICE_TYPE "GPU") - message(STATUS "Using a default device type (GPU)") - endif() - - # check device backend - if (ONEDPL_DEVICE_BACKEND MATCHES "^(opencl|level_zero|cuda|hip|\\*)$") - message(STATUS "Using ${ONEDPL_DEVICE_BACKEND} device backend") - elseif (DEFINED ONEDPL_DEVICE_BACKEND) - message(FATAL_ERROR "Unsupported device backend: ${ONEDPL_DEVICE_BACKEND}.\n" - "Select one of the following device backends: opencl, level_zero, cuda, hip or *") - else() - set(ONEDPL_DEVICE_BACKEND "*") - message(STATUS "Using a default device backend (*)") + # Add warning for removed feature ONEDPL_DEVICE_TYPE if used + if (ONEDPL_DEVICE_TYPE) + message(STATUS "Warning: ONEDPL_DEVICE_TYPE feature has been removed, please use ONEAPI_DEVICE_SELECTOR instead.") endif() - if (INTEL_LLVM_COMPILER AND INTEL_LLVM_COMPILER_VERSION VERSION_LESS 2023.1) - set(DEVICE_SELECTION_VARIABLE "SYCL_DEVICE_FILTER") - set(FPGA_DEVICE_TYPE "acc") - else() - set(DEVICE_SELECTION_VARIABLE "ONEAPI_DEVICE_SELECTOR") - set(FPGA_DEVICE_TYPE "fpga") - endif() - - # set up device selection line basing on ONEDPL_DEVICE_BACKEND and ONEDPL_DEVICE_TYPE values - if (DEFINED ONEDPL_DEVICE_BACKEND AND DEFINED ONEDPL_DEVICE_TYPE) - if (ONEDPL_DEVICE_TYPE MATCHES "FPGA") - set(DEVICE_SELECTION_LINE "${DEVICE_SELECTION_VARIABLE}=${ONEDPL_DEVICE_BACKEND}:${FPGA_DEVICE_TYPE}") - else() - string(TOLOWER ${ONEDPL_DEVICE_TYPE} ONEDPL_DEVICE_TYPE) - set(DEVICE_SELECTION_LINE "${DEVICE_SELECTION_VARIABLE}=${ONEDPL_DEVICE_BACKEND}:${ONEDPL_DEVICE_TYPE}") - endif() + # Add warning for removed feature ONEDPL_DEVICE_BACKEND if used + if (ONEDPL_DEVICE_BACKEND) + message(STATUS "Warning: ONEDPL_DEVICE_BACKEND feature has been removed, please use ONEAPI_DEVICE_SELECTOR instead.") endif() # Check correctness of STATIC_REPORT diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0174e52e313..7db87c5e0c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,7 +51,7 @@ using the GPU on your local system using the IntelĀ® oneAPI DPC++ Compiler. 1. Configure the build files by running the following command that creates a build directory named `build_gpu_tests`. ``` -cmake -DCMAKE_CXX_COMPILER=icpx -DCMAKE_CXX_STANDARD=17 -DONEDPL_BACKEND=dpcpp -DONEDPL_DEVICE_TYPE=gpu -DCMAKE_BUILD_TYPE=release -B build_gpu_tests +cmake -DCMAKE_CXX_COMPILER=icpx -DCMAKE_CXX_STANDARD=17 -DONEDPL_BACKEND=dpcpp -DCMAKE_BUILD_TYPE=release -B build_gpu_tests ``` 2. Build the tests diff --git a/cmake/README.md b/cmake/README.md index 08fb4cb90e0..09a17ceef92 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -9,8 +9,6 @@ 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 | Select device type for oneDPL test targets; affects only DPC++ backends; supported values: GPU, CPU, FPGA_HW, FPGA_EMU | GPU | -| ONEDPL_DEVICE_BACKEND | STRING | Select device backend type for oneDPL test targets; affects only oneDPL DPC++ backends; supported values: opencl, level_zero, cuda, hip or * (the best backend as per DPC++ runtime heuristics). | * | | 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 (deprecated) | BOOL | Enable ahead-of-time compilation for the GPU or CPU device types. Deprecated, use standard CMake means such as `CMAKE_CXX_FLAGS` | OFF | diff --git a/documentation/library_guide/introduction/onedpl_gsg.rst b/documentation/library_guide/introduction/onedpl_gsg.rst index b0274307b33..5e84da582ab 100644 --- a/documentation/library_guide/introduction/onedpl_gsg.rst +++ b/documentation/library_guide/introduction/onedpl_gsg.rst @@ -130,7 +130,9 @@ the random numbers themselves. Random number generation is performed in a vector to improve the speed of your computations. This example performs its computations on your default SYCL device. You can set the -``SYCL_DEVICE_TYPE`` environment variable to CPU or GPU. +``ONEAPI_DEVICE_SELECTOR`` environment variable to control +`device selection `_. + .. code:: cpp diff --git a/documentation/library_guide/onedpl_gsg.rst b/documentation/library_guide/onedpl_gsg.rst index f1d94b8aa64..6162fa08e0f 100644 --- a/documentation/library_guide/onedpl_gsg.rst +++ b/documentation/library_guide/onedpl_gsg.rst @@ -139,7 +139,8 @@ the random numbers themselves. Random number generation is performed in a vector to improve the speed of your computations. This example performs its computations on your default SYCL device. You can set the -``SYCL_DEVICE_TYPE`` environment variable to CPU or GPU. +``ONEAPI_DEVICE_SELECTOR`` environment variable to control +`device selection `_. .. code:: cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index db025b579a1..0817a0ab876 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -132,21 +132,6 @@ macro(onedpl_construct_exec test_source_file _test_name switch_off_checked_itera set_tests_properties(${_test_name} PROPERTIES SKIP_RETURN_CODE 77) - if (NOT _ONEDPL_PSTL_OFFLOAD STREQUAL off) - if (DEFINED DEVICE_SELECTION_LINE) - message(FATAL_ERROR "PSTL offload tests ${_test_name} don't need ${DEVICE_SELECTION_LINE} variable, so one should be not set.") - endif() - # This test is only one requiring device selection environment, set it manually. - if ("${_test_name}" STREQUAL selected_different_device.pass AND _ONEDPL_PSTL_OFFLOAD MATCHES "(cpu|gpu)") - set_tests_properties(${_test_name} PROPERTIES ENVIRONMENT "${DEVICE_SELECTION_VARIABLE}=${ONEDPL_DEVICE_BACKEND}:${_ONEDPL_PSTL_OFFLOAD}") - endif() - elseif (DEFINED DEVICE_SELECTION_LINE) - file(GLOB_RECURSE DS_TESTS "parallel_api/dynamic_selection/*.cpp") - if (NOT "${DS_TESTS}" MATCHES "${_test_name}") # do not set SYCL_DEVICE_FILTER for dynamic selection tests - set_tests_properties(${_test_name} PROPERTIES ENVIRONMENT ${DEVICE_SELECTION_LINE}) - endif() - endif() - add_custom_target(run-${_test_name} COMMAND "${CMAKE_CTEST_COMMAND}" -R ^${_test_name}$$ --output-on-failure --no-label-summary USES_TERMINAL From 6a176bb2ba4821fb322da01fefbe15a7726452dc Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 6 Oct 2025 12:50:50 -0400 Subject: [PATCH 02/13] moving device selector line Signed-off-by: Dan Hoeflinger --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 684dd20e030..b4310f93c94 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -222,10 +222,10 @@ jobs: if [[ "${{ matrix.cxx_compiler }}" == "icpx" ]]; then warning_flags="${warning_flags} -Wno-error=recommended-option" fi - set ONEAPI_DEVICE_SELECTOR=*:${{ matrix.device_type }} cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DCMAKE_CXX_FLAGS="${warning_flags}" .. make VERBOSE=1 -j${BUILD_CONCURRENCY} ${make_targets} |& tee build.log + set ONEAPI_DEVICE_SELECTOR=*:${{ matrix.device_type }} ctest --timeout ${TEST_TIMEOUT} --output-on-failure ${ctest_flags} |& tee ctest.log # Generate a summary From 08729af02269da2ac4d7d5cb283d3ec0b2c0a5a1 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 6 Oct 2025 12:52:23 -0400 Subject: [PATCH 03/13] adding usage in contributing Signed-off-by: Dan Hoeflinger --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7db87c5e0c8..b800bc13368 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,8 +59,9 @@ cmake -DCMAKE_CXX_COMPILER=icpx -DCMAKE_CXX_STANDARD=17 -DONEDPL_BACKEND=dpcpp - cmake --build build_gpu_tests --target build-onedpl-tests # specify a specific test name (e.g., reduce.pass) to build a single test ``` -3. Run the tests from the `build_gpu_tests` directory +3. Run the tests from the `build_gpu_tests` directory targetting a gpu device ``` +set ONEAPI_DEVICE_SELECTOR=*:gpu ctest --output-on-failure --timeout 1200 -R ^reduce.pass$ # Add -R testname (e.g., -R ^reduce.pass$) to run just one test. ``` From f226156db8d4eeba27fe7764e2bf84cd5483ffcd Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 6 Oct 2025 12:56:43 -0400 Subject: [PATCH 04/13] adding appropriate directory to run ctest from Signed-off-by: Dan Hoeflinger --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b800bc13368..bfa1db18409 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,7 @@ cmake --build build_gpu_tests --target build-onedpl-tests # specify a specific t 3. Run the tests from the `build_gpu_tests` directory targetting a gpu device ``` +cd build_gpu_tests set ONEAPI_DEVICE_SELECTOR=*:gpu ctest --output-on-failure --timeout 1200 -R ^reduce.pass$ # Add -R testname (e.g., -R ^reduce.pass$) to run just one test. ``` From 7f22d58f5791023726e958d39eabb3e53d6c61ef Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 6 Oct 2025 13:03:20 -0400 Subject: [PATCH 05/13] minor fixes Signed-off-by: Dan Hoeflinger --- .github/workflows/ci-testing.yml | 2 +- CONTRIBUTING.md | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index b4310f93c94..6db0bf1f2a3 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -225,7 +225,7 @@ jobs: cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DCMAKE_CXX_FLAGS="${warning_flags}" .. make VERBOSE=1 -j${BUILD_CONCURRENCY} ${make_targets} |& tee build.log - set ONEAPI_DEVICE_SELECTOR=*:${{ matrix.device_type }} + ONEAPI_DEVICE_SELECTOR=*:${{ matrix.device_type }} ctest --timeout ${TEST_TIMEOUT} --output-on-failure ${ctest_flags} |& tee ctest.log # Generate a summary diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfa1db18409..f5b82a35e31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,10 +59,19 @@ cmake -DCMAKE_CXX_COMPILER=icpx -DCMAKE_CXX_STANDARD=17 -DONEDPL_BACKEND=dpcpp - cmake --build build_gpu_tests --target build-onedpl-tests # specify a specific test name (e.g., reduce.pass) to build a single test ``` -3. Run the tests from the `build_gpu_tests` directory targetting a gpu device +3. Select GPU device target +* Windows: ``` -cd build_gpu_tests set ONEAPI_DEVICE_SELECTOR=*:gpu +``` +* Linux: +``` +ONEAPI_DEVICE_SELECTOR=*:gpu +``` + +4. Run the tests from the `build_gpu_tests` directory targetting a gpu device +``` +cd build_gpu_tests ctest --output-on-failure --timeout 1200 -R ^reduce.pass$ # Add -R testname (e.g., -R ^reduce.pass$) to run just one test. ``` From dfac052004f37d10bfaee56271479af92fc2c8b4 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 6 Oct 2025 13:15:05 -0400 Subject: [PATCH 06/13] spelling Signed-off-by: Dan Hoeflinger --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5b82a35e31..47d8c93786f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ set ONEAPI_DEVICE_SELECTOR=*:gpu ONEAPI_DEVICE_SELECTOR=*:gpu ``` -4. Run the tests from the `build_gpu_tests` directory targetting a gpu device +4. Run the tests from the `build_gpu_tests` directory targeting a gpu device ``` cd build_gpu_tests ctest --output-on-failure --timeout 1200 -R ^reduce.pass$ # Add -R testname (e.g., -R ^reduce.pass$) to run just one test. From ee237a61d5a64cb00dd9bfe2f7b3da0b797a5fe2 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Tue, 7 Oct 2025 10:38:23 -0400 Subject: [PATCH 07/13] switching to errors and suggesting equivalent device selector Signed-off-by: Dan Hoeflinger --- CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bbd8c11fc2..c9360dd32cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,16 +209,20 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") $<$:ONEDPL_USE_DPCPP_BACKEND=0> ) - if (ONEDPL_BACKEND MATCHES "^(dpcpp|dpcpp_only)$") - # Add warning for removed feature ONEDPL_DEVICE_TYPE if used - if (ONEDPL_DEVICE_TYPE) - message(STATUS "Warning: ONEDPL_DEVICE_TYPE feature has been removed, please use ONEAPI_DEVICE_SELECTOR instead.") + # Add error for removed feature ONEDPL_DEVICE_TYPE if used + if (ONEDPL_DEVICE_TYPE OR DEFINED ONEDPL_DEVICE_BACKEND) + set(device_backend "*") + set(device_type "*") + if (DEFINED ONEDPL_DEVICE_TYPE) + string(TOLOWER "${ONEDPL_DEVICE_TYPE}" device_type) endif() - - # Add warning for removed feature ONEDPL_DEVICE_BACKEND if used - if (ONEDPL_DEVICE_BACKEND) - message(STATUS "Warning: ONEDPL_DEVICE_BACKEND feature has been removed, please use ONEAPI_DEVICE_SELECTOR instead.") + if (DEFINED ONEDPL_DEVICE_BACKEND) + string(TOLOWER "${ONEDPL_DEVICE_BACKEND}" device_backend) endif() + message(FATAL_ERROR "ONEDPL_DEVICE_TYPE and ONEDPL_DEVICE_BACKEND cmake settings have been removed.\nUse \"ONEAPI_DEVICE_SELECTOR=${device_backend}:${device_type}\" before running instead for the same effect.") + endif() + + if (ONEDPL_BACKEND MATCHES "^(dpcpp|dpcpp_only)$") # Check correctness of STATIC_REPORT if (ONEDPL_FPGA_STATIC_REPORT) From da3fe114e0f0d31df4a6c382f1bf921399d05ef0 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Tue, 7 Oct 2025 11:39:52 -0400 Subject: [PATCH 08/13] remove DEVICE_SELECTION_LINE usage Signed-off-by: Dan Hoeflinger --- test/kt/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/kt/CMakeLists.txt b/test/kt/CMakeLists.txt index c9ce7d974cd..bdd0b7aa16c 100644 --- a/test/kt/CMakeLists.txt +++ b/test/kt/CMakeLists.txt @@ -23,9 +23,6 @@ function(_generate_test _target_name _test_path) add_test(NAME ${_target_name} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${_target_name}) set_tests_properties(${_target_name} PROPERTIES SKIP_RETURN_CODE 77) - if (DEFINED DEVICE_SELECTION_LINE) - set_tests_properties(${_target_name} PROPERTIES ENVIRONMENT ${DEVICE_SELECTION_LINE}) - endif() add_custom_target(run-${_target_name} COMMAND "${CMAKE_CTEST_COMMAND}" -R ^${_target_name}$$ --output-on-failure --no-label-summary From 181a3fb9c7a8aa38bc69dc7024e2f2efebf9cc47 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Thu, 9 Oct 2025 13:35:54 -0400 Subject: [PATCH 09/13] Removal of AOT compilation settings Signed-off-by: Dan Hoeflinger --- CMakeLists.txt | 62 ++++--------------------------------------------- cmake/README.md | 2 -- 2 files changed, 5 insertions(+), 59 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9360dd32cf..39c52981783 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ include(CMakeDependentOption) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) option(ONEDPL_FPGA_STATIC_REPORT "Enable the static report generation for the FPGA device" OFF) -option(ONEDPL_USE_AOT_COMPILATION "Enable ahead of time compilation (deprecated)" OFF) option(ONEDPL_ENABLE_SIMD "Enable SIMD vectorization by passing an OpenMP SIMD flag to the compiler if supported" ON) cmake_dependent_option(ONEDPL_TEST_WIN_ICX_FIXES "Enable icx workarounds for Windows" ON "CMAKE_HOST_WIN32;NOT _onedpl_is_subproject" OFF) @@ -210,7 +209,7 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") ) # Add error for removed feature ONEDPL_DEVICE_TYPE if used - if (ONEDPL_DEVICE_TYPE OR DEFINED ONEDPL_DEVICE_BACKEND) + if (DEFINED ONEDPL_DEVICE_TYPE OR DEFINED ONEDPL_DEVICE_BACKEND) set(device_backend "*") set(device_type "*") if (DEFINED ONEDPL_DEVICE_TYPE) @@ -222,50 +221,13 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") message(FATAL_ERROR "ONEDPL_DEVICE_TYPE and ONEDPL_DEVICE_BACKEND cmake settings have been removed.\nUse \"ONEAPI_DEVICE_SELECTOR=${device_backend}:${device_type}\" before running instead for the same effect.") endif() - if (ONEDPL_BACKEND MATCHES "^(dpcpp|dpcpp_only)$") - - # Check correctness of STATIC_REPORT - if (ONEDPL_FPGA_STATIC_REPORT) - if (NOT ONEDPL_USE_DEVICE_FPGA_HW) - message(FATAL_ERROR "Static report can only be generated for FPGA hardware") - else() - message(STATUS "Static report will be generated") - endif() - endif() + if (DEFINED ONEDPL_USE_AOT_COMPILATION) + message(FATAL_ERROR "ONEDPL_USE_AOT_COMPILATION is has been removed, instead use -fsycl-targets directly to CMAKE_CXX_FLAGS to specify ahead-of-time compilation targets.") + endif() - # settings for the specific compilation type - if (NOT ONEDPL_USE_AOT_COMPILATION) - message(STATUS "Using just-in-time compilation") - else() - message(WARNING "ONEDPL_USE_AOT_COMPILATION is deprecated and will be removed in a future release") - if (NOT ONEDPL_AOT_ARCH) - if (ONEDPL_USE_DEVICE_GPU) - set(ONEDPL_AOT_ARCH "*") - endif() - if (ONEDPL_USE_DEVICE_CPU) - set(ONEDPL_AOT_ARCH "avx") - endif() - else() - message(WARNING "ONEDPL_AOT_ARCH is deprecated and will be removed in a future release") - endif() - message(STATUS "Using ahead-of-time compilation for \"${ONEDPL_AOT_ARCH}\" architecture(s)") - if (ONEDPL_USE_DEVICE_GPU) - # -cl-kernel-debug-enable is not needed since https://github.com/intel/compute-runtime/commit/9c237d99ec49ceb3678c815314bc7c745226e4a2 - # TODO: remove that option when older driver versions are not expected to be used - set(ONEDPL_AOT_EXTRA_BACKEND_OPTIONS "$<$,$>:-internal_options -cl-kernel-debug-enable>") - set(ONEDPL_AOT_OPTIONS "-fsycl-targets=spir64_gen -Xs \"-device ${ONEDPL_AOT_ARCH} ${ONEDPL_AOT_EXTRA_BACKEND_OPTIONS}\"") - endif() - if (ONEDPL_USE_DEVICE_CPU) - set(ONEDPL_AOT_OPTIONS "-fsycl-targets=spir64_x86_64 -Xs \"-march=${ONEDPL_AOT_ARCH}\"") - endif() - endif() + if (ONEDPL_BACKEND MATCHES "^(dpcpp|dpcpp_only)$") - # DPC++ specific compiler options - target_compile_options(oneDPL INTERFACE - ${FSYCL_OPTION_IF_SUPPORTED} - $<$,$>:-fintelfpga> - ) if (DEFINED ONEDPL_USE_UNNAMED_LAMBDA) if(ONEDPL_USE_UNNAMED_LAMBDA) message(STATUS "Adding -fsycl-unnamed-lambda option") @@ -286,20 +248,6 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") endif() endif() - # DPC++ specific macro - target_compile_definitions(oneDPL INTERFACE - $<$,$>:ONEDPL_FPGA_DEVICE> - $<$:ONEDPL_FPGA_EMULATOR> - ) - - # DPC++ specific link options - target_link_libraries(oneDPL INTERFACE - ${FSYCL_OPTION_IF_SUPPORTED} - $<$,$>:-fintelfpga> - $<$:-Xshardware> - $<$,$>:-fsycl-link> - ${ONEDPL_AOT_OPTIONS} - ) endif() elseif(ONEDPL_BACKEND MATCHES "^(serial)$") diff --git a/cmake/README.md b/cmake/README.md index 09a17ceef92..9da4573dd27 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -11,9 +11,7 @@ The following variables are provided for oneDPL configuration: | 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_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 (deprecated) | BOOL | Enable ahead-of-time compilation for the GPU or CPU device types. Deprecated, use standard CMake means such as `CMAKE_CXX_FLAGS` | OFF | | ONEDPL_ENABLE_SIMD | BOOL | Enable SIMD vectorization by passing an OpenMP SIMD flag to the compiler if supported; the flag is passed to user project compilation string if enabled | ON | -| ONEDPL_AOT_ARCH (deprecated) | STRING | Architecture options for ahead-of-time compilation, supported values can be found [here](https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html). Deprecated, use standard CMake means such as `CMAKE_CXX_FLAGS` | "*" for GPU device and "avx" for CPU device | | ONEDPL_TEST_EXPLICIT_KERNEL_NAMES | STRING | Control kernel naming. Affects only oneDPL test targets. Supported values: AUTO, ALWAYS. AUTO: rely on the compiler if "Unnamed SYCL lambda kernels" feature is on, otherwise provide kernel names explicitly; ALWAYS: provide kernel names explicitly | AUTO | | ONEDPL_TEST_WIN_ICX_FIXES | BOOL | Affects only oneDPL test targets. Enable icx, icx-cl workarounds to fix issues in CMake for Windows. | ON | | ONEDPL_WORKAROUND_FOR_IGPU_64BIT_REDUCTION | BOOL | Use as a workaround for incorrect results, which may be produced by reduction algorithms with 64-bit data types compiled by the Intel® oneAPI DPC++/C++ Compiler and executed on GPU devices. | | From ce46b6c5d293c868b12f764c108d8e5557b4efd8 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Thu, 9 Oct 2025 13:39:38 -0400 Subject: [PATCH 10/13] adding "environment variable" Signed-off-by: Dan Hoeflinger --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39c52981783..226807a0aa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,7 +218,7 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") if (DEFINED ONEDPL_DEVICE_BACKEND) string(TOLOWER "${ONEDPL_DEVICE_BACKEND}" device_backend) endif() - message(FATAL_ERROR "ONEDPL_DEVICE_TYPE and ONEDPL_DEVICE_BACKEND cmake settings have been removed.\nUse \"ONEAPI_DEVICE_SELECTOR=${device_backend}:${device_type}\" before running instead for the same effect.") + message(FATAL_ERROR "ONEDPL_DEVICE_TYPE and ONEDPL_DEVICE_BACKEND cmake settings have been removed.\nUse environment variable \"ONEAPI_DEVICE_SELECTOR=${device_backend}:${device_type}\" before running instead for the same effect.") endif() if (DEFINED ONEDPL_USE_AOT_COMPILATION) From 3dec5da2c194a393d8b6276af96ec9f5b844cb2a Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 10 Oct 2025 12:05:43 -0400 Subject: [PATCH 11/13] restoring fsycl option Signed-off-by: Dan Hoeflinger --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 226807a0aa5..2dc87f599b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,6 +248,9 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") endif() endif() + # DPC++ specific link options + target_link_libraries(oneDPL INTERFACE ${FSYCL_OPTION_IF_SUPPORTED}) + endif() elseif(ONEDPL_BACKEND MATCHES "^(serial)$") From e8798525b5449e32c704a2ed257e6c19e2958dc6 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 10 Oct 2025 15:47:26 -0400 Subject: [PATCH 12/13] fully remove ONEDPL_FPGA_STATIC_REPORT Signed-off-by: Dan Hoeflinger --- CMakeLists.txt | 1 - cmake/README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dc87f599b2..10b489b0d5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ get_directory_property(_onedpl_is_subproject PARENT_DIRECTORY) include(CMakeDependentOption) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -option(ONEDPL_FPGA_STATIC_REPORT "Enable the static report generation for the FPGA device" OFF) option(ONEDPL_ENABLE_SIMD "Enable SIMD vectorization by passing an OpenMP SIMD flag to the compiler if supported" ON) cmake_dependent_option(ONEDPL_TEST_WIN_ICX_FIXES "Enable icx workarounds for Windows" ON "CMAKE_HOST_WIN32;NOT _onedpl_is_subproject" OFF) diff --git a/cmake/README.md b/cmake/README.md index 9da4573dd27..a1e38ff1249 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -10,7 +10,6 @@ The following variables are provided for oneDPL configuration: |------------------------------------------|--------|-----------------------------------------------------------------------------------------------|---------------| | 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_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_ENABLE_SIMD | BOOL | Enable SIMD vectorization by passing an OpenMP SIMD flag to the compiler if supported; the flag is passed to user project compilation string if enabled | ON | | ONEDPL_TEST_EXPLICIT_KERNEL_NAMES | STRING | Control kernel naming. Affects only oneDPL test targets. Supported values: AUTO, ALWAYS. AUTO: rely on the compiler if "Unnamed SYCL lambda kernels" feature is on, otherwise provide kernel names explicitly; ALWAYS: provide kernel names explicitly | AUTO | | ONEDPL_TEST_WIN_ICX_FIXES | BOOL | Affects only oneDPL test targets. Enable icx, icx-cl workarounds to fix issues in CMake for Windows. | ON | From 3597657eacb29a4232be926277badffcb6493a9b Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 10 Oct 2025 16:11:42 -0400 Subject: [PATCH 13/13] restoring accidentally removed compiler option Signed-off-by: Dan Hoeflinger --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10b489b0d5d..58b42091d7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,6 +227,9 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") if (ONEDPL_BACKEND MATCHES "^(dpcpp|dpcpp_only)$") + #DPC++ specific compiler options + target_compile_options(oneDPL INTERFACE ${FSYCL_OPTION_IF_SUPPORTED}) + if (DEFINED ONEDPL_USE_UNNAMED_LAMBDA) if(ONEDPL_USE_UNNAMED_LAMBDA) message(STATUS "Adding -fsycl-unnamed-lambda option")