Skip to content

Commit 97641e1

Browse files
[SYCL] Add check-sycl-dumps target for dumps-only testing (#7830)
This commit adds a new check-sycl-dumps target. This intends to only run SYCL runtime library related dump tests and will therefore only build llvm-readobj, the SYCL libraries (including the enabled plugins), and any dependencies required by LIT. Purpose of this is to allow for faster ABI dump checks on multiple systems. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 79c4a87 commit 97641e1

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

sycl/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,12 @@ add_custom_target(sycl-compiler
298298
opencl-aot
299299
)
300300

301-
add_custom_target( sycl-toolchain
301+
add_custom_target( sycl-runtime-libraries
302302
DEPENDS ${SYCL_RT_LIBS}
303+
)
304+
305+
add_custom_target( sycl-toolchain
306+
DEPENDS sycl-runtime-libraries
303307
sycl-compiler
304308
sycl-ls
305309
${XPTIFW_LIBS}

sycl/cmake/modules/AddSYCL.cmake

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function(add_sycl_library LIB_NAME TYPE)
22
cmake_parse_arguments("ARG"
3-
"TOOLCHAIN"
3+
""
44
"LINKER_SCRIPT"
55
"SOURCES;INCLUDE_DIRS;LIBRARIES"
66
${ARGN}
@@ -9,9 +9,7 @@ function(add_sycl_library LIB_NAME TYPE)
99
target_include_directories(${LIB_NAME} PRIVATE ${ARG_INCLUDE_DIRS})
1010
target_link_libraries(${LIB_NAME} PRIVATE ${ARG_LIBRARIES})
1111

12-
if (ARG_TOOLCHAIN)
13-
add_dependencies(sycl-toolchain ${LIB_NAME})
14-
endif()
12+
add_dependencies(sycl-runtime-libraries ${LIB_NAME})
1513

1614
if (ARG_LINKER_SCRIPT AND UNIX AND NOT APPLE)
1715
target_link_libraries(${LIB_NAME} PRIVATE
@@ -39,7 +37,6 @@ function(add_sycl_plugin PLUGIN_NAME)
3937
)
4038

4139
add_sycl_library("pi_${PLUGIN_NAME}" SHARED
42-
TOOLCHAIN
4340
LINKER_SCRIPT "${PROJECT_SOURCE_DIR}/plugins/ld-version-script.txt"
4441
SOURCES ${ARG_SOURCES}
4542
INCLUDE_DIRS

sycl/test/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ add_lit_testsuite(check-sycl-spirv "Running device-agnostic SYCL regression test
6666
${SYCL_TEST_EXCLUDE}
6767
)
6868

69+
add_lit_testsuite(check-sycl-dumps "Running ABI dump tests only"
70+
${CMAKE_CURRENT_BINARY_DIR}
71+
ARGS ${RT_TEST_ARGS}
72+
PARAMS "SYCL_LIB_DUMPS_ONLY=True"
73+
DEPENDS sycl-runtime-libraries llvm-readobj
74+
EXCLUDE_FROM_CHECK_ALL
75+
)
76+
6977
add_custom_target(check-sycl)
7078
add_dependencies(check-sycl check-sycl-spirv)
7179
set_target_properties(check-sycl PROPERTIES FOLDER "SYCL tests")

sycl/test/lit.cfg.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
config.test_format = lit.formats.ShTest()
2525

2626
# suffixes: A list of file extensions to treat as test files.
27-
config.suffixes = ['.c', '.cpp', '.dump', '.test'] #add .spv. Currently not clear what to do with those
27+
dump_only_tests = bool(lit_config.params.get('SYCL_LIB_DUMPS_ONLY', False))
28+
if dump_only_tests:
29+
config.suffixes = ['.dump'] # Only run dump testing
30+
else:
31+
config.suffixes = ['.c', '.cpp', '.dump', '.test'] #add .spv. Currently not clear what to do with those
2832

2933
# feature tests are considered not so lightweight, so, they are excluded by default
3034
config.excludes = ['Inputs', 'feature-tests']
@@ -119,7 +123,9 @@
119123
additional_flags += ['-Xsycl-target-backend=amdgcn-amd-amdhsa',
120124
'--offload-arch=gfx906']
121125

122-
llvm_config.use_clang(additional_flags=additional_flags)
126+
# Dump-only tests do not have clang available
127+
if not dump_only_tests:
128+
llvm_config.use_clang(additional_flags=additional_flags)
123129

124130
# Set timeout for test = 10 mins
125131
try:

0 commit comments

Comments
 (0)