From 36994e2cef540fc185eae3e0cce36b1342d3b9b7 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Mon, 24 Mar 2025 16:35:22 +0100 Subject: [PATCH 1/4] [SYCL][E2E] Update is_compatible tests Due to incorrect REQUIRES these tests are never launched. --- .../is_compatible/is_compatible_amdgcn.cpp | 6 +----- .../is_compatible/is_compatible_nvptx64.cpp | 6 +----- .../is_compatible/is_compatible_several_targets.cpp | 8 +++----- .../is_compatible/is_compatible_spir64.cpp | 6 +----- .../is_compatible/is_compatible_spir64_gen.cpp | 8 +++----- .../is_compatible/is_compatible_spir64_x86_64.cpp | 6 ++---- .../is_compatible/is_compatible_with_aspects.cpp | 11 +---------- 7 files changed, 12 insertions(+), 39 deletions(-) diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp index ffbc4739d1b71..046d032dede33 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp @@ -1,7 +1,3 @@ -// REQUIRES: target-amd, opencl, gpu, cpu - // RUN: %clangxx -fsycl -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx906 -fsycl-targets=amdgcn-amd-amdhsa %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=hip:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out +// RUN: %if !hip %{ not } %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp index eff33e3502789..726ba7a442ea6 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp @@ -1,7 +1,3 @@ -// REQUIRES: target-nvidia, opencl, gpu, cpu - // RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out +// RUN: %if !cuda %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp index eb7f4b0056162..bcae77a70f943 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp @@ -1,7 +1,5 @@ -// REQUIRES: ocloc, any-device-is-level_zero, any-device-is-gpu, any-device-is-cpu +// REQUIRES: opencl-aot, ocloc -// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run-unfiltered-devices} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run-unfiltered-devices} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run-unfiltered-devices} %t.out +// RUN: %if !(level_zero || opencl) %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp index 465a79056906a..c2f13ebdc4af6 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp @@ -1,7 +1,3 @@ -// REQUIRES: cuda, opencl, gpu, cpu - // RUN: %clangxx -fsycl -fsycl-targets=spir64 %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %{run} not %t.out +// RUN: %if hip || cuda %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp index 5adb27e0ae697..d33c4da4354de 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp @@ -1,7 +1,5 @@ -// REQUIRES: ocloc, gpu, level_zero, cpu +// REQUIRES: ocloc -// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out +// RUN: %if !(level_zero || opencl && gpu) %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp index 0a6f2c39df8af..8102be83a32a5 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp @@ -1,7 +1,5 @@ -// REQUIRES: opencl-aot, cpu, gpu, level_zero +// REQUIRES: opencl-aot // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} not %t.out +// RUN: %if !cpu %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp index bd2a4485f75e3..5f1e6b138b82e 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp @@ -1,4 +1,3 @@ -// requires: cpu, gpu, accelerator // RUN: %{build} -Wno-error=incorrect-sub-group-size %O0 -o %t.out // RUN: %{run} %t.out @@ -7,11 +6,10 @@ [[sycl::device_has(sycl::aspect::cpu)]] void foo(){}; [[sycl::device_has(sycl::aspect::gpu)]] void bar(){}; -[[sycl::device_has(sycl::aspect::accelerator)]] void baz(){}; class KernelCPU; class KernelGPU; -class KernelACC; + class GoodWGSize; class WrongReqWGSize; @@ -40,13 +38,6 @@ int main() { Compatible &= Dev.is_gpu(); Called = true; } - if (sycl::is_compatible(Dev)) { - Q.submit( - [&](sycl::handler &h) { h.single_task([=]() { baz(); }); }); - Q.wait(); - Compatible &= Dev.is_accelerator(); - Called = true; - } if (sycl::is_compatible(Dev)) { Q.submit([&](sycl::handler &h) { From 6d57c472aa22ed7d2c144edbb4116227f2c45e1a Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Tue, 25 Mar 2025 12:05:29 +0100 Subject: [PATCH 2/4] make pre-commit happier --- .../is_compatible/is_compatible_amdgcn.cpp | 2 +- .../is_compatible/is_compatible_nvptx64.cpp | 4 ++++ .../is_compatible/is_compatible_several_targets.cpp | 6 +++++- .../is_compatible/is_compatible_spir64_x86_64.cpp | 6 +++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp index 046d032dede33..97fe802d754b3 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp @@ -1,3 +1,3 @@ // RUN: %clangxx -fsycl -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx906 -fsycl-targets=amdgcn-amd-amdhsa %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: %if !hip %{ not } %{run} %t.out +// RUN: %if !hip %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp index 726ba7a442ea6..b92e3e3df6ceb 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp @@ -1,3 +1,7 @@ +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There are no CUDA libs on win machines, so the compilation fails. + // RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %S/Inputs/is_compatible_with_env.cpp -o %t.out // RUN: %if !cuda %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp index bcae77a70f943..a3617244b4ad7 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp @@ -1,5 +1,9 @@ // REQUIRES: opencl-aot, ocloc -// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/is_compatible_with_env.cpp -o %t.out +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There is no CPU device on win yet, so opencl-aot fails to compile the kernel. + +// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/is_compatible_with_env.cpp -o %t.out // RUN: %if !(level_zero || opencl) %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp index 8102be83a32a5..08fba6fcf9f29 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp @@ -1,5 +1,9 @@ // REQUIRES: opencl-aot -// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There is no CPU device on win yet, so opencl-aot fails to compile the kernel. + +// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out // RUN: %if !cpu %{ not %} %{run} %t.out From 3100ac24eecab39386ea2267c3cb700510415712 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Tue, 25 Mar 2025 12:58:36 +0100 Subject: [PATCH 3/4] also disable amdgcn test on win --- .../is_compatible/is_compatible_amdgcn.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp index 97fe802d754b3..aa6cfdac4d1a8 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp @@ -1,3 +1,7 @@ +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There are no ROCm libs on win machines, so the compilation fails. + // RUN: %clangxx -fsycl -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx906 -fsycl-targets=amdgcn-amd-amdhsa %S/Inputs/is_compatible_with_env.cpp -o %t.out // RUN: %if !hip %{ not %} %{run} %t.out From 250815d792b605cfac45d36a13ea0c737543af23 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Wed, 26 Mar 2025 11:05:15 +0100 Subject: [PATCH 4/4] fix amd test --- .../is_compatible/is_compatible_amdgcn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp index aa6cfdac4d1a8..dd1a2372e4df2 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp @@ -2,6 +2,6 @@ // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 // There are no ROCm libs on win machines, so the compilation fails. -// RUN: %clangxx -fsycl -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx906 -fsycl-targets=amdgcn-amd-amdhsa %S/Inputs/is_compatible_with_env.cpp -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030 %S/Inputs/is_compatible_with_env.cpp -o %t.out // RUN: %if !hip %{ not %} %{run} %t.out