Skip to content

Commit 0fa2cd4

Browse files
[SYCL][Unit Tests] Fix regression after #19687 (#20534)
This patch fixes a regression happened after #19687: `check-all` lost the entire SYCL-Unit test suite, so SYCL unit tests did not run for `check-all` target.
1 parent cccb1de commit 0fa2cd4

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

sycl/cmake/modules/AddSYCLUnitTest.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ endfunction()
157157
#
158158
# Will compile the list of files together to create two builds, with and without
159159
# the SYCL preview features enabled.
160-
# Produces two binaries, named `basename(test_name_prefix_non_preview)` and `basename(test_name_prefix_preview)`
160+
# Produces two binaries, named `basename(test_name_prefix_Non_Preview_Tests)` and `basename(test_name_prefix_Preview_Tests)`
161+
# Note: in case of changing test names below, please also adjust the test suffix
162+
# in sycl/test/Unit/lit.cfg.py in the line which looks like this:
163+
# `config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, <...>)`
161164
macro(add_sycl_unittest test_name_prefix link_variant)
162-
add_sycl_unittest_internal(${test_name_prefix}_non_preview ${link_variant} FALSE ${ARGN})
163-
add_sycl_unittest_internal(${test_name_prefix}_preview ${link_variant} TRUE ${ARGN})
165+
add_sycl_unittest_internal(${test_name_prefix}_Non_Preview_Tests ${link_variant} FALSE ${ARGN})
166+
add_sycl_unittest_internal(${test_name_prefix}_Preview_Tests ${link_variant} TRUE ${ARGN})
164167
endmacro()

sycl/test/Unit/lit.cfg.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
config.test_source_root = config.test_exec_root
2222

2323
# testFormat: The test format to use to interpret tests.
24-
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Tests")
24+
# TODO: CMPLRTST-28093: currently only non-preview SYCL unit tests are executed
25+
# as part of `check-sycl` and `check-all`. Change the second argument to just
26+
# "Tests" after the concurrency problem with non-preview and preview versions of
27+
# SYCL unit tests is fixed, so both non-review and preview versions of SYCL unit
28+
# tests will be executed as part of `check-sycl` and `check-all`.
29+
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Non_Preview_Tests")
2530

2631
# Propagate the temp directory. Windows requires this because it uses \Windows\
2732
# if none of these are present.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_sycl_unittest(CompressionTests OBJECT
22
CompressionTests.cpp
33
)
4-
target_compile_definitions(CompressionTests_non_preview PRIVATE SYCL_RT_ZSTD_AVAILABLE)
5-
target_compile_definitions(CompressionTests_preview PRIVATE SYCL_RT_ZSTD_AVAILABLE __INTEL_PREVIEW_BREAKING_CHANGES)
4+
target_compile_definitions(CompressionTests_Non_Preview_Tests PRIVATE SYCL_RT_ZSTD_AVAILABLE)
5+
target_compile_definitions(CompressionTests_Preview_Tests PRIVATE SYCL_RT_ZSTD_AVAILABLE __INTEL_PREVIEW_BREAKING_CHANGES)

sycl/unittests/kernel-and-program/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ add_sycl_unittest(KernelAndProgramTests OBJECT
1111
KernelArgs.cpp
1212
KernelInfoShortcuts.cpp
1313
)
14-
target_compile_definitions(KernelAndProgramTests_non_preview PRIVATE __SYCL_INTERNAL_API)
15-
target_compile_definitions(KernelAndProgramTests_preview PRIVATE __SYCL_INTERNAL_API __INTEL_PREVIEW_BREAKING_CHANGES)
14+
target_compile_definitions(KernelAndProgramTests_Non_Preview_Tests PRIVATE __SYCL_INTERNAL_API)
15+
target_compile_definitions(KernelAndProgramTests_Preview_Tests PRIVATE __SYCL_INTERNAL_API __INTEL_PREVIEW_BREAKING_CHANGES)

sycl/unittests/pipes/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ add_sycl_unittest(PipeTests OBJECT
44
host_pipe_registration.cpp
55
)
66

7-
add_dependencies(PipeTests_non_preview sycl)
8-
target_include_directories(PipeTests_non_preview PRIVATE SYSTEM ${sycl_inc_dir})
9-
add_dependencies(PipeTests_preview sycl)
10-
target_include_directories(PipeTests_preview PRIVATE SYSTEM ${sycl_inc_dir})
7+
add_dependencies(PipeTests_Non_Preview_Tests sycl)
8+
target_include_directories(PipeTests_Non_Preview_Tests PRIVATE SYSTEM ${sycl_inc_dir})
9+
add_dependencies(PipeTests_Preview_Tests sycl)
10+
target_include_directories(PipeTests_Preview_Tests PRIVATE SYSTEM ${sycl_inc_dir})

sycl/unittests/ur/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ add_sycl_unittest(UrTests OBJECT
44
UrUtility.cpp
55
)
66

7-
add_dependencies(UrTests_non_preview sycl)
8-
target_include_directories(UrTests_non_preview PRIVATE SYSTEM ${sycl_inc_dir})
9-
add_dependencies(UrTests_preview sycl)
10-
target_include_directories(UrTests_preview PRIVATE SYSTEM ${sycl_inc_dir})
7+
add_dependencies(UrTests_Non_Preview_Tests sycl)
8+
target_include_directories(UrTests_Non_Preview_Tests PRIVATE SYSTEM ${sycl_inc_dir})
9+
add_dependencies(UrTests_Preview_Tests sycl)
10+
target_include_directories(UrTests_Preview_Tests PRIVATE SYSTEM ${sycl_inc_dir})

sycl/unittests/xpti_trace/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ add_sycl_unittest(XptiTraceTests OBJECT
66
NodeCreation.cpp
77
QueueIDCheck.cpp
88
)
9-
target_link_libraries(XptiTraceTests_non_preview PRIVATE xpti xptitest_subscriber)
10-
target_link_libraries(XptiTraceTests_preview PRIVATE xpti xptitest_subscriber)
9+
target_link_libraries(XptiTraceTests_Non_Preview_Tests PRIVATE xpti xptitest_subscriber)
10+
target_link_libraries(XptiTraceTests_Preview_Tests PRIVATE xpti xptitest_subscriber)

0 commit comments

Comments
 (0)