From c37831ad97cc695741d7aad16a42e98dc8754b8b Mon Sep 17 00:00:00 2001 From: Yilong Guo Date: Tue, 3 Sep 2024 17:41:22 +0800 Subject: [PATCH] [SYCL] Add more aspects to CPU AOT target --- llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td | 10 +++++++++- sycl/test-e2e/NonUniformGroups/ballot_group.cpp | 5 ++++- .../NonUniformGroups/ballot_group_algorithms.cpp | 3 +++ sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp | 7 +++++-- .../NonUniformGroups/fixed_size_group_algorithms.cpp | 5 ++++- sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp | 5 ++++- .../opportunistic_group_algorithms.cpp | 5 ++++- sycl/test-e2e/NonUniformGroups/tangle_group.cpp | 5 ++++- .../NonUniformGroups/tangle_group_algorithms.cpp | 5 ++++- 9 files changed, 41 insertions(+), 9 deletions(-) diff --git a/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td b/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td index 48e042b349623..64433510173c7 100644 --- a/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td +++ b/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td @@ -155,9 +155,17 @@ def : TargetInfo<"__TestDeprecatedAspectList", AspectUsm_restricted_shared_allocations, AspectHost], []>; +defvar IntelCpuAspects = [ + AspectCpu, AspectFp16, AspectFp64, AspectQueue_profiling, AspectAtomic64, + AspectExt_oneapi_srgb, AspectExt_oneapi_native_assert, + AspectExt_intel_legacy_image, AspectExt_oneapi_ballot_group, + AspectExt_oneapi_fixed_size_group, AspectExt_oneapi_opportunistic_group, + AspectExt_oneapi_tangle_group, AspectExt_oneapi_private_alloca +] # AllUSMAspects; + def : TargetInfo<"spir64", [], [], "", "", 1>; def : TargetInfo<"spir64_gen", [], [], "", "", 1>; -def : TargetInfo<"spir64_x86_64", [AspectFp16, AspectFp64, AspectAtomic64, AspectExt_oneapi_ballot_group], [4, 8, 16, 32, 64], "", "", 1>; +def : TargetInfo<"spir64_x86_64", IntelCpuAspects, [4, 8, 16, 32, 64], "", "", 1>; def : TargetInfo<"spir64_fpga", [], [], "", "", 1>; def : TargetInfo<"x86_64", [], [], "", "", 1>; // Examples of how to use a combination of explicitly specified values + predefined lists diff --git a/sycl/test-e2e/NonUniformGroups/ballot_group.cpp b/sycl/test-e2e/NonUniformGroups/ballot_group.cpp index b46a4e125d562..f24bffb81526a 100644 --- a/sycl/test-e2e/NonUniformGroups/ballot_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/ballot_group.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out // -// REQUIRES: gpu +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // UNSUPPORTED: hip #include diff --git a/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp index be7469ffb29dc..3c677ac6f4de5 100644 --- a/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp @@ -1,6 +1,9 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out // +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// // REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_ballot_group diff --git a/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp b/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp index 0a2ab0e4cfb37..939be57799dd4 100644 --- a/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out - -// REQUIRES: gpu +// +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // UNSUPPORTED: hip // REQUIRES: sg-32 diff --git a/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp index 2439690c7bd41..c1c172c4189c3 100644 --- a/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -fsycl-device-code-split=per_kernel -o %t.out // RUN: %{run} %t.out // -// REQUIRES: gpu +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fsycl-device-code-split=per_kernel -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_fixed_size_group diff --git a/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp b/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp index a90a585253460..18d42487b7768 100644 --- a/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out // -// REQUIRES: gpu +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // UNSUPPORTED: hip #include diff --git a/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp index 0bcba981e8872..af4d45cee862f 100644 --- a/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out // -// REQUIRES: gpu +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_opportunistic_group diff --git a/sycl/test-e2e/NonUniformGroups/tangle_group.cpp b/sycl/test-e2e/NonUniformGroups/tangle_group.cpp index c93e1b03e49cd..44191955048f3 100644 --- a/sycl/test-e2e/NonUniformGroups/tangle_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/tangle_group.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -fno-sycl-early-optimizations -o %t.out // RUN: %{run} %t.out // -// REQUIRES: gpu +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fno-sycl-early-optimizations -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // UNSUPPORTED: cuda || hip #include diff --git a/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp index 742ff006da1dc..7033c4c9e4df5 100644 --- a/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp @@ -1,7 +1,10 @@ // RUN: %{build} -fno-sycl-early-optimizations -o %t.out // RUN: %{run} %t.out // -// REQUIRES: gpu +// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fno-sycl-early-optimizations -o %t.x86.out %s %} +// RUN: %if cpu %{ %{run} %t.x86.out %} +// +// REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_tangle_group // UNSUPPORTED: cuda || windows