From 0f18bd2cafc993fd7333ce1933d1056747643c30 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Wed, 16 Jul 2025 00:41:49 -0700 Subject: [PATCH 1/2] [SYCL][E2E] Add AOT options to executable SYCLBIN tests This commit adds SPIR-V AOT options to SYCLBIN tests using executable state. This should improve coverage on the included devices. The device targets should be expanded when https://github.com/intel/llvm/issues/19373 has been fixed. Signed-off-by: Larsen, Steffen --- sycl/test-e2e/SYCLBIN/basic_executable.cpp | 2 +- sycl/test-e2e/SYCLBIN/dae_executable.cpp | 2 +- sycl/test-e2e/SYCLBIN/dg_executable.cpp | 2 +- sycl/test-e2e/SYCLBIN/lit.local.cfg | 7 +++++++ .../SYCLBIN/optional_kernel_features_executable.cpp | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 sycl/test-e2e/SYCLBIN/lit.local.cfg diff --git a/sycl/test-e2e/SYCLBIN/basic_executable.cpp b/sycl/test-e2e/SYCLBIN/basic_executable.cpp index b852dee88f9ef..df378aeae1f88 100644 --- a/sycl/test-e2e/SYCLBIN/basic_executable.cpp +++ b/sycl/test-e2e/SYCLBIN/basic_executable.cpp @@ -11,7 +11,7 @@ // -- Basic test for compiling and loading a SYCLBIN kernel_bundle in executable // -- state. -// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %S/Inputs/basic_kernel.cpp -o %t.syclbin +// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %{syclbin_exec_opts} %S/Inputs/basic_kernel.cpp -o %t.syclbin // RUN: %{build} -o %t.out // RUN: %{l0_leak_check} %{run} %t.out %t.syclbin diff --git a/sycl/test-e2e/SYCLBIN/dae_executable.cpp b/sycl/test-e2e/SYCLBIN/dae_executable.cpp index 49fd6c56947cd..0050f6f3b8715 100644 --- a/sycl/test-e2e/SYCLBIN/dae_executable.cpp +++ b/sycl/test-e2e/SYCLBIN/dae_executable.cpp @@ -10,7 +10,7 @@ // -- Test for using a kernel from a SYCLBIN with a dead argument. -// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %S/Inputs/dae_kernel.cpp -o %t.syclbin +// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %{syclbin_exec_opts} %S/Inputs/dae_kernel.cpp -o %t.syclbin // RUN: %{build} -o %t.out // RUN: %{l0_leak_check} %{run} %t.out %t.syclbin diff --git a/sycl/test-e2e/SYCLBIN/dg_executable.cpp b/sycl/test-e2e/SYCLBIN/dg_executable.cpp index 58f5cf339fee9..c19790c4c8ad0 100644 --- a/sycl/test-e2e/SYCLBIN/dg_executable.cpp +++ b/sycl/test-e2e/SYCLBIN/dg_executable.cpp @@ -13,7 +13,7 @@ // UNSUPPORTED: opencl && gpu // UNSUPPORTED-TRACKER: GSD-4287 -// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %S/Inputs/dg_kernel.cpp -o %t.syclbin +// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %{syclbin_exec_opts} %S/Inputs/dg_kernel.cpp -o %t.syclbin // RUN: %{build} -o %t.out // RUN: %{l0_leak_check} %{run} %t.out %t.syclbin diff --git a/sycl/test-e2e/SYCLBIN/lit.local.cfg b/sycl/test-e2e/SYCLBIN/lit.local.cfg new file mode 100644 index 0000000000000..39c2b7fea352e --- /dev/null +++ b/sycl/test-e2e/SYCLBIN/lit.local.cfg @@ -0,0 +1,7 @@ +syclbin_exec_opts = "" +if 'target-spir' in config.available_features and 'ocloc' in config.available_features: + # Due to a bug in clang-linker-wrapper we cannot use -device * on Windows, so + # we pick specific targets for now. Once that is fixed we can switch to the + # wildcard. + syclbin_exec_opts = '-fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device pvc,dg2,bmg-g21"' +config.substitutions.append(('%{syclbin_exec_opts}', format(syclbin_exec_opts))) diff --git a/sycl/test-e2e/SYCLBIN/optional_kernel_features_executable.cpp b/sycl/test-e2e/SYCLBIN/optional_kernel_features_executable.cpp index cf1fc8aea9e1f..f79169514cb80 100644 --- a/sycl/test-e2e/SYCLBIN/optional_kernel_features_executable.cpp +++ b/sycl/test-e2e/SYCLBIN/optional_kernel_features_executable.cpp @@ -11,7 +11,7 @@ // -- Test for compiling and loading a kernel bundle with a SYCLBIN containing // the use of optional kernel features. -// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %S/Inputs/optional_kernel_features.cpp -o %t.syclbin +// RUN: %clangxx --offload-new-driver -fsyclbin=executable %{sycl_target_opts} %{syclbin_exec_opts} %S/Inputs/optional_kernel_features.cpp -o %t.syclbin // RUN: %{build} -o %t.out // RUN: %{l0_leak_check} %{run} %t.out %t.syclbin From 14ec3d10817c2e31c2ee68b3ebc90fa4203de3ee Mon Sep 17 00:00:00 2001 From: Steffen Larsen Date: Wed, 16 Jul 2025 15:48:07 +0200 Subject: [PATCH 2/2] Update sycl/test-e2e/SYCLBIN/lit.local.cfg --- sycl/test-e2e/SYCLBIN/lit.local.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/SYCLBIN/lit.local.cfg b/sycl/test-e2e/SYCLBIN/lit.local.cfg index 39c2b7fea352e..7abdeb54dd7c7 100644 --- a/sycl/test-e2e/SYCLBIN/lit.local.cfg +++ b/sycl/test-e2e/SYCLBIN/lit.local.cfg @@ -2,6 +2,6 @@ syclbin_exec_opts = "" if 'target-spir' in config.available_features and 'ocloc' in config.available_features: # Due to a bug in clang-linker-wrapper we cannot use -device * on Windows, so # we pick specific targets for now. Once that is fixed we can switch to the - # wildcard. + # wildcard. See https://github.com/intel/llvm/issues/19373. syclbin_exec_opts = '-fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device pvc,dg2,bmg-g21"' config.substitutions.append(('%{syclbin_exec_opts}', format(syclbin_exec_opts)))