-
Notifications
You must be signed in to change notification settings - Fork 797
[CI][SYCL][Test] Add CMake target for running SYCL unit tests with ABI breaking changes enabled #19687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
…eaking changes enabled.
# | ||
# 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect preview and non-preview versions have a lot of similarities. Is it possible to have
define/macro/whatever add_sycl_unittest_impl(bool IsPreview, ...) { ... }
define/macro/whatever add_sycl_unittest(...) {
add_sycl_unittest_impl(true, ...)
add_sycl_unittest_impl(false, ...)
}
Or just have them both processed in one go in a single routine if that can work (some loop maybe?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm separating out all the common functionality into a different macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new CMake target check-sycl-unittests-preview
that enables running SYCL unit tests with preview breaking changes enabled, allowing testing of code paths that use the __INTEL_PREVIEW_BREAKING_CHANGES
preprocessor macro.
Key changes:
- Introduces
add_sycl_unittest_both
macro to create both regular and preview versions of tests - Updates all SYCL unit test CMakeLists.txt files to use the new macro
- Adds CI workflow steps to run preview tests on both Linux and Windows
Reviewed Changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
sycl/cmake/modules/AddSYCLUnitTest.cmake | Adds core functionality to create both regular and preview test variants |
sycl/unittests/CMakeLists.txt | Creates new SYCLUnitTestsPreview target and check-sycl-unittests-preview target |
Multiple CMakeLists.txt files | Updates all unit test directories to use add_sycl_unittest_both macro |
sycl/unittests/scheduler/SchedulerTestUtils.hpp | Updates MockHandler constructor to use new handler_impl interface |
sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp | Updates MockHandler constructor to use new handler_impl interface |
sycl/unittests/scheduler/InOrderQueueSyncCheck.cpp | Updates event creation to use create_default_event() |
sycl/unittests/misc/OsUtils.cpp | Disables getCurrentDSODir test for preview builds |
sycl/unittests/Extensions/LaunchQueries.cpp | Disables failing tests for preview builds |
.github/workflows/sycl-linux-build.yml | Adds preview unit test execution step |
.github/workflows/sycl-windows-build.yml | Adds preview unit test execution step |
@@ -73,16 +99,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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] There's a spelling error in the comment. 'ur_adapter_opencl.dll' should be 'ur_adapter_opencl.dll' (no change needed, comment is actually correct).
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake lgtm
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated but do we really need to copy the opencl library to the test dir?
This PR adds a new CMake target
check-sycl-unittests-preview
that enabled running SYCL unittests with preview breaking changes enabled.