Skip to content

[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

Open
wants to merge 9 commits into
base: sycl
Choose a base branch
from

Conversation

uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Aug 1, 2025

This PR adds a new CMake target check-sycl-unittests-preview that enabled running SYCL unittests with preview breaking changes enabled.

Copilot

This comment was marked as outdated.

#
# 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)
Copy link
Contributor

@aelovikov-intel aelovikov-intel Aug 4, 2025

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?)

Copy link
Contributor Author

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.

@uditagarwal97 uditagarwal97 changed the title [SYCL][Test] Add CMake target for running SYCL unit tests with ABI beaking changes enabled. [CI][SYCL][Test] Add CMake target for running SYCL unit tests with ABI beaking changes enabled. Aug 4, 2025
@uditagarwal97 uditagarwal97 changed the title [CI][SYCL][Test] Add CMake target for running SYCL unit tests with ABI beaking changes enabled. [CI][SYCL][Test] Add CMake target for running SYCL unit tests with ABI breaking changes enabled Aug 4, 2025
@uditagarwal97 uditagarwal97 requested a review from Copilot August 4, 2025 23:24
Copy link
Contributor

@Copilot Copilot AI left a 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)
Copy link
Preview

Copilot AI Aug 4, 2025

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>
@uditagarwal97 uditagarwal97 marked this pull request as ready for review August 4, 2025 23:30
@uditagarwal97 uditagarwal97 requested review from a team as code owners August 4, 2025 23:30
@uditagarwal97 uditagarwal97 requested a review from reble August 4, 2025 23:30
Copy link
Contributor

@sarnex sarnex left a 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
Copy link
Contributor

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?

@sarnex sarnex requested a review from a team August 4, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants