Skip to content

Commit 642d309

Browse files
[SYCL] fix post-commit failures from kernel_compiler sycl cache PR (#15968)
in some of the post commit testing the SYCL support of the kernel_compiler is not available. Previously, the test just quietly exited, but for the cache support the test grew a bit. Now we check the availability before proceeding. Post commit checks for this are presently running here: https://github.com/intel/llvm/actions/runs/11636755314/job/32408707610
1 parent 644a763 commit 642d309

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

sycl/test-e2e/KernelCompiler/kernel_compiler_sycl.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,29 @@
1111

1212
// -- Test the kernel_compiler with SYCL source.
1313
// RUN: %{build} -o %t.out
14-
// RUN: %{run} %t.out
15-
// RUN: %{l0_leak_check} %{run} %t.out
14+
15+
// If clang++ is not on the PATH, or if sycl was compiled with GCC < 8, then
16+
// the kernel_compiler is not available for SYCL language.
17+
// Note: this 'invoking clang++' version for SYCL language support is temporary,
18+
// and will be replaced by the SYCL_JIT version soon.
19+
// DEFINE: %{available} = %t.out available
20+
21+
// RUN: %if available %{ %{run} %t.out %}
22+
// RUN: %if available %{ %{l0_leak_check} %{run} %t.out %}
1623

1724
// -- Test again, with caching.
1825
// 'reading-from-cache' is just a string we pass to differentiate between the
1926
// two runs.
2027

2128
// DEFINE: %{cache_vars} = %{l0_leak_check} env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=5 SYCL_CACHE_DIR=%t/cache_dir
2229
// RUN: rm -rf %t/cache_dir
23-
// RUN: %{cache_vars} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-WRITTEN-TO-CACHE
24-
// RUN: %{cache_vars} %t.out reading-from-cache 2>&1 | FileCheck %s --check-prefixes=CHECK-READ-FROM-CACHE
30+
// RUN: %if available %{ %{cache_vars} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-WRITTEN-TO-CACHE %}
31+
// RUN: %if available %{ %{cache_vars} %t.out reading-from-cache 2>&1 | FileCheck %s --check-prefixes=CHECK-READ-FROM-CACHE %}
2532

2633
// -- Add leak check.
2734
// RUN: rm -rf %t/cache_dir
28-
// RUN: %{l0_leak_check} %{cache_vars} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-WRITTEN-TO-CACHE
29-
// RUN: %{l0_leak_check} %{cache_vars} %t.out reading-from-cache 2>&1 | FileCheck %s --check-prefixes=CHECK-READ-FROM-CACHE
35+
// RUN: %if available %{ %{l0_leak_check} %{cache_vars} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-WRITTEN-TO-CACHE %}
36+
// RUN: %if available %{ %{l0_leak_check} %{cache_vars} %t.out reading-from-cache 2>&1 | FileCheck %s --check-prefixes=CHECK-READ-FROM-CACHE %}
3037

3138
// CHECK-WRITTEN-TO-CACHE: [Persistent Cache]: enabled
3239
// CHECK-WRITTEN-TO-CACHE-NOT: [kernel_compiler Persistent Cache]: using cached binary
@@ -301,13 +308,18 @@ void test_esimd() {
301308
}
302309

303310
int main(int argc, char *argv[]) {
311+
namespace syclex = sycl::ext::oneapi::experimental;
304312
bool readingFromCache = false;
305313

306314
// Check if the argument is present
307315
if (argc > 1) {
308316
std::string argument(argv[1]);
309317
if (argument == "reading-from-cache") {
310318
readingFromCache = true;
319+
} else if (argument == "available") {
320+
sycl::device d;
321+
bool avail = d.ext_oneapi_can_compile(syclex::source_language::sycl);
322+
return avail;
311323
}
312324
}
313325

0 commit comments

Comments
 (0)