Skip to content

Commit 5a6e769

Browse files
[SYCL][Unit] Fix unit-tests after #19399 (#19543)
#19399 made layout of `scheduler` class dependent on whether or not XPTI instrumentation is enabled. This caused issues with layout mismatch when `scheduler.hpp` is included directly from unit-tests, because macro enabling XPTI were not aligned between the RT and unit-tests. The issue was caught for scheduler unit-tests and fixed in #19399, but apparently we have more unit-tests which need scheduler. Internal testing discovered issues with buffer unit-tests. Therefore, re-applied the fix from #19399 globally to all unit-tests to prevent issues like this appearing in new and other existing unit-tests.
1 parent 7756d71 commit 5a6e769

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sycl/cmake/modules/AddSYCLUnitTest.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ macro(add_sycl_unittest test_dirname link_variant)
3939
)
4040
endif()
4141

42+
if (SYCL_ENABLE_XPTI_TRACING)
43+
target_compile_definitions(${test_dirname}
44+
PRIVATE XPTI_ENABLE_INSTRUMENTATION XPTI_STATIC_LIBRARY)
45+
endif()
46+
4247
# check-sycl-unittests was using an old sycl library. So, to get
4348
# around this problem, we add the new sycl library to the PATH and
4449
# LD_LIBRARY_PATH on Windows and Linux respectively.

sycl/unittests/scheduler/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,3 @@ add_sycl_unittest(SchedulerTests OBJECT
2323
HostTaskAndBarrier.cpp
2424
BarrierDependencies.cpp
2525
)
26-
27-
if (SYCL_ENABLE_XPTI_TRACING)
28-
target_compile_definitions(SchedulerTests
29-
PRIVATE XPTI_ENABLE_INSTRUMENTATION XPTI_STATIC_LIBRARY)
30-
endif()

0 commit comments

Comments
 (0)