Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit a1ca7c5

Browse files
[SYCL] Add SYCL_E2E_RUN_LAUNCHER configuration option (#1613)
It allows to inject extra "launcher" prefix into active *_RUN_PLACEHOLDER substitutions and can be used, for example, to execute all the tests under valgrind. However, local experiments with some internal ifrastructure showed that, while helpful, it's not enough, so two more minor modifications are done as part of this change: - Enable recursive substitutions when SYCL_E2E_RUN_LAUNCHER is enabled - Provide %e2e_tests_root substitution. It is expected to be used in conjunction with existing "%s" substitution to be able to get a unique relative path to the current test.
1 parent 5eb8d02 commit a1ca7c5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

SYCL/lit.cfg.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@
312312
if platform.system() == "Linux":
313313
cpu_run_on_linux_substitute = cpu_run_substitute
314314
cpu_check_on_linux_substitute = "| FileCheck %s"
315+
316+
if config.run_launcher:
317+
cpu_run_substitute += " {}".format(config.run_launcher)
315318
else:
316319
lit_config.warning("CPU device not used")
317320

@@ -353,6 +356,8 @@
353356
if config.sycl_be == "ext_oneapi_cuda":
354357
gpu_run_substitute += "SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 "
355358

359+
if config.run_launcher:
360+
gpu_run_substitute += " {}".format(config.run_launcher)
356361
else:
357362
lit_config.warning("GPU device not used")
358363

@@ -370,11 +375,18 @@
370375
acc_run_substitute = " env ONEAPI_DEVICE_SELECTOR='*:acc' "
371376
acc_check_substitute = "| FileCheck %s"
372377
config.available_features.add('accelerator')
378+
379+
if config.run_launcher:
380+
acc_run_substitute += " {}".format(config.run_launcher)
373381
else:
374382
lit_config.warning("Accelerator device not used")
375383
config.substitutions.append( ('%ACC_RUN_PLACEHOLDER', acc_run_substitute) )
376384
config.substitutions.append( ('%ACC_CHECK_PLACEHOLDER', acc_check_substitute) )
377385

386+
if config.run_launcher:
387+
config.substitutions.append(('%e2e_tests_root', config.test_source_root))
388+
config.recursiveExpansionLimit = 10
389+
378390
if config.sycl_be == 'ext_oneapi_cuda' or (config.sycl_be == 'ext_oneapi_hip' and config.hip_platform == 'NVIDIA'):
379391
config.substitutions.append( ('%sycl_triple', "nvptx64-nvidia-cuda" ) )
380392
elif config.sycl_be == 'ext_oneapi_hip' and config.hip_platform == 'AMD':

SYCL/lit.site.cfg.py.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ config.external_tests = "@SYCL_EXTERNAL_TESTS@"
3434
config.extra_include = "@CMAKE_CURRENT_SOURCE_DIR@/include"
3535
config.gpu_aot_target_opts = lit_config.params.get("gpu_aot_target_opts", "@GPU_AOT_TARGET_OPTS@")
3636

37+
config.run_launcher = "@SYCL_E2E_RUN_LAUNCHER@"
38+
3739
import lit.llvm
3840
lit.llvm.initialize(lit_config, config)
3941

0 commit comments

Comments
 (0)