From 38fc25e4a20195ad8eede78756ae37cc0871f5ce Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Wed, 6 Aug 2025 14:21:11 +0200 Subject: [PATCH 1/9] Add sycl-jit e2e feature The project may be built with --disable-jit --- sycl/test-e2e/KernelCompiler/sycl.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_basic.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_cache.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_cache_pm.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_device_globals.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_imf.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_include_paths.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_join.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_lifetimes.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_namespaces.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_overload.cpp | 2 +- sycl/test-e2e/KernelCompiler/sycl_time_trace.cpp | 2 ++ sycl/test-e2e/lit.cfg.py | 3 +++ sycl/test-e2e/lit.site.cfg.py.in | 2 ++ 14 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sycl/test-e2e/KernelCompiler/sycl.cpp b/sycl/test-e2e/KernelCompiler/sycl.cpp index 0c903049594ac..4391492ed632e 100644 --- a/sycl/test-e2e/KernelCompiler/sycl.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out diff --git a/sycl/test-e2e/KernelCompiler/sycl_basic.cpp b/sycl/test-e2e/KernelCompiler/sycl_basic.cpp index fbb7768fd8ac8..40a99c9681e7b 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_basic.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_basic.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out diff --git a/sycl/test-e2e/KernelCompiler/sycl_cache.cpp b/sycl/test-e2e/KernelCompiler/sycl_cache.cpp index 0cffec11ffa47..c926b5ad8a39d 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_cache.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_cache.cpp @@ -12,7 +12,7 @@ // target. Don't run eviction check for CUDA/HIP, so that we don't have to find // a magic number that works for all binaries (and by definition is flaky). -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // DEFINE: %{cache_vars} = env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=7 SYCL_CACHE_DIR=%t/cache_dir // DEFINE: %{max_cache_size} = SYCL_CACHE_MAX_SIZE=30000 diff --git a/sycl/test-e2e/KernelCompiler/sycl_cache_pm.cpp b/sycl/test-e2e/KernelCompiler/sycl_cache_pm.cpp index 83b6f425ec308..b900ab7b80b10 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_cache_pm.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_cache_pm.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: (opencl || level_zero) -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // -- Test the kernel_compiler with SYCL source. // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/KernelCompiler/sycl_device_globals.cpp b/sycl/test-e2e/KernelCompiler/sycl_device_globals.cpp index ba8b08584df81..25e09ab6df446 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_device_globals.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_device_globals.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // UNSUPPORTED: opencl && gpu // UNSUPPORTED-TRACKER: GSD-4287 diff --git a/sycl/test-e2e/KernelCompiler/sycl_imf.cpp b/sycl/test-e2e/KernelCompiler/sycl_imf.cpp index 363728b318580..8c6b5625e84d3 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_imf.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_imf.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // REQUIRES: (opencl || level_zero) // UNSUPPORTED: accelerator diff --git a/sycl/test-e2e/KernelCompiler/sycl_include_paths.cpp b/sycl/test-e2e/KernelCompiler/sycl_include_paths.cpp index d073390a3d6a9..86b4b6f9b0d71 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_include_paths.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_include_paths.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{run} %t.out %S | FileCheck %s --check-prefixes=CHECK,CHECK-NOCWD diff --git a/sycl/test-e2e/KernelCompiler/sycl_join.cpp b/sycl/test-e2e/KernelCompiler/sycl_join.cpp index f11af750accab..f8b44a8cc1748 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_join.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_join.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_shared_allocations +// REQUIRES: sycl-jit, aspect-usm_shared_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{run} %t.out diff --git a/sycl/test-e2e/KernelCompiler/sycl_lifetimes.cpp b/sycl/test-e2e/KernelCompiler/sycl_lifetimes.cpp index 7d38e44cab6c2..ec606d6222ee9 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_lifetimes.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_lifetimes.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} env SYCL_UR_TRACE=-1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s diff --git a/sycl/test-e2e/KernelCompiler/sycl_namespaces.cpp b/sycl/test-e2e/KernelCompiler/sycl_namespaces.cpp index 29c54161506f9..6e4b4d6133abe 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_namespaces.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_namespaces.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out diff --git a/sycl/test-e2e/KernelCompiler/sycl_overload.cpp b/sycl/test-e2e/KernelCompiler/sycl_overload.cpp index a1b6cb787d030..af7a65561ef57 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_overload.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_overload.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: aspect-usm_device_allocations +// REQUIRES: sycl-jit, aspect-usm_device_allocations // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out diff --git a/sycl/test-e2e/KernelCompiler/sycl_time_trace.cpp b/sycl/test-e2e/KernelCompiler/sycl_time_trace.cpp index 4b1a04d1bcb8d..badaaa5d7d034 100644 --- a/sycl/test-e2e/KernelCompiler/sycl_time_trace.cpp +++ b/sycl/test-e2e/KernelCompiler/sycl_time_trace.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: sycl-jit + // RUN: %{build} -o %t.out // RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{run} %t.out | FileCheck %s diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 85d3858e22f32..6d591500a55a5 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -970,6 +970,9 @@ def get_sycl_ls_verbose(sycl_device, env): config.available_features.add("device-config-file") config.substitutions.append(("%device_config_file_include_flag", "")) +if config.enable_sycl_jit == "ON": + config.available_features.add("sycl-jit") + # That has to be executed last so that all device-independent features have been # discovered already. config.sycl_dev_features = {} diff --git a/sycl/test-e2e/lit.site.cfg.py.in b/sycl/test-e2e/lit.site.cfg.py.in index 8d45b7d762baf..c663c3447b554 100644 --- a/sycl/test-e2e/lit.site.cfg.py.in +++ b/sycl/test-e2e/lit.site.cfg.py.in @@ -62,6 +62,8 @@ config.vulkan_found = "@Vulkan_FOUND@" config.run_launcher = lit_config.params.get('run_launcher', "@SYCL_E2E_RUN_LAUNCHER@") config.allow_unknown_arch = "@SYCL_E2E_LIT_ALLOW_UNKNOWN_ARCH@" +config.enable_sycl_jit = "@SYCL_ENABLE_EXTENSION_JIT@" + import lit.llvm lit.llvm.initialize(lit_config, config) From 1bb0906ecb51f47fa99c4713b79c692b04043db9 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Fri, 8 Aug 2025 13:15:52 +0200 Subject: [PATCH 2/9] change the approach --- sycl/test-e2e/lit.cfg.py | 13 +++++++++++-- sycl/test-e2e/lit.site.cfg.py.in | 2 -- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 6d591500a55a5..048d0cf39c8eb 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -970,8 +970,17 @@ def get_sycl_ls_verbose(sycl_device, env): config.available_features.add("device-config-file") config.substitutions.append(("%device_config_file_include_flag", "")) -if config.enable_sycl_jit == "ON": - config.available_features.add("sycl-jit") +# Check sycl-jit +if platform.system() == "Linux": + if os.path.exists(os.path.join(config.sycl_libs_dir, "libsycl-jit.so")): + config.available_features.add("sycl-jit") +elif platform.system() == "Windows": + if os.path.exists(os.path.join(config.sycl_libs_dir, "sycl-jit.lib")): + config.available_features.add("sycl-jit") +if "sycl-jit" not in config.available_features: + lit_config.note( + "sycl-jit not found. Check if the '--disable-jit' flag was passed or the library was renamed. Tests requiring sycl-jit will be skipped." + ) # That has to be executed last so that all device-independent features have been # discovered already. diff --git a/sycl/test-e2e/lit.site.cfg.py.in b/sycl/test-e2e/lit.site.cfg.py.in index c663c3447b554..8d45b7d762baf 100644 --- a/sycl/test-e2e/lit.site.cfg.py.in +++ b/sycl/test-e2e/lit.site.cfg.py.in @@ -62,8 +62,6 @@ config.vulkan_found = "@Vulkan_FOUND@" config.run_launcher = lit_config.params.get('run_launcher', "@SYCL_E2E_RUN_LAUNCHER@") config.allow_unknown_arch = "@SYCL_E2E_LIT_ALLOW_UNKNOWN_ARCH@" -config.enable_sycl_jit = "@SYCL_ENABLE_EXTENSION_JIT@" - import lit.llvm lit.llvm.initialize(lit_config, config) From 1e26b722fcb4511485103bd37f29eabbfcc9647a Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Fri, 8 Aug 2025 14:29:54 +0200 Subject: [PATCH 3/9] upd build_specific_features --- sycl/test-e2e/E2EExpr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/test-e2e/E2EExpr.py b/sycl/test-e2e/E2EExpr.py index 289eb4fe3c7cd..b3336e559d0ad 100644 --- a/sycl/test-e2e/E2EExpr.py +++ b/sycl/test-e2e/E2EExpr.py @@ -47,6 +47,7 @@ class E2EExpr(BooleanExpression): "pdtracker", "ze_debug", "device-config-file", + "build_specific_features", } def __init__(self, string, variables, build_only_mode, final_unknown_value): From 90b66dc47ae8e563471c860eb99844e3e02cb01e Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Fri, 8 Aug 2025 14:31:44 +0200 Subject: [PATCH 4/9] lol --- sycl/test-e2e/E2EExpr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/E2EExpr.py b/sycl/test-e2e/E2EExpr.py index b3336e559d0ad..7122e1e55ddfa 100644 --- a/sycl/test-e2e/E2EExpr.py +++ b/sycl/test-e2e/E2EExpr.py @@ -47,7 +47,7 @@ class E2EExpr(BooleanExpression): "pdtracker", "ze_debug", "device-config-file", - "build_specific_features", + "sycl-jit", } def __init__(self, string, variables, build_only_mode, final_unknown_value): From b0e6d6246b765bb640f3cc1c47fcb295ec941125 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Fri, 8 Aug 2025 14:40:43 +0200 Subject: [PATCH 5/9] Upd comments --- sycl/test-e2e/lit.cfg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 048d0cf39c8eb..825a153418b89 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -970,7 +970,7 @@ def get_sycl_ls_verbose(sycl_device, env): config.available_features.add("device-config-file") config.substitutions.append(("%device_config_file_include_flag", "")) -# Check sycl-jit +# Check for sycl-jit library if platform.system() == "Linux": if os.path.exists(os.path.join(config.sycl_libs_dir, "libsycl-jit.so")): config.available_features.add("sycl-jit") @@ -979,7 +979,7 @@ def get_sycl_ls_verbose(sycl_device, env): config.available_features.add("sycl-jit") if "sycl-jit" not in config.available_features: lit_config.note( - "sycl-jit not found. Check if the '--disable-jit' flag was passed or the library was renamed. Tests requiring sycl-jit will be skipped." + "sycl-jit was not found, corresponding tests will be skipped." ) # That has to be executed last so that all device-independent features have been From 787752cb80792bc83fb2e528470aad78fb415c82 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Fri, 8 Aug 2025 15:33:20 +0200 Subject: [PATCH 6/9] format --- sycl/test-e2e/lit.cfg.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 825a153418b89..3c7dd1f292015 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -978,9 +978,7 @@ def get_sycl_ls_verbose(sycl_device, env): if os.path.exists(os.path.join(config.sycl_libs_dir, "sycl-jit.lib")): config.available_features.add("sycl-jit") if "sycl-jit" not in config.available_features: - lit_config.note( - "sycl-jit was not found, corresponding tests will be skipped." - ) + lit_config.note("sycl-jit was not found. Tests requiring sycl-jit will be skipped.") # That has to be executed last so that all device-independent features have been # discovered already. From a1c68404e3e8b071dc86d37323d12b773d49b444 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Mon, 11 Aug 2025 12:32:02 +0200 Subject: [PATCH 7/9] look for dll --- sycl/test-e2e/lit.cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 3c7dd1f292015..990c0e4d4234e 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -975,7 +975,7 @@ def get_sycl_ls_verbose(sycl_device, env): if os.path.exists(os.path.join(config.sycl_libs_dir, "libsycl-jit.so")): config.available_features.add("sycl-jit") elif platform.system() == "Windows": - if os.path.exists(os.path.join(config.sycl_libs_dir, "sycl-jit.lib")): + if os.path.exists(os.path.join(config.dpcpp_bin_dir, "sycl-jit.dll")): config.available_features.add("sycl-jit") if "sycl-jit" not in config.available_features: lit_config.note("sycl-jit was not found. Tests requiring sycl-jit will be skipped.") From 8f01198fb787dbd8aab5ddd41fcaedc8ebdc73d8 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Mon, 11 Aug 2025 16:22:39 +0200 Subject: [PATCH 8/9] apply suggestion --- sycl/test-e2e/E2EExpr.py | 1 - sycl/test-e2e/lit.cfg.py | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sycl/test-e2e/E2EExpr.py b/sycl/test-e2e/E2EExpr.py index 7122e1e55ddfa..289eb4fe3c7cd 100644 --- a/sycl/test-e2e/E2EExpr.py +++ b/sycl/test-e2e/E2EExpr.py @@ -47,7 +47,6 @@ class E2EExpr(BooleanExpression): "pdtracker", "ze_debug", "device-config-file", - "sycl-jit", } def __init__(self, string, variables, build_only_mode, final_unknown_value): diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 990c0e4d4234e..9c0d08ea0fffc 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -971,14 +971,15 @@ def get_sycl_ls_verbose(sycl_device, env): config.substitutions.append(("%device_config_file_include_flag", "")) # Check for sycl-jit library -if platform.system() == "Linux": - if os.path.exists(os.path.join(config.sycl_libs_dir, "libsycl-jit.so")): - config.available_features.add("sycl-jit") -elif platform.system() == "Windows": - if os.path.exists(os.path.join(config.dpcpp_bin_dir, "sycl-jit.dll")): - config.available_features.add("sycl-jit") -if "sycl-jit" not in config.available_features: - lit_config.note("sycl-jit was not found. Tests requiring sycl-jit will be skipped.") +if config.test_mode != "build-only": + if platform.system() == "Linux": + if os.path.exists(os.path.join(config.sycl_libs_dir, "libsycl-jit.so")): + config.available_features.add("sycl-jit") + elif platform.system() == "Windows": + if os.path.exists(os.path.join(config.dpcpp_bin_dir, "sycl-jit.dll")): + config.available_features.add("sycl-jit") + if "sycl-jit" not in config.available_features: + lit_config.note("sycl-jit was not found. Tests requiring sycl-jit will be skipped.") # That has to be executed last so that all device-independent features have been # discovered already. From 884e5fdb5d7152a3e792ddaf8b08fb13646702a4 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Mon, 11 Aug 2025 16:36:35 +0200 Subject: [PATCH 9/9] format --- sycl/test-e2e/lit.cfg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 9c0d08ea0fffc..a777434bed9da 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -979,7 +979,9 @@ def get_sycl_ls_verbose(sycl_device, env): if os.path.exists(os.path.join(config.dpcpp_bin_dir, "sycl-jit.dll")): config.available_features.add("sycl-jit") if "sycl-jit" not in config.available_features: - lit_config.note("sycl-jit was not found. Tests requiring sycl-jit will be skipped.") + lit_config.note( + "sycl-jit was not found. Tests requiring sycl-jit will be skipped." + ) # That has to be executed last so that all device-independent features have been # discovered already.