From b21e04288c13fab82174dba5190bab4f88c2cd42 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Fri, 1 Aug 2025 22:48:21 +0200 Subject: [PATCH 01/13] [SYCL][Test] Add CMake target for running SYCL unit tests with ABI breaking changes enabled. --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 5 + .../modules/AddSYCLUnitTestPreview.cmake | 128 ++++++++++++++++++ sycl/unittests/CMakeLists.txt | 4 + sycl/unittests/Extensions/LaunchQueries.cpp | 4 + sycl/unittests/misc/OsUtils.cpp | 4 + .../arg_mask/EliminatedArgMask.cpp | 3 +- .../scheduler/InOrderQueueSyncCheck.cpp | 2 +- .../scheduler/SchedulerTestUtils.hpp | 3 +- sycl/unittests/xpti_trace/CMakeLists.txt | 1 + 9 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 sycl/cmake/modules/AddSYCLUnitTestPreview.cmake diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index e3abede83bb41..ad5a1272ded6c 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -1,8 +1,13 @@ +include(AddSYCLUnitTestPreview) + # add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) # # Will compile the list of files together and link against SYCL. # Produces a binary names `basename(test_dirname)`. macro(add_sycl_unittest test_dirname link_variant) + + add_sycl_unittest_preview(${test_dirname}_preview ${link_variant} ${ARGN}) + # Enable exception handling for these unit tests set(LLVM_REQUIRES_EH ON) set(LLVM_REQUIRES_RTTI ON) diff --git a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake new file mode 100644 index 0000000000000..a381f93efebc8 --- /dev/null +++ b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake @@ -0,0 +1,128 @@ +# add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) +# +# Will compile the list of files together and link against SYCL. +# Produces a binary names `basename(test_dirname)`. +macro(add_sycl_unittest_preview test_dirname link_variant) + # Enable exception handling for these unit tests + set(LLVM_REQUIRES_EH ON) + set(LLVM_REQUIRES_RTTI ON) + + get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR) + + string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower) + if (MSVC AND build_type_lower MATCHES "debug") + set(sycl_obj_target "sycl-previewd_object") + set(sycl_so_target "sycl-previewd") + else() + set(sycl_obj_target "sycl-preview_object") + set(sycl_so_target "sycl-preview") + endif() + + if ("${link_variant}" MATCHES "SHARED") + set(SYCL_LINK_LIBS ${sycl_so_target}) + add_unittest(SYCLUnitTestsPreview ${test_dirname} ${ARGN}) + else() + add_unittest(SYCLUnitTestsPreview ${test_dirname} + $ ${ARGN}) + target_compile_definitions(${test_dirname} + PRIVATE __SYCL_BUILD_SYCL_DLL) + + get_target_property(SYCL_LINK_LIBS ${sycl_so_target} LINK_LIBRARIES) + endif() + + if (SYCL_ENABLE_COVERAGE) + target_compile_options(${test_dirname} PUBLIC + -fprofile-instr-generate -fcoverage-mapping + ) + target_link_options(${test_dirname} PUBLIC + -fprofile-instr-generate -fcoverage-mapping + ) + endif() + + target_compile_definitions(${test_dirname} + PRIVATE __INTEL_PREVIEW_BREAKING_CHANGES) + + if (SYCL_ENABLE_XPTI_TRACING) + target_compile_definitions(${test_dirname} + PRIVATE XPTI_ENABLE_INSTRUMENTATION XPTI_STATIC_LIBRARY) + endif() + + # check-sycl-unittests was using an old sycl library. So, to get + # around this problem, we add the new sycl library to the PATH and + # LD_LIBRARY_PATH on Windows and Linux respectively. + if (WIN32) + add_custom_target(check-sycl-${test_dirname} + ${CMAKE_COMMAND} -E env + LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw" + SYCL_CONFIG_FILE_NAME=null.cfg + SYCL_DEVICELIB_NO_FALLBACK=1 + SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache" + "PATH=${CMAKE_BINARY_DIR}/bin;$ENV{PATH}" + ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname} + DEPENDS + ${test_dirname} + ) + else() + add_custom_target(check-sycl-${test_dirname} + ${CMAKE_COMMAND} -E env + LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw" + SYCL_CONFIG_FILE_NAME=null.cfg + SYCL_DEVICELIB_NO_FALLBACK=1 + SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache" + "LD_LIBRARY_PATH=${SYCL_BINARY_DIR}/unittests/lib:${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" + ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname} + DEPENDS + ${test_dirname} + ) + endif() + + add_dependencies(check-sycl-unittests-preview check-sycl-${test_dirname}) + + if(WIN32) + # Windows doesn't support LD_LIBRARY_PATH, so instead we copy the mock OpenCL binary next to the test and ensure + # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) + set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) + add_custom_command(TARGET ${test_dirname} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} + DEPENDS mockOpenCL + BYPRODUCTS ${mock_ocl} + COMMAND_EXPAND_LISTS + ) + endif() + + target_link_libraries(${test_dirname} + PRIVATE + mockOpenCL + LLVMTestingSupport + OpenCL-Headers + unified-runtime::mock + ${SYCL_LINK_LIBS} + ) + + add_dependencies(${test_dirname} ur_adapter_mock mockOpenCL) + + if(SYCL_ENABLE_EXTENSION_JIT) + target_link_libraries(${test_dirname} PRIVATE sycl-jit) + endif(SYCL_ENABLE_EXTENSION_JIT) + + if(WIN32) + target_link_libraries(${test_dirname} PRIVATE UnifiedRuntimeLoader ur_win_proxy_loader) + endif() + + target_include_directories(${test_dirname} + PRIVATE SYSTEM + ${sycl_inc_dir} + ${SYCL_SOURCE_DIR}/source/ + ${SYCL_SOURCE_DIR}/unittests/ + ) + if (UNIX) + # These warnings are coming from Google Test code. + target_compile_options(${test_dirname} + PRIVATE + -Wno-unused-parameter + -Wno-inconsistent-missing-override + ) + endif() + + target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) +endmacro() diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 62af3d0074cac..1f4bb4a8fea13 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -1,6 +1,9 @@ add_custom_target(SYCLUnitTests) set_target_properties(SYCLUnitTests PROPERTIES FOLDER "SYCL tests") +add_custom_target(SYCLUnitTestsPreview) +set_target_properties(SYCLUnitTestsPreview PROPERTIES FOLDER "SYCL tests") + foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) @@ -27,6 +30,7 @@ include(AddSYCLUnitTest) add_subdirectory(mock_opencl) add_custom_target(check-sycl-unittests) +add_custom_target(check-sycl-unittests-preview) add_subdirectory(ur) add_subdirectory(allowlist) diff --git a/sycl/unittests/Extensions/LaunchQueries.cpp b/sycl/unittests/Extensions/LaunchQueries.cpp index de2f4c7535fea..09f935e96cede 100644 --- a/sycl/unittests/Extensions/LaunchQueries.cpp +++ b/sycl/unittests/Extensions/LaunchQueries.cpp @@ -61,6 +61,9 @@ auto getKernel(const sycl::queue &Q) { return KernelBundle.get_kernel(KernelID); } +// These tests fail in preview breaking mode. +// Failure Tracker: https://github.com/intel/llvm/issues/18910 +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES TEST(LaunchQueries, GetWorkGroupSizeSuccess) { sycl::unittest::UrMock<> Mock; mock::getCallbacks().set_replace_callback( @@ -146,6 +149,7 @@ TEST(LaunchQueries, GetMaxWorkGroupItemSizesExceptionCode) { syclex::info::kernel_queue_specific::max_work_item_sizes<3>>(Queue), sycl::exception); } +#endif // __INTEL_PREVIEW_BREAKING_CHANGES TEST(LaunchQueries, GetMaxSubGroupSize3DSuccess) { sycl::unittest::UrMock<> Mock; diff --git a/sycl/unittests/misc/OsUtils.cpp b/sycl/unittests/misc/OsUtils.cpp index 3dee379fd5151..265ed167e1df1 100644 --- a/sycl/unittests/misc/OsUtils.cpp +++ b/sycl/unittests/misc/OsUtils.cpp @@ -54,8 +54,12 @@ bool isSameDir(const char* LHS, const char* RHS) { class OsUtilsTest : public ::testing::Test { }; +// This test fails with preview breaking changes enabled. +// Failure tracker: https://github.com/intel/llvm/issues/19626 +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES TEST_F(OsUtilsTest, getCurrentDSODir) { std::string DSODir = sycl::detail::OSUtil::getCurrentDSODir(); ASSERT_TRUE(isSameDir(DSODir.c_str(), SYCL_LIB_DIR)) << "expected: " << SYCL_LIB_DIR << ", got: " << DSODir; } +#endif \ No newline at end of file diff --git a/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp b/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp index ab322bce9022b..5f3dc3be84517 100644 --- a/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp +++ b/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp @@ -136,7 +136,8 @@ class MockHandler : public sycl::handler { using sycl::handler::impl; MockHandler(sycl::detail::queue_impl &Queue) - : sycl::handler(Queue.shared_from_this(), /*CallerNeedsEvent*/ true) {} + : sycl::handler(std::make_unique( + Queue, nullptr, /*CallerNeedsEvent*/ true)) {} std::unique_ptr finalize() { auto CGH = static_cast(this); diff --git a/sycl/unittests/scheduler/InOrderQueueSyncCheck.cpp b/sycl/unittests/scheduler/InOrderQueueSyncCheck.cpp index b6380276e5826..04d2f81281de2 100644 --- a/sycl/unittests/scheduler/InOrderQueueSyncCheck.cpp +++ b/sycl/unittests/scheduler/InOrderQueueSyncCheck.cpp @@ -44,7 +44,7 @@ class LimitedHandler { #ifdef __INTEL_PREVIEW_BREAKING_CHANGES virtual sycl::detail::EventImplPtr finalize() { - return std::make_shared(); + return detail::event_impl::create_default_event(); } #else virtual event finalize() { diff --git a/sycl/unittests/scheduler/SchedulerTestUtils.hpp b/sycl/unittests/scheduler/SchedulerTestUtils.hpp index 61ed99dd87cff..043d219386157 100644 --- a/sycl/unittests/scheduler/SchedulerTestUtils.hpp +++ b/sycl/unittests/scheduler/SchedulerTestUtils.hpp @@ -221,7 +221,8 @@ sycl::detail::Requirement getMockRequirement(const MemObjT &MemObj) { class MockHandler : public sycl::handler { public: MockHandler(sycl::detail::queue_impl &Queue, bool CallerNeedsEvent) - : sycl::handler(Queue.shared_from_this(), CallerNeedsEvent) {} + : sycl::handler(std::make_unique( + Queue, nullptr, CallerNeedsEvent)) {} // Methods using sycl::handler::addReduction; using sycl::handler::getType; diff --git a/sycl/unittests/xpti_trace/CMakeLists.txt b/sycl/unittests/xpti_trace/CMakeLists.txt index 195da6d566092..09ba586e3df28 100644 --- a/sycl/unittests/xpti_trace/CMakeLists.txt +++ b/sycl/unittests/xpti_trace/CMakeLists.txt @@ -7,3 +7,4 @@ add_sycl_unittest(XptiTraceTests OBJECT QueueIDCheck.cpp ) target_link_libraries(XptiTraceTests PRIVATE xpti xptitest_subscriber) +target_link_libraries(XptiTraceTests_preview PRIVATE xpti xptitest_subscriber) From 2bf922512a8674684fdb1fb0efa04b0091574cde Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Sat, 2 Aug 2025 00:24:21 +0200 Subject: [PATCH 02/13] Use CMake's copy_if_different to avoid build rule collision --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 2 +- sycl/cmake/modules/AddSYCLUnitTestPreview.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index ad5a1272ded6c..8ecd134b3f6a4 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -85,7 +85,7 @@ macro(add_sycl_unittest test_dirname link_variant) # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) add_custom_command(TARGET ${test_dirname} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${mock_ocl} DEPENDS mockOpenCL BYPRODUCTS ${mock_ocl} COMMAND_EXPAND_LISTS diff --git a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake index a381f93efebc8..891f6171ebbd8 100644 --- a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake @@ -83,7 +83,7 @@ macro(add_sycl_unittest_preview test_dirname link_variant) # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) add_custom_command(TARGET ${test_dirname} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${mock_ocl} DEPENDS mockOpenCL BYPRODUCTS ${mock_ocl} COMMAND_EXPAND_LISTS From e5e5812e1d2d4b01b9b4e2ecc4e4dd0df2bab353 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Sat, 2 Aug 2025 00:28:30 +0200 Subject: [PATCH 03/13] Run unittests in preview mode in CI --- .github/workflows/sycl-linux-build.yml | 6 ++++++ .github/workflows/sycl-windows-build.yml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index 6f8e2a21c9636..361d86e8bf65a 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -245,6 +245,12 @@ jobs: # TODO consider moving this to Dockerfile. export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH cmake --build $GITHUB_WORKSPACE/build --target check-sycl-unittests + - name: check-sycl-unittests-preview + if: always() && !cancelled() && contains(inputs.changes, 'sycl') + run: | + # TODO consider moving this to Dockerfile. + export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH + cmake --build $GITHUB_WORKSPACE/build --target check-sycl-unittests-preview - name: check-llvm-spirv if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv') run: | diff --git a/.github/workflows/sycl-windows-build.yml b/.github/workflows/sycl-windows-build.yml index 12679a6c7812f..f1e6af3fd9b86 100644 --- a/.github/workflows/sycl-windows-build.yml +++ b/.github/workflows/sycl-windows-build.yml @@ -177,6 +177,10 @@ jobs: if: always() && !cancelled() && contains(inputs.changes, 'sycl') run: | cmake --build build --target check-sycl-unittests + - name: check-sycl-unittests-preview + if: always() && !cancelled() && contains(inputs.changes, 'sycl') + run: | + cmake --build build --target check-sycl-unittests-preview - name: check-llvm-spirv if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv') run: | From 7032e8c61d6efbd3c9894f89ed88b9d727da1db0 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Sat, 2 Aug 2025 20:22:36 +0200 Subject: [PATCH 04/13] Fix windows --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 2 +- sycl/cmake/modules/AddSYCLUnitTestPreview.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 8ecd134b3f6a4..ad5a1272ded6c 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -85,7 +85,7 @@ macro(add_sycl_unittest test_dirname link_variant) # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) add_custom_command(TARGET ${test_dirname} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${mock_ocl} + COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} DEPENDS mockOpenCL BYPRODUCTS ${mock_ocl} COMMAND_EXPAND_LISTS diff --git a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake index 891f6171ebbd8..3061dd7eb9141 100644 --- a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake @@ -83,9 +83,9 @@ macro(add_sycl_unittest_preview test_dirname link_variant) # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) add_custom_command(TARGET ${test_dirname} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${mock_ocl} + COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} DEPENDS mockOpenCL - BYPRODUCTS ${mock_ocl} + BYPRODUCTS ${mock_ocl}_preview COMMAND_EXPAND_LISTS ) endif() From 63f00e6f9fce6b21fecc8f1a1b6a511ddadb07ae Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 4 Aug 2025 20:23:38 +0200 Subject: [PATCH 05/13] Code reuse between preview and non-preview unittests --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 84 ++++++++++-- .../modules/AddSYCLUnitTestPreview.cmake | 128 ------------------ 2 files changed, 69 insertions(+), 143 deletions(-) delete mode 100644 sycl/cmake/modules/AddSYCLUnitTestPreview.cmake diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index ad5a1272ded6c..68593dbbe5d7e 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -1,13 +1,9 @@ -include(AddSYCLUnitTestPreview) - -# add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) +# Internal function to create SYCL unit tests with code reuse +# add_sycl_unittest_internal(test_dirname SHARED|OBJECT is_preview file1.cpp, file2.cpp ...) # # Will compile the list of files together and link against SYCL. # Produces a binary names `basename(test_dirname)`. -macro(add_sycl_unittest test_dirname link_variant) - - add_sycl_unittest_preview(${test_dirname}_preview ${link_variant} ${ARGN}) - +function(add_sycl_unittest_internal test_dirname link_variant is_preview) # Enable exception handling for these unit tests set(LLVM_REQUIRES_EH ON) set(LLVM_REQUIRES_RTTI ON) @@ -15,19 +11,41 @@ macro(add_sycl_unittest test_dirname link_variant) get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR) string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower) + + # Select which sycl libraries and object to link based + # on whether this is a preview build. if (MSVC AND build_type_lower MATCHES "debug") - set(sycl_obj_target "sycld_object") - set(sycl_so_target "sycld") + if (${is_preview}) + set(sycl_obj_target "sycl-previewd_object") + set(sycl_so_target "sycl-previewd") + else() + set(sycl_obj_target "sycld_object") + set(sycl_so_target "sycld") + endif() else() - set(sycl_obj_target "sycl_object") - set(sycl_so_target "sycl") + if (${is_preview}) + set(sycl_obj_target "sycl-preview_object") + set(sycl_so_target "sycl-preview") + else() + set(sycl_obj_target "sycl_object") + set(sycl_so_target "sycl") + endif() + endif() + + # Set unittest_target based on whether this is a preview build + if (${is_preview}) + set(unittest_target "SYCLUnitTestsPreview") + set(check_target_dep "check-sycl-unittests-preview") + else() + set(unittest_target "SYCLUnitTests") + set(check_target_dep "check-sycl-unittests") endif() if ("${link_variant}" MATCHES "SHARED") set(SYCL_LINK_LIBS ${sycl_so_target}) - add_unittest(SYCLUnitTests ${test_dirname} ${ARGN}) + add_unittest(${unittest_target} ${test_dirname} ${ARGN}) else() - add_unittest(SYCLUnitTests ${test_dirname} + add_unittest(${unittest_target} ${test_dirname} $ ${ARGN}) target_compile_definitions(${test_dirname} PRIVATE __SYCL_BUILD_SYCL_DLL) @@ -44,6 +62,12 @@ macro(add_sycl_unittest test_dirname link_variant) ) endif() + # Add preview-specific compile definition + if (${is_preview}) + target_compile_definitions(${test_dirname} + PRIVATE __INTEL_PREVIEW_BREAKING_CHANGES) + endif() + if (SYCL_ENABLE_XPTI_TRACING) target_compile_definitions(${test_dirname} PRIVATE XPTI_ENABLE_INSTRUMENTATION XPTI_STATIC_LIBRARY) @@ -78,16 +102,29 @@ macro(add_sycl_unittest test_dirname link_variant) ) endif() - add_dependencies(check-sycl-unittests check-sycl-${test_dirname}) + add_dependencies(${check_target_dep} check-sycl-${test_dirname}) if(WIN32) # Windows doesn't support LD_LIBRARY_PATH, so instead we copy the mock OpenCL binary next to the test and ensure # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) + + # An error is thrown if both the preview and non-preview version tries to + # copy OpenCL.dll to the test binary directory. Ninja complains that there + # are multiple rules for building the same file (listed in the "BYPRODUCTS" field). + # To fix this error, we use a different "BYPRODUCTS" name for + # preview and non-preview version. We don't use the "BYPRODUCTS" field + # in any following commands, so the name doesn't really matter. + if (${is_preview}) + set(byproducts_suffix "_preview") + else() + set(byproducts_suffix "") + endif() + add_custom_command(TARGET ${test_dirname} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} DEPENDS mockOpenCL - BYPRODUCTS ${mock_ocl} + BYPRODUCTS ${mock_ocl}${byproducts_suffix} COMMAND_EXPAND_LISTS ) endif() @@ -127,4 +164,21 @@ macro(add_sycl_unittest test_dirname link_variant) endif() target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) +endfunction() + +# add_sycl_unittest_preview(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) +# +# Will compile the list of files together and link against the SYCL preview build. +# Produces a binary names `basename(test_dirname)`. +macro(add_sycl_unittest_preview test_dirname link_variant) + add_sycl_unittest_internal(${test_dirname} ${link_variant} TRUE ${ARGN}) +endmacro() + +# add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) +# +# Will compile the list of files together and link against SYCL. +# Produces a binary names `basename(test_dirname)`. +macro(add_sycl_unittest test_dirname link_variant) + add_sycl_unittest_preview(${test_dirname}_preview ${link_variant} ${ARGN}) + add_sycl_unittest_internal(${test_dirname} ${link_variant} FALSE ${ARGN}) endmacro() diff --git a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake b/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake deleted file mode 100644 index 3061dd7eb9141..0000000000000 --- a/sycl/cmake/modules/AddSYCLUnitTestPreview.cmake +++ /dev/null @@ -1,128 +0,0 @@ -# add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) -# -# Will compile the list of files together and link against SYCL. -# Produces a binary names `basename(test_dirname)`. -macro(add_sycl_unittest_preview test_dirname link_variant) - # Enable exception handling for these unit tests - set(LLVM_REQUIRES_EH ON) - set(LLVM_REQUIRES_RTTI ON) - - get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR) - - string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower) - if (MSVC AND build_type_lower MATCHES "debug") - set(sycl_obj_target "sycl-previewd_object") - set(sycl_so_target "sycl-previewd") - else() - set(sycl_obj_target "sycl-preview_object") - set(sycl_so_target "sycl-preview") - endif() - - if ("${link_variant}" MATCHES "SHARED") - set(SYCL_LINK_LIBS ${sycl_so_target}) - add_unittest(SYCLUnitTestsPreview ${test_dirname} ${ARGN}) - else() - add_unittest(SYCLUnitTestsPreview ${test_dirname} - $ ${ARGN}) - target_compile_definitions(${test_dirname} - PRIVATE __SYCL_BUILD_SYCL_DLL) - - get_target_property(SYCL_LINK_LIBS ${sycl_so_target} LINK_LIBRARIES) - endif() - - if (SYCL_ENABLE_COVERAGE) - target_compile_options(${test_dirname} PUBLIC - -fprofile-instr-generate -fcoverage-mapping - ) - target_link_options(${test_dirname} PUBLIC - -fprofile-instr-generate -fcoverage-mapping - ) - endif() - - target_compile_definitions(${test_dirname} - PRIVATE __INTEL_PREVIEW_BREAKING_CHANGES) - - if (SYCL_ENABLE_XPTI_TRACING) - target_compile_definitions(${test_dirname} - PRIVATE XPTI_ENABLE_INSTRUMENTATION XPTI_STATIC_LIBRARY) - endif() - - # check-sycl-unittests was using an old sycl library. So, to get - # around this problem, we add the new sycl library to the PATH and - # LD_LIBRARY_PATH on Windows and Linux respectively. - if (WIN32) - add_custom_target(check-sycl-${test_dirname} - ${CMAKE_COMMAND} -E env - LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw" - SYCL_CONFIG_FILE_NAME=null.cfg - SYCL_DEVICELIB_NO_FALLBACK=1 - SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache" - "PATH=${CMAKE_BINARY_DIR}/bin;$ENV{PATH}" - ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname} - DEPENDS - ${test_dirname} - ) - else() - add_custom_target(check-sycl-${test_dirname} - ${CMAKE_COMMAND} -E env - LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw" - SYCL_CONFIG_FILE_NAME=null.cfg - SYCL_DEVICELIB_NO_FALLBACK=1 - SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache" - "LD_LIBRARY_PATH=${SYCL_BINARY_DIR}/unittests/lib:${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" - ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname} - DEPENDS - ${test_dirname} - ) - endif() - - add_dependencies(check-sycl-unittests-preview check-sycl-${test_dirname}) - - if(WIN32) - # Windows doesn't support LD_LIBRARY_PATH, so instead we copy the mock OpenCL binary next to the test and ensure - # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) - set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) - add_custom_command(TARGET ${test_dirname} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} - DEPENDS mockOpenCL - BYPRODUCTS ${mock_ocl}_preview - COMMAND_EXPAND_LISTS - ) - endif() - - target_link_libraries(${test_dirname} - PRIVATE - mockOpenCL - LLVMTestingSupport - OpenCL-Headers - unified-runtime::mock - ${SYCL_LINK_LIBS} - ) - - add_dependencies(${test_dirname} ur_adapter_mock mockOpenCL) - - if(SYCL_ENABLE_EXTENSION_JIT) - target_link_libraries(${test_dirname} PRIVATE sycl-jit) - endif(SYCL_ENABLE_EXTENSION_JIT) - - if(WIN32) - target_link_libraries(${test_dirname} PRIVATE UnifiedRuntimeLoader ur_win_proxy_loader) - endif() - - target_include_directories(${test_dirname} - PRIVATE SYSTEM - ${sycl_inc_dir} - ${SYCL_SOURCE_DIR}/source/ - ${SYCL_SOURCE_DIR}/unittests/ - ) - if (UNIX) - # These warnings are coming from Google Test code. - target_compile_options(${test_dirname} - PRIVATE - -Wno-unused-parameter - -Wno-inconsistent-missing-override - ) - endif() - - target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) -endmacro() From e3fb020799e99b683365579808f25f23b98b7c87 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 4 Aug 2025 20:26:08 +0200 Subject: [PATCH 06/13] NFC changes, remove incorrect comments, add space at EOF --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 3 --- sycl/unittests/misc/OsUtils.cpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 68593dbbe5d7e..130793439555f 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -1,8 +1,5 @@ # Internal function to create SYCL unit tests with code reuse # add_sycl_unittest_internal(test_dirname SHARED|OBJECT is_preview file1.cpp, file2.cpp ...) -# -# Will compile the list of files together and link against SYCL. -# Produces a binary names `basename(test_dirname)`. function(add_sycl_unittest_internal test_dirname link_variant is_preview) # Enable exception handling for these unit tests set(LLVM_REQUIRES_EH ON) diff --git a/sycl/unittests/misc/OsUtils.cpp b/sycl/unittests/misc/OsUtils.cpp index 265ed167e1df1..3eef558e0963a 100644 --- a/sycl/unittests/misc/OsUtils.cpp +++ b/sycl/unittests/misc/OsUtils.cpp @@ -62,4 +62,4 @@ TEST_F(OsUtilsTest, getCurrentDSODir) { ASSERT_TRUE(isSameDir(DSODir.c_str(), SYCL_LIB_DIR)) << "expected: " << SYCL_LIB_DIR << ", got: " << DSODir; } -#endif \ No newline at end of file +#endif From 8b63e12c24cba631a49e2fcc1c49e89f51b0d76a Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 4 Aug 2025 20:28:08 +0200 Subject: [PATCH 07/13] Don't call unittest preview from non-preview call --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 130793439555f..0bc544e3412a6 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -176,6 +176,5 @@ endmacro() # Will compile the list of files together and link against SYCL. # Produces a binary names `basename(test_dirname)`. macro(add_sycl_unittest test_dirname link_variant) - add_sycl_unittest_preview(${test_dirname}_preview ${link_variant} ${ARGN}) add_sycl_unittest_internal(${test_dirname} ${link_variant} FALSE ${ARGN}) endmacro() From f8b3633e7b43cac77a1ed95be94d2e813fcef66a Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Tue, 5 Aug 2025 01:11:36 +0200 Subject: [PATCH 08/13] Update unittests CMakefile to explicitly specify preview target --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 20 +++++++------------ sycl/unittests/Extensions/CMakeLists.txt | 2 +- .../Extensions/CommandGraph/CMakeLists.txt | 2 +- .../FreeFunctionCommands/CMakeLists.txt | 2 +- .../Extensions/KernelQueries/CMakeLists.txt | 2 +- .../Extensions/NumComputeUnits/CMakeLists.txt | 2 +- .../VirtualFunctions/CMakeLists.txt | 2 +- .../Extensions/VirtualMemory/CMakeLists.txt | 2 +- .../OneAPIDeviceSelector/CMakeLists.txt | 2 +- sycl/unittests/SYCL2020/CMakeLists.txt | 2 +- sycl/unittests/accessor/CMakeLists.txt | 2 +- sycl/unittests/allowlist/CMakeLists.txt | 2 +- sycl/unittests/assert/CMakeLists.txt | 3 +-- sycl/unittests/buffer/CMakeLists.txt | 2 +- .../buffer/l0_specific/CMakeLists.txt | 2 +- sycl/unittests/builtins/CMakeLists.txt | 2 +- sycl/unittests/compression/CMakeLists.txt | 3 ++- sycl/unittests/config/CMakeLists.txt | 2 +- sycl/unittests/context_device/CMakeLists.txt | 2 +- sycl/unittests/event/CMakeLists.txt | 2 +- sycl/unittests/handler/CMakeLists.txt | 2 +- .../kernel-and-program/CMakeLists.txt | 3 ++- sycl/unittests/misc/CMakeLists.txt | 2 +- sycl/unittests/misc/LinkGraph/CMakeLists.txt | 2 +- sycl/unittests/pipes/CMakeLists.txt | 4 +++- sycl/unittests/program_manager/CMakeLists.txt | 2 +- .../DynamicLinking/CMakeLists.txt | 2 +- .../program_manager/arg_mask/CMakeLists.txt | 2 +- sycl/unittests/queue/CMakeLists.txt | 2 +- sycl/unittests/reduction/CMakeLists.txt | 2 +- sycl/unittests/sampler/CMakeLists.txt | 2 +- sycl/unittests/scheduler/CMakeLists.txt | 2 +- sycl/unittests/stream/CMakeLists.txt | 2 +- sycl/unittests/thread_safety/CMakeLists.txt | 2 +- sycl/unittests/ur/CMakeLists.txt | 4 +++- sycl/unittests/xpti_trace/CMakeLists.txt | 4 ++-- 36 files changed, 49 insertions(+), 50 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 0bc544e3412a6..14da47fc48edc 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -163,18 +163,12 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) endfunction() -# add_sycl_unittest_preview(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) +# add_sycl_unittest_both(test_name test_preview_name SHARED|OBJECT file1.cpp, file2.cpp ...) # -# Will compile the list of files together and link against the SYCL preview build. -# Produces a binary names `basename(test_dirname)`. -macro(add_sycl_unittest_preview test_dirname link_variant) - add_sycl_unittest_internal(${test_dirname} ${link_variant} TRUE ${ARGN}) -endmacro() - -# add_sycl_unittest(test_dirname SHARED|OBJECT file1.cpp, file2.cpp ...) -# -# Will compile the list of files together and link against SYCL. -# Produces a binary names `basename(test_dirname)`. -macro(add_sycl_unittest test_dirname link_variant) - add_sycl_unittest_internal(${test_dirname} ${link_variant} FALSE ${ARGN}) +# Will compile the list of files together to create two builds, with and without +# the SYCL preview features enabled. +# Produces two binaries, named `basename(test_name)` and `basename(test_preview_name)` +macro(add_sycl_unittest_both test_name test_preview_name link_variant) + add_sycl_unittest_internal(${test_name} ${link_variant} FALSE ${ARGN}) + add_sycl_unittest_internal(${test_preview_name} ${link_variant} TRUE ${ARGN}) endmacro() diff --git a/sycl/unittests/Extensions/CMakeLists.txt b/sycl/unittests/Extensions/CMakeLists.txt index b82c9f798a94c..b266a7e9349a4 100644 --- a/sycl/unittests/Extensions/CMakeLists.txt +++ b/sycl/unittests/Extensions/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(ExtensionsTests OBJECT +add_sycl_unittest_both(ExtensionsTests ExtensionsTestsPreview OBJECT CurrentDevice.cpp DefaultContext.cpp FPGADeviceSelectors.cpp diff --git a/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt b/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt index 928d67eb56112..e5fe6419d5399 100644 --- a/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt +++ b/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(CommandGraphExtensionTests OBJECT +add_sycl_unittest_both(CommandGraphExtensionTests CommandGraphExtensionTestsPreview OBJECT Barrier.cpp CommandGraph.cpp CommonReferenceSemantics.cpp diff --git a/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt b/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt index 69867a0a82aa5..e9b270f2af066 100644 --- a/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt +++ b/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(FreeFunctionCommandsTests OBJECT +add_sycl_unittest_both(FreeFunctionCommandsTests FreeFunctionCommandsTestsPreview OBJECT Barrier.cpp FreeFunctionCommandsEvents.cpp ) diff --git a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt index 0b82e66e73f7c..1299a13f5c6c9 100644 --- a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt +++ b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(KernelQueriesTests OBJECT +add_sycl_unittest_both(KernelQueriesTests KernelQueriesTestsPreview OBJECT SpillMemorySize.cpp ) diff --git a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt index fe60339444d19..763d246ecc5ae 100644 --- a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt +++ b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(NumComputeUnitsTests OBJECT +add_sycl_unittest_both(NumComputeUnitsTests NumComputeUnitsTestsPreview OBJECT ReturnedQueryValue.cpp ) diff --git a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt index 73e5d09995f9f..96bcd5057e32f 100644 --- a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(VirtualFunctionExtensionTests OBJECT +add_sycl_unittest_both(VirtualFunctionExtensionTests VirtualFunctionExtensionTestsPreview OBJECT RuntimeLinking.cpp ) diff --git a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt index 7362ed448d775..f8475dba24717 100644 --- a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(VirtualMemoryExtensionTests OBJECT +add_sycl_unittest_both(VirtualMemoryExtensionTests VirtualMemoryExtensionTestsPreview OBJECT Exceptions.cpp ) diff --git a/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt b/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt index 32e20acc8529c..c178a333c0d1b 100644 --- a/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt +++ b/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(OneAPIDeviceSelectorTests OBJECT +add_sycl_unittest_both(OneAPIDeviceSelectorTests OneAPIDeviceSelectorTestsPreview OBJECT Tests.cpp ) diff --git a/sycl/unittests/SYCL2020/CMakeLists.txt b/sycl/unittests/SYCL2020/CMakeLists.txt index 7a53001025735..8d11cf0b81d41 100644 --- a/sycl/unittests/SYCL2020/CMakeLists.txt +++ b/sycl/unittests/SYCL2020/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(SYCL2020Tests OBJECT +add_sycl_unittest_both(SYCL2020Tests SYCL2020TestsPreview OBJECT GetNativeOpenCL.cpp SpecializationConstant.cpp KernelBundle.cpp diff --git a/sycl/unittests/accessor/CMakeLists.txt b/sycl/unittests/accessor/CMakeLists.txt index 312716877a429..9187d3962ec80 100644 --- a/sycl/unittests/accessor/CMakeLists.txt +++ b/sycl/unittests/accessor/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(AccessorTests OBJECT +add_sycl_unittest_both(AccessorTests AccessorTestsPreview OBJECT AccessorHostTask.cpp AccessorImplicitConversion.cpp AccessorIterator.cpp diff --git a/sycl/unittests/allowlist/CMakeLists.txt b/sycl/unittests/allowlist/CMakeLists.txt index e03fac9af99d1..054771bb68521 100644 --- a/sycl/unittests/allowlist/CMakeLists.txt +++ b/sycl/unittests/allowlist/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(AllowListTests OBJECT +add_sycl_unittest_both(AllowListTests AllowListTestsPreview OBJECT ParseAllowList.cpp DeviceIsAllowed.cpp ) diff --git a/sycl/unittests/assert/CMakeLists.txt b/sycl/unittests/assert/CMakeLists.txt index 9e114f36441f4..262759cc2e14f 100644 --- a/sycl/unittests/assert/CMakeLists.txt +++ b/sycl/unittests/assert/CMakeLists.txt @@ -1,5 +1,4 @@ -add_sycl_unittest(AssertTests OBJECT +add_sycl_unittest_both(AssertTests AssertTestsPreview OBJECT assert.cpp support_native.cpp ) - diff --git a/sycl/unittests/buffer/CMakeLists.txt b/sycl/unittests/buffer/CMakeLists.txt index 744ad2ef12ad6..6ba02bdbcf1b1 100644 --- a/sycl/unittests/buffer/CMakeLists.txt +++ b/sycl/unittests/buffer/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(BufferTests OBJECT +add_sycl_unittest_both(BufferTests BufferTestsPreview OBJECT PARTIAL_SOURCES_INTENDED BufferLocation.cpp Image.cpp diff --git a/sycl/unittests/buffer/l0_specific/CMakeLists.txt b/sycl/unittests/buffer/l0_specific/CMakeLists.txt index da1e818fae192..ca5f7ae997ed9 100644 --- a/sycl/unittests/buffer/l0_specific/CMakeLists.txt +++ b/sycl/unittests/buffer/l0_specific/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(BufferTestsL0Specific OBJECT +add_sycl_unittest_both(BufferTestsL0Specific BufferTestsL0SpecificPreview OBJECT BufferReleaseL0.cpp ) diff --git a/sycl/unittests/builtins/CMakeLists.txt b/sycl/unittests/builtins/CMakeLists.txt index 0f79b7c062bbe..3d70c4b18adb7 100644 --- a/sycl/unittests/builtins/CMakeLists.txt +++ b/sycl/unittests/builtins/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(BuiltinsTests OBJECT +add_sycl_unittest_both(BuiltinsTests BuiltinsTestsPreview OBJECT Builtins.cpp ) diff --git a/sycl/unittests/compression/CMakeLists.txt b/sycl/unittests/compression/CMakeLists.txt index 4c27c6cf56823..462e3c8ca0319 100644 --- a/sycl/unittests/compression/CMakeLists.txt +++ b/sycl/unittests/compression/CMakeLists.txt @@ -1,4 +1,5 @@ -add_sycl_unittest(CompressionTests OBJECT +add_sycl_unittest_both(CompressionTests CompressionTestsPreview OBJECT CompressionTests.cpp ) target_compile_definitions(CompressionTests PRIVATE SYCL_RT_ZSTD_AVAILABLE) +target_compile_definitions(CompressionTestsPreview PRIVATE SYCL_RT_ZSTD_AVAILABLE) diff --git a/sycl/unittests/config/CMakeLists.txt b/sycl/unittests/config/CMakeLists.txt index b32b0d0a8d713..907145e5a49c6 100644 --- a/sycl/unittests/config/CMakeLists.txt +++ b/sycl/unittests/config/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(ConfigTests OBJECT +add_sycl_unittest_both(ConfigTests ConfigTestsPreview OBJECT ConfigTests.cpp PreferredWGSizeConfigTests.cpp ) diff --git a/sycl/unittests/context_device/CMakeLists.txt b/sycl/unittests/context_device/CMakeLists.txt index ff435ec68a8d7..67ffe9e1006a5 100644 --- a/sycl/unittests/context_device/CMakeLists.txt +++ b/sycl/unittests/context_device/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(ContextDeviceTests OBJECT +add_sycl_unittest_both(ContextDeviceTests ContextDeviceTestsPreview OBJECT Context.cpp DeviceRefCounter.cpp HasExtensionWordBoundary.cpp diff --git a/sycl/unittests/event/CMakeLists.txt b/sycl/unittests/event/CMakeLists.txt index aac9c68eb4e51..3dadab8793d02 100644 --- a/sycl/unittests/event/CMakeLists.txt +++ b/sycl/unittests/event/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(EventTests OBJECT +add_sycl_unittest_both(EventTests EventTestsPreview OBJECT EventDestruction.cpp ) \ No newline at end of file diff --git a/sycl/unittests/handler/CMakeLists.txt b/sycl/unittests/handler/CMakeLists.txt index eb7fc559ab73c..3944d3d8784d4 100644 --- a/sycl/unittests/handler/CMakeLists.txt +++ b/sycl/unittests/handler/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(HandlerTests OBJECT +add_sycl_unittest_both(HandlerTests HandlerTestsPreview OBJECT SetArgForLocalAccessor.cpp require.cpp ) diff --git a/sycl/unittests/kernel-and-program/CMakeLists.txt b/sycl/unittests/kernel-and-program/CMakeLists.txt index 0d06d2fc29aa0..a08f283666277 100644 --- a/sycl/unittests/kernel-and-program/CMakeLists.txt +++ b/sycl/unittests/kernel-and-program/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(KernelAndProgramTests OBJECT +add_sycl_unittest_both(KernelAndProgramTests KernelAndProgramTestsPreview OBJECT Cache.cpp MultipleDevsCache.cpp KernelRelease.cpp @@ -10,3 +10,4 @@ add_sycl_unittest(KernelAndProgramTests OBJECT InMemCacheEviction.cpp ) target_compile_definitions(KernelAndProgramTests PRIVATE -D__SYCL_INTERNAL_API) +target_compile_definitions(KernelAndProgramTestsPreview PRIVATE -D__SYCL_INTERNAL_API) diff --git a/sycl/unittests/misc/CMakeLists.txt b/sycl/unittests/misc/CMakeLists.txt index 4cccdd87bbc95..7076c5255fc88 100644 --- a/sycl/unittests/misc/CMakeLists.txt +++ b/sycl/unittests/misc/CMakeLists.txt @@ -2,7 +2,7 @@ set(sycl_lib_dir $) add_definitions(-DSYCL_LIB_DIR="${sycl_lib_dir}") # https://github.com/intel/llvm/issues/19626 if(NOT LLVM_LIBCXX_USED) -add_sycl_unittest(MiscTests SHARED +add_sycl_unittest_both(MiscTests MiscTestsPreview SHARED CircularBuffer.cpp OsUtils.cpp PropertyUtils.cpp diff --git a/sycl/unittests/misc/LinkGraph/CMakeLists.txt b/sycl/unittests/misc/LinkGraph/CMakeLists.txt index cbb0e09724f6d..4574707ed8925 100644 --- a/sycl/unittests/misc/LinkGraph/CMakeLists.txt +++ b/sycl/unittests/misc/LinkGraph/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(LinkGraphTests SHARED +add_sycl_unittest_both(LinkGraphTests LinkGraphTestsPreview SHARED LinkGraphConstruction.cpp LinkGraphPoisoning.cpp LinkGraphUnify.cpp diff --git a/sycl/unittests/pipes/CMakeLists.txt b/sycl/unittests/pipes/CMakeLists.txt index 58069920f5cb4..a6f532658dddc 100644 --- a/sycl/unittests/pipes/CMakeLists.txt +++ b/sycl/unittests/pipes/CMakeLists.txt @@ -1,8 +1,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(PipeTests OBJECT +add_sycl_unittest_both(PipeTests PipeTestsPreview OBJECT host_pipe_registration.cpp ) add_dependencies(PipeTests sycl) target_include_directories(PipeTests PRIVATE SYSTEM ${sycl_inc_dir}) +add_dependencies(PipeTestsPreview sycl) +target_include_directories(PipeTestsPreview PRIVATE SYSTEM ${sycl_inc_dir}) diff --git a/sycl/unittests/program_manager/CMakeLists.txt b/sycl/unittests/program_manager/CMakeLists.txt index 95d132c5d42bc..3db721b924e0e 100644 --- a/sycl/unittests/program_manager/CMakeLists.txt +++ b/sycl/unittests/program_manager/CMakeLists.txt @@ -2,7 +2,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # https://github.com/intel/llvm/issues/19597 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest(ProgramManagerTests OBJECT +add_sycl_unittest_both(ProgramManagerTests ProgramManagerTestsPreview OBJECT CompileTarget.cpp BuildLog.cpp itt_annotations.cpp diff --git a/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt b/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt index d57334faf6dd5..aae552840fadd 100644 --- a/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt +++ b/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt @@ -2,7 +2,7 @@ # TODO this can be merged back into program manager tests once __sycl_unregister_lib is implemented. # https://github.com/intel/llvm/issues/19597 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest(DynamicLinkingTests OBJECT +add_sycl_unittest_both(DynamicLinkingTests DynamicLinkingTestsPreview OBJECT DynamicLinking.cpp ) endif() diff --git a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt index 57cb4aa6a618b..354c52579ca5f 100644 --- a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt +++ b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt @@ -1,5 +1,5 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(ProgramManagerArgMaskTests OBJECT +add_sycl_unittest_both(ProgramManagerArgMaskTests ProgramManagerArgMaskTestsPreview OBJECT EliminatedArgMask.cpp ) diff --git a/sycl/unittests/queue/CMakeLists.txt b/sycl/unittests/queue/CMakeLists.txt index 1045a1865cb29..0b3e4d42984af 100644 --- a/sycl/unittests/queue/CMakeLists.txt +++ b/sycl/unittests/queue/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(QueueTests OBJECT +add_sycl_unittest_both(QueueTests QueueTestsPreview OBJECT DeviceCheck.cpp Hash.cpp USM.cpp diff --git a/sycl/unittests/reduction/CMakeLists.txt b/sycl/unittests/reduction/CMakeLists.txt index 47d16980ceb66..3f704f0d170b3 100644 --- a/sycl/unittests/reduction/CMakeLists.txt +++ b/sycl/unittests/reduction/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(ReductionTests OBJECT +add_sycl_unittest_both(ReductionTests ReductionTestsPreview OBJECT Properties.cpp ) diff --git a/sycl/unittests/sampler/CMakeLists.txt b/sycl/unittests/sampler/CMakeLists.txt index f26b608afa5e4..c4917a817c3f8 100644 --- a/sycl/unittests/sampler/CMakeLists.txt +++ b/sycl/unittests/sampler/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(SamplerTests OBJECT +add_sycl_unittest_both(SamplerTests SamplerTestsPreview OBJECT Properties.cpp ) diff --git a/sycl/unittests/scheduler/CMakeLists.txt b/sycl/unittests/scheduler/CMakeLists.txt index afc0e185eb7c0..6e60c71932758 100644 --- a/sycl/unittests/scheduler/CMakeLists.txt +++ b/sycl/unittests/scheduler/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest(SchedulerTests OBJECT +add_sycl_unittest_both(SchedulerTests SchedulerTestsPreview OBJECT BlockedCommands.cpp Commands.cpp FailedCommands.cpp diff --git a/sycl/unittests/stream/CMakeLists.txt b/sycl/unittests/stream/CMakeLists.txt index ae8a544262c87..0fbfbade33f94 100644 --- a/sycl/unittests/stream/CMakeLists.txt +++ b/sycl/unittests/stream/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest(StreamTests OBJECT +add_sycl_unittest_both(StreamTests StreamTestsPreview OBJECT stream.cpp ) diff --git a/sycl/unittests/thread_safety/CMakeLists.txt b/sycl/unittests/thread_safety/CMakeLists.txt index 1a69d249f1246..2d3908dd22f01 100644 --- a/sycl/unittests/thread_safety/CMakeLists.txt +++ b/sycl/unittests/thread_safety/CMakeLists.txt @@ -1,6 +1,6 @@ # https://github.com/intel/llvm/issues/19591 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest(ThreadSafetyTests OBJECT +add_sycl_unittest_both(ThreadSafetyTests ThreadSafetyTestsPreview OBJECT HostAccessorDeadLock.cpp InteropKernelEnqueue.cpp ) diff --git a/sycl/unittests/ur/CMakeLists.txt b/sycl/unittests/ur/CMakeLists.txt index ce8e0e207c716..1fdcb2bd02308 100644 --- a/sycl/unittests/ur/CMakeLists.txt +++ b/sycl/unittests/ur/CMakeLists.txt @@ -1,8 +1,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(UrTests OBJECT +add_sycl_unittest_both(UrTests UrTestsPreview OBJECT UrUtility.cpp ) add_dependencies(UrTests sycl) target_include_directories(UrTests PRIVATE SYSTEM ${sycl_inc_dir}) +add_dependencies(UrTestsPreview sycl) +target_include_directories(UrTestsPreview PRIVATE SYSTEM ${sycl_inc_dir}) diff --git a/sycl/unittests/xpti_trace/CMakeLists.txt b/sycl/unittests/xpti_trace/CMakeLists.txt index 09ba586e3df28..b7186c27a5d63 100644 --- a/sycl/unittests/xpti_trace/CMakeLists.txt +++ b/sycl/unittests/xpti_trace/CMakeLists.txt @@ -1,10 +1,10 @@ add_subdirectory(xptitest_subscriber) add_definitions(-DXPTI_ENABLE_INSTRUMENTATION) -add_sycl_unittest(XptiTraceTests OBJECT +add_sycl_unittest_both(XptiTraceTests XptiTraceTestsPreview OBJECT QueueApiFailures.cpp NodeCreation.cpp QueueIDCheck.cpp ) target_link_libraries(XptiTraceTests PRIVATE xpti xptitest_subscriber) -target_link_libraries(XptiTraceTests_preview PRIVATE xpti xptitest_subscriber) +target_link_libraries(XptiTraceTestsPreview PRIVATE xpti xptitest_subscriber) From 880dfc506fd2320498fe0b94590b38a1dc6e9ab2 Mon Sep 17 00:00:00 2001 From: Udit Kumar Agarwal Date: Mon, 4 Aug 2025 16:29:12 -0700 Subject: [PATCH 09/13] NFC changes Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 2 +- sycl/unittests/event/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 14da47fc48edc..5f5b4b5b2fa52 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -106,7 +106,7 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) - # An error is thrown if both the preview and non-preview version tries to + # An error is thrown if both the preview and non-preview versions try to # copy OpenCL.dll to the test binary directory. Ninja complains that there # are multiple rules for building the same file (listed in the "BYPRODUCTS" field). # To fix this error, we use a different "BYPRODUCTS" name for diff --git a/sycl/unittests/event/CMakeLists.txt b/sycl/unittests/event/CMakeLists.txt index 3dadab8793d02..a809f7c3f6232 100644 --- a/sycl/unittests/event/CMakeLists.txt +++ b/sycl/unittests/event/CMakeLists.txt @@ -1,3 +1,3 @@ add_sycl_unittest_both(EventTests EventTestsPreview OBJECT EventDestruction.cpp -) \ No newline at end of file +) From 22d66d0a7353b46abf9c4b0626be5bc29f41c435 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 6 Aug 2025 16:51:36 +0200 Subject: [PATCH 10/13] Make check-sycl-unittests check both prevew and non-preview versions --- .github/workflows/sycl-linux-build.yml | 6 ---- .github/workflows/sycl-windows-build.yml | 4 --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 38 +++++++++--------------- sycl/unittests/CMakeLists.txt | 1 - 4 files changed, 14 insertions(+), 35 deletions(-) diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index 361d86e8bf65a..6f8e2a21c9636 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -245,12 +245,6 @@ jobs: # TODO consider moving this to Dockerfile. export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH cmake --build $GITHUB_WORKSPACE/build --target check-sycl-unittests - - name: check-sycl-unittests-preview - if: always() && !cancelled() && contains(inputs.changes, 'sycl') - run: | - # TODO consider moving this to Dockerfile. - export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH - cmake --build $GITHUB_WORKSPACE/build --target check-sycl-unittests-preview - name: check-llvm-spirv if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv') run: | diff --git a/.github/workflows/sycl-windows-build.yml b/.github/workflows/sycl-windows-build.yml index f1e6af3fd9b86..12679a6c7812f 100644 --- a/.github/workflows/sycl-windows-build.yml +++ b/.github/workflows/sycl-windows-build.yml @@ -177,10 +177,6 @@ jobs: if: always() && !cancelled() && contains(inputs.changes, 'sycl') run: | cmake --build build --target check-sycl-unittests - - name: check-sycl-unittests-preview - if: always() && !cancelled() && contains(inputs.changes, 'sycl') - run: | - cmake --build build --target check-sycl-unittests-preview - name: check-llvm-spirv if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv') run: | diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 5f5b4b5b2fa52..76ecba4852023 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -29,20 +29,19 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) endif() endif() - # Set unittest_target based on whether this is a preview build + # This is done to ensure that preview tests are kept in a seperate + # directory, so that they do not interfere with the non-preview tests. + # Chaning CMAKE_CURRENT_BINARY_DIR should not affect this variable in its + # parent scope. if (${is_preview}) - set(unittest_target "SYCLUnitTestsPreview") - set(check_target_dep "check-sycl-unittests-preview") - else() - set(unittest_target "SYCLUnitTests") - set(check_target_dep "check-sycl-unittests") + set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/Preview") endif() if ("${link_variant}" MATCHES "SHARED") set(SYCL_LINK_LIBS ${sycl_so_target}) - add_unittest(${unittest_target} ${test_dirname} ${ARGN}) + add_unittest(SYCLUnitTests ${test_dirname} ${ARGN}) else() - add_unittest(${unittest_target} ${test_dirname} + add_unittest(SYCLUnitTests ${test_dirname} $ ${ARGN}) target_compile_definitions(${test_dirname} PRIVATE __SYCL_BUILD_SYCL_DLL) @@ -63,6 +62,7 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) if (${is_preview}) target_compile_definitions(${test_dirname} PRIVATE __INTEL_PREVIEW_BREAKING_CHANGES) + set(sycl_cache_suffix "_preview") endif() if (SYCL_ENABLE_XPTI_TRACING) @@ -79,9 +79,10 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw" SYCL_CONFIG_FILE_NAME=null.cfg SYCL_DEVICELIB_NO_FALLBACK=1 - SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache" + SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache${sycl_cache_suffix}" "PATH=${CMAKE_BINARY_DIR}/bin;$ENV{PATH}" ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${test_dirname} ) @@ -91,37 +92,26 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw" SYCL_CONFIG_FILE_NAME=null.cfg SYCL_DEVICELIB_NO_FALLBACK=1 - SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache" + SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache${sycl_cache_suffix}" "LD_LIBRARY_PATH=${SYCL_BINARY_DIR}/unittests/lib:${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${test_dirname} ) endif() - add_dependencies(${check_target_dep} check-sycl-${test_dirname}) + add_dependencies(check-sycl-unittests check-sycl-${test_dirname}) if(WIN32) # Windows doesn't support LD_LIBRARY_PATH, so instead we copy the mock OpenCL binary next to the test and ensure # that the test itself links to OpenCL (rather than through ur_adapter_opencl.dll) set(mock_ocl ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.dll) - # An error is thrown if both the preview and non-preview versions try to - # copy OpenCL.dll to the test binary directory. Ninja complains that there - # are multiple rules for building the same file (listed in the "BYPRODUCTS" field). - # To fix this error, we use a different "BYPRODUCTS" name for - # preview and non-preview version. We don't use the "BYPRODUCTS" field - # in any following commands, so the name doesn't really matter. - if (${is_preview}) - set(byproducts_suffix "_preview") - else() - set(byproducts_suffix "") - endif() - add_custom_command(TARGET ${test_dirname} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${mock_ocl} DEPENDS mockOpenCL - BYPRODUCTS ${mock_ocl}${byproducts_suffix} + BYPRODUCTS ${mock_ocl} COMMAND_EXPAND_LISTS ) endif() diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 1f4bb4a8fea13..34420c2ec8c1e 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -30,7 +30,6 @@ include(AddSYCLUnitTest) add_subdirectory(mock_opencl) add_custom_target(check-sycl-unittests) -add_custom_target(check-sycl-unittests-preview) add_subdirectory(ur) add_subdirectory(allowlist) From f6b8ff00bf590df518e5323313a1c56b5b5bfa72 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 6 Aug 2025 18:47:56 +0200 Subject: [PATCH 11/13] Implicitly create two targets, with and without preview --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 10 +++++----- sycl/unittests/CMakeLists.txt | 3 --- sycl/unittests/Extensions/CMakeLists.txt | 2 +- sycl/unittests/Extensions/CommandGraph/CMakeLists.txt | 2 +- .../Extensions/FreeFunctionCommands/CMakeLists.txt | 2 +- sycl/unittests/Extensions/KernelQueries/CMakeLists.txt | 2 +- .../Extensions/NumComputeUnits/CMakeLists.txt | 3 +-- .../Extensions/VirtualFunctions/CMakeLists.txt | 3 +-- sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt | 3 +-- sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt | 2 +- sycl/unittests/SYCL2020/CMakeLists.txt | 3 +-- sycl/unittests/accessor/CMakeLists.txt | 2 +- sycl/unittests/allowlist/CMakeLists.txt | 2 +- sycl/unittests/assert/CMakeLists.txt | 2 +- sycl/unittests/buffer/CMakeLists.txt | 2 +- sycl/unittests/buffer/l0_specific/CMakeLists.txt | 2 +- sycl/unittests/builtins/CMakeLists.txt | 2 +- sycl/unittests/compression/CMakeLists.txt | 6 +++--- sycl/unittests/config/CMakeLists.txt | 2 +- sycl/unittests/context_device/CMakeLists.txt | 2 +- sycl/unittests/event/CMakeLists.txt | 2 +- sycl/unittests/handler/CMakeLists.txt | 2 +- sycl/unittests/kernel-and-program/CMakeLists.txt | 6 +++--- sycl/unittests/misc/CMakeLists.txt | 2 +- sycl/unittests/misc/LinkGraph/CMakeLists.txt | 2 +- sycl/unittests/pipes/CMakeLists.txt | 10 +++++----- sycl/unittests/program_manager/CMakeLists.txt | 2 +- .../program_manager/DynamicLinking/CMakeLists.txt | 2 +- sycl/unittests/program_manager/arg_mask/CMakeLists.txt | 3 +-- sycl/unittests/queue/CMakeLists.txt | 2 +- sycl/unittests/reduction/CMakeLists.txt | 2 +- sycl/unittests/sampler/CMakeLists.txt | 2 +- sycl/unittests/scheduler/CMakeLists.txt | 2 +- sycl/unittests/stream/CMakeLists.txt | 2 +- sycl/unittests/thread_safety/CMakeLists.txt | 2 +- sycl/unittests/ur/CMakeLists.txt | 10 +++++----- sycl/unittests/xpti_trace/CMakeLists.txt | 6 +++--- 37 files changed, 54 insertions(+), 62 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 76ecba4852023..e7058aabcabc0 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -153,12 +153,12 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) endfunction() -# add_sycl_unittest_both(test_name test_preview_name SHARED|OBJECT file1.cpp, file2.cpp ...) +# add_sycl_unittests(test_name_prefix SHARED|OBJECT file1.cpp, file2.cpp ...) # # Will compile the list of files together to create two builds, with and without # the SYCL preview features enabled. -# Produces two binaries, named `basename(test_name)` and `basename(test_preview_name)` -macro(add_sycl_unittest_both test_name test_preview_name link_variant) - add_sycl_unittest_internal(${test_name} ${link_variant} FALSE ${ARGN}) - add_sycl_unittest_internal(${test_preview_name} ${link_variant} TRUE ${ARGN}) +# Produces two binaries, named `basename(test_name_prefix_non_preview)` and `basename(test_name_prefix_preview)` +macro(add_sycl_unittests test_name_prefix link_variant) + add_sycl_unittest_internal(${test_name_prefix}_non_preview ${link_variant} FALSE ${ARGN}) + add_sycl_unittest_internal(${test_name_prefix}_preview ${link_variant} TRUE ${ARGN}) endmacro() diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 34420c2ec8c1e..62af3d0074cac 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -1,9 +1,6 @@ add_custom_target(SYCLUnitTests) set_target_properties(SYCLUnitTests PROPERTIES FOLDER "SYCL tests") -add_custom_target(SYCLUnitTestsPreview) -set_target_properties(SYCLUnitTestsPreview PROPERTIES FOLDER "SYCL tests") - foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) diff --git a/sycl/unittests/Extensions/CMakeLists.txt b/sycl/unittests/Extensions/CMakeLists.txt index b266a7e9349a4..2067fca80aaf1 100644 --- a/sycl/unittests/Extensions/CMakeLists.txt +++ b/sycl/unittests/Extensions/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(ExtensionsTests ExtensionsTestsPreview OBJECT +add_sycl_unittests(ExtensionsTests OBJECT CurrentDevice.cpp DefaultContext.cpp FPGADeviceSelectors.cpp diff --git a/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt b/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt index e5fe6419d5399..1fab427fa56aa 100644 --- a/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt +++ b/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(CommandGraphExtensionTests CommandGraphExtensionTestsPreview OBJECT +add_sycl_unittests(CommandGraphExtensionTests OBJECT Barrier.cpp CommandGraph.cpp CommonReferenceSemantics.cpp diff --git a/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt b/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt index e9b270f2af066..b08a2d3433925 100644 --- a/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt +++ b/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(FreeFunctionCommandsTests FreeFunctionCommandsTestsPreview OBJECT +add_sycl_unittests(FreeFunctionCommandsTests OBJECT Barrier.cpp FreeFunctionCommandsEvents.cpp ) diff --git a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt index 1299a13f5c6c9..4859010ff572a 100644 --- a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt +++ b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(KernelQueriesTests KernelQueriesTestsPreview OBJECT +add_sycl_unittests(KernelQueriesTests OBJECT SpillMemorySize.cpp ) diff --git a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt index 763d246ecc5ae..2f0639a013ac2 100644 --- a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt +++ b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt @@ -1,4 +1,3 @@ -add_sycl_unittest_both(NumComputeUnitsTests NumComputeUnitsTestsPreview OBJECT +add_sycl_unittests(NumComputeUnitsTests OBJECT ReturnedQueryValue.cpp ) - diff --git a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt index 96bcd5057e32f..9810921a67f35 100644 --- a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt @@ -1,4 +1,3 @@ -add_sycl_unittest_both(VirtualFunctionExtensionTests VirtualFunctionExtensionTestsPreview OBJECT +add_sycl_unittests(VirtualFunctionExtensionTests OBJECT RuntimeLinking.cpp ) - diff --git a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt index f8475dba24717..ade9fee6600fe 100644 --- a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt @@ -1,4 +1,3 @@ -add_sycl_unittest_both(VirtualMemoryExtensionTests VirtualMemoryExtensionTestsPreview OBJECT +add_sycl_unittests(VirtualMemoryExtensionTests OBJECT Exceptions.cpp ) - diff --git a/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt b/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt index c178a333c0d1b..5fc89e2cf11f4 100644 --- a/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt +++ b/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(OneAPIDeviceSelectorTests OneAPIDeviceSelectorTestsPreview OBJECT +add_sycl_unittests(OneAPIDeviceSelectorTests OBJECT Tests.cpp ) diff --git a/sycl/unittests/SYCL2020/CMakeLists.txt b/sycl/unittests/SYCL2020/CMakeLists.txt index 8d11cf0b81d41..e18bdb2dce3fe 100644 --- a/sycl/unittests/SYCL2020/CMakeLists.txt +++ b/sycl/unittests/SYCL2020/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(SYCL2020Tests SYCL2020TestsPreview OBJECT +add_sycl_unittests(SYCL2020Tests OBJECT GetNativeOpenCL.cpp SpecializationConstant.cpp KernelBundle.cpp @@ -14,4 +14,3 @@ add_sycl_unittest_both(SYCL2020Tests SYCL2020TestsPreview OBJECT AtomicMemoryScopeCapabilities.cpp AtomicFenceCapabilities.cpp ) - diff --git a/sycl/unittests/accessor/CMakeLists.txt b/sycl/unittests/accessor/CMakeLists.txt index 9187d3962ec80..5d8a8c4980c70 100644 --- a/sycl/unittests/accessor/CMakeLists.txt +++ b/sycl/unittests/accessor/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(AccessorTests AccessorTestsPreview OBJECT +add_sycl_unittests(AccessorTests OBJECT AccessorHostTask.cpp AccessorImplicitConversion.cpp AccessorIterator.cpp diff --git a/sycl/unittests/allowlist/CMakeLists.txt b/sycl/unittests/allowlist/CMakeLists.txt index 054771bb68521..794d7ea1a0e3f 100644 --- a/sycl/unittests/allowlist/CMakeLists.txt +++ b/sycl/unittests/allowlist/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(AllowListTests AllowListTestsPreview OBJECT +add_sycl_unittests(AllowListTests OBJECT ParseAllowList.cpp DeviceIsAllowed.cpp ) diff --git a/sycl/unittests/assert/CMakeLists.txt b/sycl/unittests/assert/CMakeLists.txt index 262759cc2e14f..1d16e16c003e1 100644 --- a/sycl/unittests/assert/CMakeLists.txt +++ b/sycl/unittests/assert/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(AssertTests AssertTestsPreview OBJECT +add_sycl_unittests(AssertTests OBJECT assert.cpp support_native.cpp ) diff --git a/sycl/unittests/buffer/CMakeLists.txt b/sycl/unittests/buffer/CMakeLists.txt index 6ba02bdbcf1b1..bc0326bae6121 100644 --- a/sycl/unittests/buffer/CMakeLists.txt +++ b/sycl/unittests/buffer/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(BufferTests BufferTestsPreview OBJECT +add_sycl_unittests(BufferTests OBJECT PARTIAL_SOURCES_INTENDED BufferLocation.cpp Image.cpp diff --git a/sycl/unittests/buffer/l0_specific/CMakeLists.txt b/sycl/unittests/buffer/l0_specific/CMakeLists.txt index ca5f7ae997ed9..625e4ed87ea49 100644 --- a/sycl/unittests/buffer/l0_specific/CMakeLists.txt +++ b/sycl/unittests/buffer/l0_specific/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(BufferTestsL0Specific BufferTestsL0SpecificPreview OBJECT +add_sycl_unittests(BufferTestsL0Specific OBJECT BufferReleaseL0.cpp ) diff --git a/sycl/unittests/builtins/CMakeLists.txt b/sycl/unittests/builtins/CMakeLists.txt index 3d70c4b18adb7..53462593352b4 100644 --- a/sycl/unittests/builtins/CMakeLists.txt +++ b/sycl/unittests/builtins/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(BuiltinsTests BuiltinsTestsPreview OBJECT +add_sycl_unittests(BuiltinsTests OBJECT Builtins.cpp ) diff --git a/sycl/unittests/compression/CMakeLists.txt b/sycl/unittests/compression/CMakeLists.txt index 462e3c8ca0319..5e876cc3bf5a6 100644 --- a/sycl/unittests/compression/CMakeLists.txt +++ b/sycl/unittests/compression/CMakeLists.txt @@ -1,5 +1,5 @@ -add_sycl_unittest_both(CompressionTests CompressionTestsPreview OBJECT +add_sycl_unittests(CompressionTests OBJECT CompressionTests.cpp ) -target_compile_definitions(CompressionTests PRIVATE SYCL_RT_ZSTD_AVAILABLE) -target_compile_definitions(CompressionTestsPreview PRIVATE SYCL_RT_ZSTD_AVAILABLE) +target_compile_definitions(CompressionTests_non_preview PRIVATE SYCL_RT_ZSTD_AVAILABLE) +target_compile_definitions(CompressionTests_preview PRIVATE SYCL_RT_ZSTD_AVAILABLE) diff --git a/sycl/unittests/config/CMakeLists.txt b/sycl/unittests/config/CMakeLists.txt index 907145e5a49c6..b234c0d879fea 100644 --- a/sycl/unittests/config/CMakeLists.txt +++ b/sycl/unittests/config/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(ConfigTests ConfigTestsPreview OBJECT +add_sycl_unittests(ConfigTests OBJECT ConfigTests.cpp PreferredWGSizeConfigTests.cpp ) diff --git a/sycl/unittests/context_device/CMakeLists.txt b/sycl/unittests/context_device/CMakeLists.txt index 67ffe9e1006a5..19afa8e22b3c0 100644 --- a/sycl/unittests/context_device/CMakeLists.txt +++ b/sycl/unittests/context_device/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(ContextDeviceTests ContextDeviceTestsPreview OBJECT +add_sycl_unittests(ContextDeviceTests OBJECT Context.cpp DeviceRefCounter.cpp HasExtensionWordBoundary.cpp diff --git a/sycl/unittests/event/CMakeLists.txt b/sycl/unittests/event/CMakeLists.txt index a809f7c3f6232..c4d22674b96e7 100644 --- a/sycl/unittests/event/CMakeLists.txt +++ b/sycl/unittests/event/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(EventTests EventTestsPreview OBJECT +add_sycl_unittests(EventTests OBJECT EventDestruction.cpp ) diff --git a/sycl/unittests/handler/CMakeLists.txt b/sycl/unittests/handler/CMakeLists.txt index 3944d3d8784d4..45acef47e91e1 100644 --- a/sycl/unittests/handler/CMakeLists.txt +++ b/sycl/unittests/handler/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(HandlerTests HandlerTestsPreview OBJECT +add_sycl_unittests(HandlerTests OBJECT SetArgForLocalAccessor.cpp require.cpp ) diff --git a/sycl/unittests/kernel-and-program/CMakeLists.txt b/sycl/unittests/kernel-and-program/CMakeLists.txt index a08f283666277..aa42565b7173f 100644 --- a/sycl/unittests/kernel-and-program/CMakeLists.txt +++ b/sycl/unittests/kernel-and-program/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(KernelAndProgramTests KernelAndProgramTestsPreview OBJECT +add_sycl_unittests(KernelAndProgramTests OBJECT Cache.cpp MultipleDevsCache.cpp KernelRelease.cpp @@ -9,5 +9,5 @@ add_sycl_unittest_both(KernelAndProgramTests KernelAndProgramTestsPreview OBJECT OutOfResources.cpp InMemCacheEviction.cpp ) -target_compile_definitions(KernelAndProgramTests PRIVATE -D__SYCL_INTERNAL_API) -target_compile_definitions(KernelAndProgramTestsPreview PRIVATE -D__SYCL_INTERNAL_API) +target_compile_definitions(KernelAndProgramTests_non_preview PRIVATE -D__SYCL_INTERNAL_API) +target_compile_definitions(KernelAndProgramTests_preview PRIVATE -D__SYCL_INTERNAL_API) diff --git a/sycl/unittests/misc/CMakeLists.txt b/sycl/unittests/misc/CMakeLists.txt index 7076c5255fc88..a65044313e0c6 100644 --- a/sycl/unittests/misc/CMakeLists.txt +++ b/sycl/unittests/misc/CMakeLists.txt @@ -2,7 +2,7 @@ set(sycl_lib_dir $) add_definitions(-DSYCL_LIB_DIR="${sycl_lib_dir}") # https://github.com/intel/llvm/issues/19626 if(NOT LLVM_LIBCXX_USED) -add_sycl_unittest_both(MiscTests MiscTestsPreview SHARED +add_sycl_unittests(MiscTests SHARED CircularBuffer.cpp OsUtils.cpp PropertyUtils.cpp diff --git a/sycl/unittests/misc/LinkGraph/CMakeLists.txt b/sycl/unittests/misc/LinkGraph/CMakeLists.txt index 4574707ed8925..aa5db08038c52 100644 --- a/sycl/unittests/misc/LinkGraph/CMakeLists.txt +++ b/sycl/unittests/misc/LinkGraph/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(LinkGraphTests LinkGraphTestsPreview SHARED +add_sycl_unittests(LinkGraphTests SHARED LinkGraphConstruction.cpp LinkGraphPoisoning.cpp LinkGraphUnify.cpp diff --git a/sycl/unittests/pipes/CMakeLists.txt b/sycl/unittests/pipes/CMakeLists.txt index a6f532658dddc..73f5c4b3a030e 100644 --- a/sycl/unittests/pipes/CMakeLists.txt +++ b/sycl/unittests/pipes/CMakeLists.txt @@ -1,10 +1,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(PipeTests PipeTestsPreview OBJECT +add_sycl_unittests(PipeTests OBJECT host_pipe_registration.cpp ) -add_dependencies(PipeTests sycl) -target_include_directories(PipeTests PRIVATE SYSTEM ${sycl_inc_dir}) -add_dependencies(PipeTestsPreview sycl) -target_include_directories(PipeTestsPreview PRIVATE SYSTEM ${sycl_inc_dir}) +add_dependencies(PipeTests_non_preview sycl) +target_include_directories(PipeTests_non_preview PRIVATE SYSTEM ${sycl_inc_dir}) +add_dependencies(PipeTests_preview sycl) +target_include_directories(PipeTests_preview PRIVATE SYSTEM ${sycl_inc_dir}) diff --git a/sycl/unittests/program_manager/CMakeLists.txt b/sycl/unittests/program_manager/CMakeLists.txt index 3db721b924e0e..62997ff9f7463 100644 --- a/sycl/unittests/program_manager/CMakeLists.txt +++ b/sycl/unittests/program_manager/CMakeLists.txt @@ -2,7 +2,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # https://github.com/intel/llvm/issues/19597 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest_both(ProgramManagerTests ProgramManagerTestsPreview OBJECT +add_sycl_unittests(ProgramManagerTests OBJECT CompileTarget.cpp BuildLog.cpp itt_annotations.cpp diff --git a/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt b/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt index aae552840fadd..97a1812b2fc0e 100644 --- a/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt +++ b/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt @@ -2,7 +2,7 @@ # TODO this can be merged back into program manager tests once __sycl_unregister_lib is implemented. # https://github.com/intel/llvm/issues/19597 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest_both(DynamicLinkingTests DynamicLinkingTestsPreview OBJECT +add_sycl_unittests(DynamicLinkingTests OBJECT DynamicLinking.cpp ) endif() diff --git a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt index 354c52579ca5f..55756c5a8d178 100644 --- a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt +++ b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt @@ -1,5 +1,4 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(ProgramManagerArgMaskTests ProgramManagerArgMaskTestsPreview OBJECT +add_sycl_unittests(ProgramManagerArgMaskTests OBJECT EliminatedArgMask.cpp ) - diff --git a/sycl/unittests/queue/CMakeLists.txt b/sycl/unittests/queue/CMakeLists.txt index 0b3e4d42984af..3aedb861d5852 100644 --- a/sycl/unittests/queue/CMakeLists.txt +++ b/sycl/unittests/queue/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(QueueTests QueueTestsPreview OBJECT +add_sycl_unittests(QueueTests OBJECT DeviceCheck.cpp Hash.cpp USM.cpp diff --git a/sycl/unittests/reduction/CMakeLists.txt b/sycl/unittests/reduction/CMakeLists.txt index 3f704f0d170b3..9f929cfa968db 100644 --- a/sycl/unittests/reduction/CMakeLists.txt +++ b/sycl/unittests/reduction/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(ReductionTests ReductionTestsPreview OBJECT +add_sycl_unittests(ReductionTests OBJECT Properties.cpp ) diff --git a/sycl/unittests/sampler/CMakeLists.txt b/sycl/unittests/sampler/CMakeLists.txt index c4917a817c3f8..cb7c8b05cea5d 100644 --- a/sycl/unittests/sampler/CMakeLists.txt +++ b/sycl/unittests/sampler/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(SamplerTests SamplerTestsPreview OBJECT +add_sycl_unittests(SamplerTests OBJECT Properties.cpp ) diff --git a/sycl/unittests/scheduler/CMakeLists.txt b/sycl/unittests/scheduler/CMakeLists.txt index 6e60c71932758..555c8ac92c887 100644 --- a/sycl/unittests/scheduler/CMakeLists.txt +++ b/sycl/unittests/scheduler/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittest_both(SchedulerTests SchedulerTestsPreview OBJECT +add_sycl_unittests(SchedulerTests OBJECT BlockedCommands.cpp Commands.cpp FailedCommands.cpp diff --git a/sycl/unittests/stream/CMakeLists.txt b/sycl/unittests/stream/CMakeLists.txt index 0fbfbade33f94..5141f5327ee7f 100644 --- a/sycl/unittests/stream/CMakeLists.txt +++ b/sycl/unittests/stream/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittest_both(StreamTests StreamTestsPreview OBJECT +add_sycl_unittests(StreamTests OBJECT stream.cpp ) diff --git a/sycl/unittests/thread_safety/CMakeLists.txt b/sycl/unittests/thread_safety/CMakeLists.txt index 2d3908dd22f01..f4b48665e4277 100644 --- a/sycl/unittests/thread_safety/CMakeLists.txt +++ b/sycl/unittests/thread_safety/CMakeLists.txt @@ -1,6 +1,6 @@ # https://github.com/intel/llvm/issues/19591 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest_both(ThreadSafetyTests ThreadSafetyTestsPreview OBJECT +add_sycl_unittests(ThreadSafetyTests OBJECT HostAccessorDeadLock.cpp InteropKernelEnqueue.cpp ) diff --git a/sycl/unittests/ur/CMakeLists.txt b/sycl/unittests/ur/CMakeLists.txt index 1fdcb2bd02308..3baec2d35f1cc 100644 --- a/sycl/unittests/ur/CMakeLists.txt +++ b/sycl/unittests/ur/CMakeLists.txt @@ -1,10 +1,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest_both(UrTests UrTestsPreview OBJECT +add_sycl_unittests(UrTests OBJECT UrUtility.cpp ) -add_dependencies(UrTests sycl) -target_include_directories(UrTests PRIVATE SYSTEM ${sycl_inc_dir}) -add_dependencies(UrTestsPreview sycl) -target_include_directories(UrTestsPreview PRIVATE SYSTEM ${sycl_inc_dir}) +add_dependencies(UrTests_non_preview sycl) +target_include_directories(UrTests_non_preview PRIVATE SYSTEM ${sycl_inc_dir}) +add_dependencies(UrTests_preview sycl) +target_include_directories(UrTests_preview PRIVATE SYSTEM ${sycl_inc_dir}) diff --git a/sycl/unittests/xpti_trace/CMakeLists.txt b/sycl/unittests/xpti_trace/CMakeLists.txt index b7186c27a5d63..d08b7a553e8dc 100644 --- a/sycl/unittests/xpti_trace/CMakeLists.txt +++ b/sycl/unittests/xpti_trace/CMakeLists.txt @@ -1,10 +1,10 @@ add_subdirectory(xptitest_subscriber) add_definitions(-DXPTI_ENABLE_INSTRUMENTATION) -add_sycl_unittest_both(XptiTraceTests XptiTraceTestsPreview OBJECT +add_sycl_unittests(XptiTraceTests OBJECT QueueApiFailures.cpp NodeCreation.cpp QueueIDCheck.cpp ) -target_link_libraries(XptiTraceTests PRIVATE xpti xptitest_subscriber) -target_link_libraries(XptiTraceTestsPreview PRIVATE xpti xptitest_subscriber) +target_link_libraries(XptiTraceTests_non_preview PRIVATE xpti xptitest_subscriber) +target_link_libraries(XptiTraceTests_preview PRIVATE xpti xptitest_subscriber) From 61d5b01e6d9c733e650e24e1f0f1501e1241b217 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 6 Aug 2025 18:59:00 +0200 Subject: [PATCH 12/13] Remove extra s from make target --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 4 ++-- sycl/unittests/Extensions/CMakeLists.txt | 2 +- sycl/unittests/Extensions/CommandGraph/CMakeLists.txt | 2 +- sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt | 2 +- sycl/unittests/Extensions/KernelQueries/CMakeLists.txt | 2 +- sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt | 2 +- sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt | 2 +- sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt | 2 +- sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt | 2 +- sycl/unittests/SYCL2020/CMakeLists.txt | 2 +- sycl/unittests/accessor/CMakeLists.txt | 2 +- sycl/unittests/allowlist/CMakeLists.txt | 2 +- sycl/unittests/assert/CMakeLists.txt | 2 +- sycl/unittests/buffer/CMakeLists.txt | 2 +- sycl/unittests/buffer/l0_specific/CMakeLists.txt | 2 +- sycl/unittests/builtins/CMakeLists.txt | 2 +- sycl/unittests/compression/CMakeLists.txt | 2 +- sycl/unittests/config/CMakeLists.txt | 2 +- sycl/unittests/context_device/CMakeLists.txt | 2 +- sycl/unittests/event/CMakeLists.txt | 2 +- sycl/unittests/handler/CMakeLists.txt | 2 +- sycl/unittests/kernel-and-program/CMakeLists.txt | 2 +- sycl/unittests/misc/CMakeLists.txt | 2 +- sycl/unittests/misc/LinkGraph/CMakeLists.txt | 2 +- sycl/unittests/pipes/CMakeLists.txt | 2 +- sycl/unittests/program_manager/CMakeLists.txt | 2 +- sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt | 2 +- sycl/unittests/program_manager/arg_mask/CMakeLists.txt | 2 +- sycl/unittests/queue/CMakeLists.txt | 2 +- sycl/unittests/reduction/CMakeLists.txt | 2 +- sycl/unittests/sampler/CMakeLists.txt | 2 +- sycl/unittests/scheduler/CMakeLists.txt | 2 +- sycl/unittests/stream/CMakeLists.txt | 2 +- sycl/unittests/thread_safety/CMakeLists.txt | 2 +- sycl/unittests/ur/CMakeLists.txt | 2 +- sycl/unittests/xpti_trace/CMakeLists.txt | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index e7058aabcabc0..76bdbcd54f76e 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -153,12 +153,12 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) endfunction() -# add_sycl_unittests(test_name_prefix SHARED|OBJECT file1.cpp, file2.cpp ...) +# add_sycl_unittest(test_name_prefix SHARED|OBJECT file1.cpp, file2.cpp ...) # # Will compile the list of files together to create two builds, with and without # the SYCL preview features enabled. # Produces two binaries, named `basename(test_name_prefix_non_preview)` and `basename(test_name_prefix_preview)` -macro(add_sycl_unittests test_name_prefix link_variant) +macro(add_sycl_unittest test_name_prefix link_variant) add_sycl_unittest_internal(${test_name_prefix}_non_preview ${link_variant} FALSE ${ARGN}) add_sycl_unittest_internal(${test_name_prefix}_preview ${link_variant} TRUE ${ARGN}) endmacro() diff --git a/sycl/unittests/Extensions/CMakeLists.txt b/sycl/unittests/Extensions/CMakeLists.txt index 2067fca80aaf1..b82c9f798a94c 100644 --- a/sycl/unittests/Extensions/CMakeLists.txt +++ b/sycl/unittests/Extensions/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(ExtensionsTests OBJECT +add_sycl_unittest(ExtensionsTests OBJECT CurrentDevice.cpp DefaultContext.cpp FPGADeviceSelectors.cpp diff --git a/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt b/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt index 1fab427fa56aa..928d67eb56112 100644 --- a/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt +++ b/sycl/unittests/Extensions/CommandGraph/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(CommandGraphExtensionTests OBJECT +add_sycl_unittest(CommandGraphExtensionTests OBJECT Barrier.cpp CommandGraph.cpp CommonReferenceSemantics.cpp diff --git a/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt b/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt index b08a2d3433925..69867a0a82aa5 100644 --- a/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt +++ b/sycl/unittests/Extensions/FreeFunctionCommands/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(FreeFunctionCommandsTests OBJECT +add_sycl_unittest(FreeFunctionCommandsTests OBJECT Barrier.cpp FreeFunctionCommandsEvents.cpp ) diff --git a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt index 4859010ff572a..0b82e66e73f7c 100644 --- a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt +++ b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(KernelQueriesTests OBJECT +add_sycl_unittest(KernelQueriesTests OBJECT SpillMemorySize.cpp ) diff --git a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt index 2f0639a013ac2..03e87ca2d7148 100644 --- a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt +++ b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(NumComputeUnitsTests OBJECT +add_sycl_unittest(NumComputeUnitsTests OBJECT ReturnedQueryValue.cpp ) diff --git a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt index 9810921a67f35..5b2f7f950dd3b 100644 --- a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(VirtualFunctionExtensionTests OBJECT +add_sycl_unittest(VirtualFunctionExtensionTests OBJECT RuntimeLinking.cpp ) diff --git a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt index ade9fee6600fe..e1efc5df6a76a 100644 --- a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(VirtualMemoryExtensionTests OBJECT +add_sycl_unittest(VirtualMemoryExtensionTests OBJECT Exceptions.cpp ) diff --git a/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt b/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt index 5fc89e2cf11f4..32e20acc8529c 100644 --- a/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt +++ b/sycl/unittests/OneAPIDeviceSelector/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(OneAPIDeviceSelectorTests OBJECT +add_sycl_unittest(OneAPIDeviceSelectorTests OBJECT Tests.cpp ) diff --git a/sycl/unittests/SYCL2020/CMakeLists.txt b/sycl/unittests/SYCL2020/CMakeLists.txt index e18bdb2dce3fe..fe8ad4d9658fa 100644 --- a/sycl/unittests/SYCL2020/CMakeLists.txt +++ b/sycl/unittests/SYCL2020/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(SYCL2020Tests OBJECT +add_sycl_unittest(SYCL2020Tests OBJECT GetNativeOpenCL.cpp SpecializationConstant.cpp KernelBundle.cpp diff --git a/sycl/unittests/accessor/CMakeLists.txt b/sycl/unittests/accessor/CMakeLists.txt index 5d8a8c4980c70..312716877a429 100644 --- a/sycl/unittests/accessor/CMakeLists.txt +++ b/sycl/unittests/accessor/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(AccessorTests OBJECT +add_sycl_unittest(AccessorTests OBJECT AccessorHostTask.cpp AccessorImplicitConversion.cpp AccessorIterator.cpp diff --git a/sycl/unittests/allowlist/CMakeLists.txt b/sycl/unittests/allowlist/CMakeLists.txt index 794d7ea1a0e3f..c59fb33d317ab 100644 --- a/sycl/unittests/allowlist/CMakeLists.txt +++ b/sycl/unittests/allowlist/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(AllowListTests OBJECT +add_sycl_unittest(AllowListTests OBJECT ParseAllowList.cpp DeviceIsAllowed.cpp ) diff --git a/sycl/unittests/assert/CMakeLists.txt b/sycl/unittests/assert/CMakeLists.txt index 1d16e16c003e1..dc39fdd9855ed 100644 --- a/sycl/unittests/assert/CMakeLists.txt +++ b/sycl/unittests/assert/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(AssertTests OBJECT +add_sycl_unittest(AssertTests OBJECT assert.cpp support_native.cpp ) diff --git a/sycl/unittests/buffer/CMakeLists.txt b/sycl/unittests/buffer/CMakeLists.txt index bc0326bae6121..744ad2ef12ad6 100644 --- a/sycl/unittests/buffer/CMakeLists.txt +++ b/sycl/unittests/buffer/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(BufferTests OBJECT +add_sycl_unittest(BufferTests OBJECT PARTIAL_SOURCES_INTENDED BufferLocation.cpp Image.cpp diff --git a/sycl/unittests/buffer/l0_specific/CMakeLists.txt b/sycl/unittests/buffer/l0_specific/CMakeLists.txt index 625e4ed87ea49..da1e818fae192 100644 --- a/sycl/unittests/buffer/l0_specific/CMakeLists.txt +++ b/sycl/unittests/buffer/l0_specific/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(BufferTestsL0Specific OBJECT +add_sycl_unittest(BufferTestsL0Specific OBJECT BufferReleaseL0.cpp ) diff --git a/sycl/unittests/builtins/CMakeLists.txt b/sycl/unittests/builtins/CMakeLists.txt index 53462593352b4..0f79b7c062bbe 100644 --- a/sycl/unittests/builtins/CMakeLists.txt +++ b/sycl/unittests/builtins/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(BuiltinsTests OBJECT +add_sycl_unittest(BuiltinsTests OBJECT Builtins.cpp ) diff --git a/sycl/unittests/compression/CMakeLists.txt b/sycl/unittests/compression/CMakeLists.txt index 5e876cc3bf5a6..065b29d249632 100644 --- a/sycl/unittests/compression/CMakeLists.txt +++ b/sycl/unittests/compression/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(CompressionTests OBJECT +add_sycl_unittest(CompressionTests OBJECT CompressionTests.cpp ) target_compile_definitions(CompressionTests_non_preview PRIVATE SYCL_RT_ZSTD_AVAILABLE) diff --git a/sycl/unittests/config/CMakeLists.txt b/sycl/unittests/config/CMakeLists.txt index b234c0d879fea..4114b5aa35d56 100644 --- a/sycl/unittests/config/CMakeLists.txt +++ b/sycl/unittests/config/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(ConfigTests OBJECT +add_sycl_unittest(ConfigTests OBJECT ConfigTests.cpp PreferredWGSizeConfigTests.cpp ) diff --git a/sycl/unittests/context_device/CMakeLists.txt b/sycl/unittests/context_device/CMakeLists.txt index 19afa8e22b3c0..ff435ec68a8d7 100644 --- a/sycl/unittests/context_device/CMakeLists.txt +++ b/sycl/unittests/context_device/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(ContextDeviceTests OBJECT +add_sycl_unittest(ContextDeviceTests OBJECT Context.cpp DeviceRefCounter.cpp HasExtensionWordBoundary.cpp diff --git a/sycl/unittests/event/CMakeLists.txt b/sycl/unittests/event/CMakeLists.txt index c4d22674b96e7..e1cd740350853 100644 --- a/sycl/unittests/event/CMakeLists.txt +++ b/sycl/unittests/event/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(EventTests OBJECT +add_sycl_unittest(EventTests OBJECT EventDestruction.cpp ) diff --git a/sycl/unittests/handler/CMakeLists.txt b/sycl/unittests/handler/CMakeLists.txt index 45acef47e91e1..eb7fc559ab73c 100644 --- a/sycl/unittests/handler/CMakeLists.txt +++ b/sycl/unittests/handler/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(HandlerTests OBJECT +add_sycl_unittest(HandlerTests OBJECT SetArgForLocalAccessor.cpp require.cpp ) diff --git a/sycl/unittests/kernel-and-program/CMakeLists.txt b/sycl/unittests/kernel-and-program/CMakeLists.txt index aa42565b7173f..d912cfbaa9d09 100644 --- a/sycl/unittests/kernel-and-program/CMakeLists.txt +++ b/sycl/unittests/kernel-and-program/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(KernelAndProgramTests OBJECT +add_sycl_unittest(KernelAndProgramTests OBJECT Cache.cpp MultipleDevsCache.cpp KernelRelease.cpp diff --git a/sycl/unittests/misc/CMakeLists.txt b/sycl/unittests/misc/CMakeLists.txt index a65044313e0c6..4cccdd87bbc95 100644 --- a/sycl/unittests/misc/CMakeLists.txt +++ b/sycl/unittests/misc/CMakeLists.txt @@ -2,7 +2,7 @@ set(sycl_lib_dir $) add_definitions(-DSYCL_LIB_DIR="${sycl_lib_dir}") # https://github.com/intel/llvm/issues/19626 if(NOT LLVM_LIBCXX_USED) -add_sycl_unittests(MiscTests SHARED +add_sycl_unittest(MiscTests SHARED CircularBuffer.cpp OsUtils.cpp PropertyUtils.cpp diff --git a/sycl/unittests/misc/LinkGraph/CMakeLists.txt b/sycl/unittests/misc/LinkGraph/CMakeLists.txt index aa5db08038c52..cbb0e09724f6d 100644 --- a/sycl/unittests/misc/LinkGraph/CMakeLists.txt +++ b/sycl/unittests/misc/LinkGraph/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(LinkGraphTests SHARED +add_sycl_unittest(LinkGraphTests SHARED LinkGraphConstruction.cpp LinkGraphPoisoning.cpp LinkGraphUnify.cpp diff --git a/sycl/unittests/pipes/CMakeLists.txt b/sycl/unittests/pipes/CMakeLists.txt index 73f5c4b3a030e..023d5bf0e79fa 100644 --- a/sycl/unittests/pipes/CMakeLists.txt +++ b/sycl/unittests/pipes/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(PipeTests OBJECT +add_sycl_unittest(PipeTests OBJECT host_pipe_registration.cpp ) diff --git a/sycl/unittests/program_manager/CMakeLists.txt b/sycl/unittests/program_manager/CMakeLists.txt index 62997ff9f7463..95d132c5d42bc 100644 --- a/sycl/unittests/program_manager/CMakeLists.txt +++ b/sycl/unittests/program_manager/CMakeLists.txt @@ -2,7 +2,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # https://github.com/intel/llvm/issues/19597 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittests(ProgramManagerTests OBJECT +add_sycl_unittest(ProgramManagerTests OBJECT CompileTarget.cpp BuildLog.cpp itt_annotations.cpp diff --git a/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt b/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt index 97a1812b2fc0e..d57334faf6dd5 100644 --- a/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt +++ b/sycl/unittests/program_manager/DynamicLinking/CMakeLists.txt @@ -2,7 +2,7 @@ # TODO this can be merged back into program manager tests once __sycl_unregister_lib is implemented. # https://github.com/intel/llvm/issues/19597 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittests(DynamicLinkingTests OBJECT +add_sycl_unittest(DynamicLinkingTests OBJECT DynamicLinking.cpp ) endif() diff --git a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt index 55756c5a8d178..92b50511d69fc 100644 --- a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt +++ b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt @@ -1,4 +1,4 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(ProgramManagerArgMaskTests OBJECT +add_sycl_unittest(ProgramManagerArgMaskTests OBJECT EliminatedArgMask.cpp ) diff --git a/sycl/unittests/queue/CMakeLists.txt b/sycl/unittests/queue/CMakeLists.txt index 3aedb861d5852..1045a1865cb29 100644 --- a/sycl/unittests/queue/CMakeLists.txt +++ b/sycl/unittests/queue/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(QueueTests OBJECT +add_sycl_unittest(QueueTests OBJECT DeviceCheck.cpp Hash.cpp USM.cpp diff --git a/sycl/unittests/reduction/CMakeLists.txt b/sycl/unittests/reduction/CMakeLists.txt index 9f929cfa968db..47d16980ceb66 100644 --- a/sycl/unittests/reduction/CMakeLists.txt +++ b/sycl/unittests/reduction/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(ReductionTests OBJECT +add_sycl_unittest(ReductionTests OBJECT Properties.cpp ) diff --git a/sycl/unittests/sampler/CMakeLists.txt b/sycl/unittests/sampler/CMakeLists.txt index cb7c8b05cea5d..f26b608afa5e4 100644 --- a/sycl/unittests/sampler/CMakeLists.txt +++ b/sycl/unittests/sampler/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(SamplerTests OBJECT +add_sycl_unittest(SamplerTests OBJECT Properties.cpp ) diff --git a/sycl/unittests/scheduler/CMakeLists.txt b/sycl/unittests/scheduler/CMakeLists.txt index 555c8ac92c887..afc0e185eb7c0 100644 --- a/sycl/unittests/scheduler/CMakeLists.txt +++ b/sycl/unittests/scheduler/CMakeLists.txt @@ -1,4 +1,4 @@ -add_sycl_unittests(SchedulerTests OBJECT +add_sycl_unittest(SchedulerTests OBJECT BlockedCommands.cpp Commands.cpp FailedCommands.cpp diff --git a/sycl/unittests/stream/CMakeLists.txt b/sycl/unittests/stream/CMakeLists.txt index 5141f5327ee7f..ae8a544262c87 100644 --- a/sycl/unittests/stream/CMakeLists.txt +++ b/sycl/unittests/stream/CMakeLists.txt @@ -1,3 +1,3 @@ -add_sycl_unittests(StreamTests OBJECT +add_sycl_unittest(StreamTests OBJECT stream.cpp ) diff --git a/sycl/unittests/thread_safety/CMakeLists.txt b/sycl/unittests/thread_safety/CMakeLists.txt index f4b48665e4277..b1dc1dfcc1758 100644 --- a/sycl/unittests/thread_safety/CMakeLists.txt +++ b/sycl/unittests/thread_safety/CMakeLists.txt @@ -1,6 +1,6 @@ # https://github.com/intel/llvm/issues/19591 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittests(ThreadSafetyTests OBJECT +add_sycl_unittest(ThreadSafetyTests OBJECT HostAccessorDeadLock.cpp InteropKernelEnqueue.cpp ) diff --git a/sycl/unittests/ur/CMakeLists.txt b/sycl/unittests/ur/CMakeLists.txt index 3baec2d35f1cc..ec1f8c523542a 100644 --- a/sycl/unittests/ur/CMakeLists.txt +++ b/sycl/unittests/ur/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittests(UrTests OBJECT +add_sycl_unittest(UrTests OBJECT UrUtility.cpp ) diff --git a/sycl/unittests/xpti_trace/CMakeLists.txt b/sycl/unittests/xpti_trace/CMakeLists.txt index d08b7a553e8dc..44574d36a9aa4 100644 --- a/sycl/unittests/xpti_trace/CMakeLists.txt +++ b/sycl/unittests/xpti_trace/CMakeLists.txt @@ -1,7 +1,7 @@ add_subdirectory(xptitest_subscriber) add_definitions(-DXPTI_ENABLE_INSTRUMENTATION) -add_sycl_unittests(XptiTraceTests OBJECT +add_sycl_unittest(XptiTraceTests OBJECT QueueApiFailures.cpp NodeCreation.cpp QueueIDCheck.cpp From ae27b3d1786497a1abfc433a074619d1f85ec633 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 6 Aug 2025 19:06:48 +0200 Subject: [PATCH 13/13] Remove unrelated formatting changes. --- sycl/cmake/modules/AddSYCLUnitTest.cmake | 2 +- sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt | 1 + sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt | 1 + sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt | 1 + sycl/unittests/SYCL2020/CMakeLists.txt | 1 + sycl/unittests/allowlist/CMakeLists.txt | 2 +- sycl/unittests/assert/CMakeLists.txt | 1 + sycl/unittests/config/CMakeLists.txt | 2 +- sycl/unittests/program_manager/arg_mask/CMakeLists.txt | 1 + sycl/unittests/thread_safety/CMakeLists.txt | 2 +- 10 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 76bdbcd54f76e..a93896ecce354 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -29,7 +29,7 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview) endif() endif() - # This is done to ensure that preview tests are kept in a seperate + # This is done to ensure that preview tests are kept in a separate # directory, so that they do not interfere with the non-preview tests. # Chaning CMAKE_CURRENT_BINARY_DIR should not affect this variable in its # parent scope. diff --git a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt index 03e87ca2d7148..fe60339444d19 100644 --- a/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt +++ b/sycl/unittests/Extensions/NumComputeUnits/CMakeLists.txt @@ -1,3 +1,4 @@ add_sycl_unittest(NumComputeUnitsTests OBJECT ReturnedQueryValue.cpp ) + diff --git a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt index 5b2f7f950dd3b..73e5d09995f9f 100644 --- a/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualFunctions/CMakeLists.txt @@ -1,3 +1,4 @@ add_sycl_unittest(VirtualFunctionExtensionTests OBJECT RuntimeLinking.cpp ) + diff --git a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt index e1efc5df6a76a..7362ed448d775 100644 --- a/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt +++ b/sycl/unittests/Extensions/VirtualMemory/CMakeLists.txt @@ -1,3 +1,4 @@ add_sycl_unittest(VirtualMemoryExtensionTests OBJECT Exceptions.cpp ) + diff --git a/sycl/unittests/SYCL2020/CMakeLists.txt b/sycl/unittests/SYCL2020/CMakeLists.txt index fe8ad4d9658fa..7a53001025735 100644 --- a/sycl/unittests/SYCL2020/CMakeLists.txt +++ b/sycl/unittests/SYCL2020/CMakeLists.txt @@ -14,3 +14,4 @@ add_sycl_unittest(SYCL2020Tests OBJECT AtomicMemoryScopeCapabilities.cpp AtomicFenceCapabilities.cpp ) + diff --git a/sycl/unittests/allowlist/CMakeLists.txt b/sycl/unittests/allowlist/CMakeLists.txt index c59fb33d317ab..e03fac9af99d1 100644 --- a/sycl/unittests/allowlist/CMakeLists.txt +++ b/sycl/unittests/allowlist/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(AllowListTests OBJECT +add_sycl_unittest(AllowListTests OBJECT ParseAllowList.cpp DeviceIsAllowed.cpp ) diff --git a/sycl/unittests/assert/CMakeLists.txt b/sycl/unittests/assert/CMakeLists.txt index dc39fdd9855ed..9e114f36441f4 100644 --- a/sycl/unittests/assert/CMakeLists.txt +++ b/sycl/unittests/assert/CMakeLists.txt @@ -2,3 +2,4 @@ add_sycl_unittest(AssertTests OBJECT assert.cpp support_native.cpp ) + diff --git a/sycl/unittests/config/CMakeLists.txt b/sycl/unittests/config/CMakeLists.txt index 4114b5aa35d56..b32b0d0a8d713 100644 --- a/sycl/unittests/config/CMakeLists.txt +++ b/sycl/unittests/config/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) -add_sycl_unittest(ConfigTests OBJECT +add_sycl_unittest(ConfigTests OBJECT ConfigTests.cpp PreferredWGSizeConfigTests.cpp ) diff --git a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt index 92b50511d69fc..57cb4aa6a618b 100644 --- a/sycl/unittests/program_manager/arg_mask/CMakeLists.txt +++ b/sycl/unittests/program_manager/arg_mask/CMakeLists.txt @@ -2,3 +2,4 @@ set(CMAKE_CXX_EXTENSIONS OFF) add_sycl_unittest(ProgramManagerArgMaskTests OBJECT EliminatedArgMask.cpp ) + diff --git a/sycl/unittests/thread_safety/CMakeLists.txt b/sycl/unittests/thread_safety/CMakeLists.txt index b1dc1dfcc1758..1a69d249f1246 100644 --- a/sycl/unittests/thread_safety/CMakeLists.txt +++ b/sycl/unittests/thread_safety/CMakeLists.txt @@ -1,6 +1,6 @@ # https://github.com/intel/llvm/issues/19591 if (NOT LLVM_LIBCXX_USED) -add_sycl_unittest(ThreadSafetyTests OBJECT +add_sycl_unittest(ThreadSafetyTests OBJECT HostAccessorDeadLock.cpp InteropKernelEnqueue.cpp )