diff --git a/sycl/test-e2e/AtomicRef/assignment_atomic64.cpp b/sycl/test-e2e/AtomicRef/assignment_atomic64.cpp index ffee3ebf0d1f3..48be02c2f1a59 100644 --- a/sycl/test-e2e/AtomicRef/assignment_atomic64.cpp +++ b/sycl/test-e2e/AtomicRef/assignment_atomic64.cpp @@ -1,3 +1,5 @@ +// REQUIRES: aspect-atomic64 + // RUN: %clangxx -fsycl -fsycl-device-code-split=per_kernel -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -12,11 +14,6 @@ int main() { device dev = q.get_device(); - if (!dev.has(aspect::atomic64)) { - std::cout << "Skipping test\n"; - return 0; - } - const bool DoublesSupported = dev.has(sycl::aspect::fp64); constexpr int N = 32; diff --git a/sycl/test-e2e/AtomicRef/assignment_atomic64_generic.cpp b/sycl/test-e2e/AtomicRef/assignment_atomic64_generic.cpp index 3de52ac7fcc55..4ea16be5a9f0c 100644 --- a/sycl/test-e2e/AtomicRef/assignment_atomic64_generic.cpp +++ b/sycl/test-e2e/AtomicRef/assignment_atomic64_generic.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-atomic64 // RUN: %clangxx -fsycl -fsycl-device-code-split=per_kernel -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -12,11 +13,6 @@ int main() { device dev = q.get_device(); - if (!dev.has(aspect::atomic64)) { - std::cout << "Skipping test\n"; - return 0; - } - const bool DoublesSupported = dev.has(sycl::aspect::fp64); constexpr int N = 32; diff --git a/sycl/test-e2e/BFloat16/bfloat16_builtins.cpp b/sycl/test-e2e/BFloat16/bfloat16_builtins.cpp index fb12aace04560..68574baec01b8 100644 --- a/sycl/test-e2e/BFloat16/bfloat16_builtins.cpp +++ b/sycl/test-e2e/BFloat16/bfloat16_builtins.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-ext_oneapi_bfloat16_math_functions // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %if cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_80 %} %s -o %t.out // Currently the feature isn't supported on FPGA. // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -222,28 +223,27 @@ bool check(bool a, bool b) { return (a != b); } int main() { queue q; - if (q.get_device().has(aspect::ext_oneapi_bfloat16_math_functions)) { - std::vector a(N), b(N), c(N); - int err = 0; + std::vector a(N), b(N), c(N); + int err = 0; - for (int i = 0; i < N; i++) { - a[i] = (i - N / 2) / (float)N; - b[i] = (N / 2 - i) / (float)N; - c[i] = (float)(3 * i); - } + for (int i = 0; i < N; i++) { + a[i] = (i - N / 2) / (float)N; + b[i] = (N / 2 - i) / (float)N; + c[i] = (float)(3 * i); + } - TEST_BUILTIN_1(fabs, bfloat16); - TEST_BUILTIN_2(fmin); - TEST_BUILTIN_2(fmax); - TEST_BUILTIN_3(fma); + TEST_BUILTIN_1(fabs, bfloat16); + TEST_BUILTIN_2(fmin); + TEST_BUILTIN_2(fmax); + TEST_BUILTIN_3(fma); - float check_nan = 0; - TEST_BUILTIN_2_NAN(fmin); - TEST_BUILTIN_2_NAN(fmax); + float check_nan = 0; + TEST_BUILTIN_2_NAN(fmin); + TEST_BUILTIN_2_NAN(fmax); + + // Insert NAN value in a to test isnan + a[0] = a[N - 1] = NAN; + TEST_BUILTIN_1(isnan, bool); - // Insert NAN value in a to test isnan - a[0] = a[N - 1] = NAN; - TEST_BUILTIN_1(isnan, bool); - } return 0; } diff --git a/sycl/test-e2e/Basic/event_profiling_info.cpp b/sycl/test-e2e/Basic/event_profiling_info.cpp index 29a3f345305be..27cf6c0c04311 100644 --- a/sycl/test-e2e/Basic/event_profiling_info.cpp +++ b/sycl/test-e2e/Basic/event_profiling_info.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-queue_profiling // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -41,10 +42,6 @@ bool verifyProfiling(event Event) { // event to complete execution. int main() { device Dev; - if (!Dev.has(aspect::queue_profiling)) { - std::cout << "Profiling is not supported, skipping the test" << std::endl; - return 0; - } const size_t Size = 10000; int Data[Size] = {0}; diff --git a/sycl/test-e2e/Basic/event_profiling_workaround.cpp b/sycl/test-e2e/Basic/event_profiling_workaround.cpp index deb8b939626ad..1c21bfb913ba9 100644 --- a/sycl/test-e2e/Basic/event_profiling_workaround.cpp +++ b/sycl/test-e2e/Basic/event_profiling_workaround.cpp @@ -1,3 +1,4 @@ +// UNSUPPORTED: aspect-queue_profiling // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // // RUN: %ACC_RUN_PLACEHOLDER %t.out @@ -48,10 +49,6 @@ bool verifyProfiling(event Event) { // devices. int main() { device Dev; - if (Dev.has(aspect::queue_profiling)) { - std::cout << "Profiling is fully supported, skipping the test" << std::endl; - return 0; - } const size_t Size = 10000; int Data[Size] = {0}; diff --git a/sycl/test-e2e/Basic/half_builtins.cpp b/sycl/test-e2e/Basic/half_builtins.cpp index 34fab08c8992e..8857af50cba71 100644 --- a/sycl/test-e2e/Basic/half_builtins.cpp +++ b/sycl/test-e2e/Basic/half_builtins.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -166,13 +167,6 @@ template bool check(vec a, vec b) { int main() { queue q; - if (!q.get_device().has(sycl::aspect::fp16)) { - std::cout - << "Test was skipped because the selected device does not support fp16" - << std::endl; - return 0; - } - float16 a, b, c, d; for (int i = 0; i < SZ_max; i++) { a[i] = i / (float)SZ_max; diff --git a/sycl/test-e2e/Basic/half_type.cpp b/sycl/test-e2e/Basic/half_type.cpp index 004ef340ac131..033c2922b227b 100644 --- a/sycl/test-e2e/Basic/half_type.cpp +++ b/sycl/test-e2e/Basic/half_type.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -238,11 +239,6 @@ int main() { constexpr_verify_div(); device dev{default_selector_v}; - if (!dev.has(sycl::aspect::fp16)) { - std::cout << "This device doesn't support the extension cl_khr_fp16" - << std::endl; - return 0; - } std::vector vec_a(N, 5.0); std::vector vec_b(N, 2.0); diff --git a/sycl/test-e2e/Basic/image/image.cpp b/sycl/test-e2e/Basic/image/image.cpp index fa11b5bdf738a..75c0bca12a84b 100644 --- a/sycl/test-e2e/Basic/image/image.cpp +++ b/sycl/test-e2e/Basic/image/image.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: hip || gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/Basic/image/image_accessor_range.cpp b/sycl/test-e2e/Basic/image/image_accessor_range.cpp index ec78f64339682..6e28c8a6df92a 100755 --- a/sycl/test-e2e/Basic/image/image_accessor_range.cpp +++ b/sycl/test-e2e/Basic/image/image_accessor_range.cpp @@ -1,7 +1,8 @@ +// REQUIRES: aspect-image // FIXME: Investigate OS-agnostic failures // REQUIRES: TEMPORARY_DISABLED -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // CUDA does not support SYCL 1.2.1 images. // // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out diff --git a/sycl/test-e2e/Basic/image/image_accessor_readsampler.cpp b/sycl/test-e2e/Basic/image/image_accessor_readsampler.cpp index 622b4079a0153..008782cf536cc 100644 --- a/sycl/test-e2e/Basic/image/image_accessor_readsampler.cpp +++ b/sycl/test-e2e/Basic/image/image_accessor_readsampler.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: cuda || hip || (windows && level_zero) || gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: cuda || hip || (windows && level_zero) // unsupported on windows (level-zero) due to fail of Jenkins/pre-ci-windows // CUDA cannot support SYCL 1.2.1 images. // diff --git a/sycl/test-e2e/Basic/image/image_accessor_readwrite.cpp b/sycl/test-e2e/Basic/image/image_accessor_readwrite.cpp index 085d2d58242b1..58f717556f8e2 100644 --- a/sycl/test-e2e/Basic/image/image_accessor_readwrite.cpp +++ b/sycl/test-e2e/Basic/image/image_accessor_readwrite.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: cuda || hip // CUDA cannot support SYCL 1.2.1 images. // // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out diff --git a/sycl/test-e2e/Basic/image/image_accessor_readwrite_half.cpp b/sycl/test-e2e/Basic/image/image_accessor_readwrite_half.cpp index 9deec2ccb1f5d..219e1b0463e86 100644 --- a/sycl/test-e2e/Basic/image/image_accessor_readwrite_half.cpp +++ b/sycl/test-e2e/Basic/image/image_accessor_readwrite_half.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// REQUIRES: aspect-fp16, aspect-image +// UNSUPPORTED: cuda || hip // CUDA cannot support SYCL 1.2.1 images. // // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -148,11 +149,6 @@ int main() { // Checking if default selected device supports half datatype. // Same device will be selected in the write/read functions. s::device Dev{s::default_selector_v}; - if (!Dev.has(sycl::aspect::fp16)) { - std::cout << "This device doesn't support the extension cl_khr_fp16" - << std::endl; - return 0; - } // Checking only for dimension=1. // create image: char HostPtr[100]; diff --git a/sycl/test-e2e/Basic/image/image_max_size.cpp b/sycl/test-e2e/Basic/image/image_max_size.cpp index efff893bcb088..0f86b1325d1bb 100644 --- a/sycl/test-e2e/Basic/image/image_max_size.cpp +++ b/sycl/test-e2e/Basic/image/image_max_size.cpp @@ -1,8 +1,9 @@ +// REQUIRES: aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out -// UNSUPPORTED: cuda || hip || (windows && opencl && gpu) || gpu-intel-pvc +// UNSUPPORTED: cuda || hip || (windows && opencl && gpu) // CUDA does not support info::device::image3d_max_width query. // TODO: Irregular runtime fails on Windows/opencl:gpu require analysis. diff --git a/sycl/test-e2e/Basic/image/image_read.cpp b/sycl/test-e2e/Basic/image/image_read.cpp index f14c833bf32cd..63d091733c6ec 100644 --- a/sycl/test-e2e/Basic/image/image_read.cpp +++ b/sycl/test-e2e/Basic/image/image_read.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: hip || gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/Basic/image/image_read_fp16.cpp b/sycl/test-e2e/Basic/image/image_read_fp16.cpp index 9e8b258a3ad13..693d4c394184e 100644 --- a/sycl/test-e2e/Basic/image/image_read_fp16.cpp +++ b/sycl/test-e2e/Basic/image/image_read_fp16.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: hip || gpu-intel-pvc +// REQUIRES: aspect-fp16, aspect-image +// UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -6,11 +7,7 @@ #include "image_read.h" int main() { - s::queue myQueue(s::default_selector_v); - - // Device doesn't support cl_khr_fp16 extension - skip. - if (!myQueue.get_device().has(sycl::aspect::fp16)) - return 0; + s::queue myQueue; // Half image if (!test(myQueue)) diff --git a/sycl/test-e2e/Basic/image/image_sample.cpp b/sycl/test-e2e/Basic/image/image_sample.cpp index 2d1171eb3fe18..47b0e950c564b 100644 --- a/sycl/test-e2e/Basic/image/image_sample.cpp +++ b/sycl/test-e2e/Basic/image/image_sample.cpp @@ -1,8 +1,9 @@ +// REQUIRES: aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // Temporarily disable test on Windows due to regressions in GPU driver. -// UNSUPPORTED: hip, windows, gpu-intel-pvc +// UNSUPPORTED: hip, windows #include diff --git a/sycl/test-e2e/Basic/image/image_write.cpp b/sycl/test-e2e/Basic/image/image_write.cpp index 8b451fb3af94e..c3f9ed33926a9 100644 --- a/sycl/test-e2e/Basic/image/image_write.cpp +++ b/sycl/test-e2e/Basic/image/image_write.cpp @@ -1,8 +1,9 @@ +// REQUIRES: aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // TODO: re-enable on cuda device. // See https://github.com/intel/llvm/issues/1542#issuecomment-707877817 for more // details. diff --git a/sycl/test-e2e/Basic/image/image_write_fp16.cpp b/sycl/test-e2e/Basic/image/image_write_fp16.cpp index c9ca4b0febb36..41216514f26f1 100644 --- a/sycl/test-e2e/Basic/image/image_write_fp16.cpp +++ b/sycl/test-e2e/Basic/image/image_write_fp16.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: hip || cuda || gpu-intel-pvc +// REQUIRES: aspect-fp16, aspect-image +// UNSUPPORTED: hip || cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -8,10 +9,6 @@ int main() { s::queue myQueue(s::default_selector_v); - // Device doesn't support cl_khr_fp16 extension - skip. - if (!myQueue.get_device().has(sycl::aspect::fp16)) - return 0; - // Half image if (!test(myQueue)) return -1; diff --git a/sycl/test-e2e/Basic/image/srgba-read.cpp b/sycl/test-e2e/Basic/image/srgba-read.cpp index f1e4aca4fa158..04840c29b7179 100644 --- a/sycl/test-e2e/Basic/image/srgba-read.cpp +++ b/sycl/test-e2e/Basic/image/srgba-read.cpp @@ -1,10 +1,8 @@ +// REQUIRES: aspect-ext_oneapi_srgb, aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER // RUN: %GPU_RUN_PLACEHOLDER %t.out %GPU_CHECK_PLACEHOLDER -// Only opencl plugin has implemented the supoort. -// REQUIRES: opencl - #include #include @@ -92,30 +90,20 @@ int main() { queue Q; device D = Q.get_device(); - // test aspect - if (D.has(aspect::ext_oneapi_srgb)) - std::cout << "aspect::ext_oneapi_srgb detected" << std::endl; - - if (D.has(aspect::image)) { - // RGBA -- (normal, non-linearized) - std::cout << "rgba -------" << std::endl; - test_rd(image_channel_order::rgba, image_channel_type::unorm_int8); + // RGBA -- (normal, non-linearized) + std::cout << "rgba -------" << std::endl; + test_rd(image_channel_order::rgba, image_channel_type::unorm_int8); - // sRGBA -- (linearized reads) - std::cout << "srgba -------" << std::endl; - test_rd(image_channel_order::ext_oneapi_srgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + // sRGBA -- (linearized reads) + std::cout << "srgba -------" << std::endl; + test_rd(image_channel_order::ext_oneapi_srgba, + image_channel_type::unorm_int8); return 0; } // clang-format off // CHECK: SYCL_EXT_ONEAPI_SRGB defined -// CHECK: aspect::ext_oneapi_srgb detected - // CHECK: rgba ------- // CHECK-NEXT: read four pixels, no sampler // these next four reads should all be close to 0.5 diff --git a/sycl/test-e2e/Basic/intel-ext-device.cpp b/sycl/test-e2e/Basic/intel-ext-device.cpp index fc7633db6e196..a98e8c5cc8e2e 100644 --- a/sycl/test-e2e/Basic/intel-ext-device.cpp +++ b/sycl/test-e2e/Basic/intel-ext-device.cpp @@ -1,4 +1,5 @@ // RUN: %clangxx -fsycl %s -o %t.out +// REQUIRES: aspect-gpu // REQUIRES: level_zero || opencl // RUN: %GPU_RUN_PLACEHOLDER %t.out // @@ -39,98 +40,95 @@ int main(int argc, char **argv) { int numHWThreadsPerEU = 0; for (const auto &dev : plt.get_devices()) { std::cout << "Platform #" << pltCount++ << ":" << std::endl; - if (dev.has(aspect::gpu)) { - auto name = dev.get_info(); - std::cout << "Device #" << devCount++ << ": " - << dev.get_info() << ":" << std::endl; + auto name = dev.get_info(); + std::cout << "Device #" << devCount++ << ": " + << dev.get_info() << ":" << std::endl; - std::cout << "Backend: "; - if (plt.get_backend() == backend::ext_oneapi_level_zero) { - std::cout << "Level Zero" << std::endl; - // It's required to set the env variable to query free-memory. - setenv("ZES_ENABLE_SYSMAN", "1", 0); - } else if (plt.get_backend() == backend::opencl) { - std::cout << "OpenCL" << std::endl; - } else if (plt.get_backend() == backend::ext_oneapi_cuda) { - std::cout << "CUDA" << std::endl; - } else { - std::cout << "Unknown" << std::endl; - } + std::cout << "Backend: "; + if (plt.get_backend() == backend::ext_oneapi_level_zero) { + std::cout << "Level Zero" << std::endl; + // It's required to set the env variable to query free-memory. + setenv("ZES_ENABLE_SYSMAN", "1", 0); + } else if (plt.get_backend() == backend::opencl) { + std::cout << "OpenCL" << std::endl; + } else if (plt.get_backend() == backend::ext_oneapi_cuda) { + std::cout << "CUDA" << std::endl; + } else { + std::cout << "Unknown" << std::endl; + } - // Use Feature Test macro to see if extensions are supported. - if (SYCL_EXT_INTEL_DEVICE_INFO >= 1) { + // Use Feature Test macro to see if extensions are supported. + if (SYCL_EXT_INTEL_DEVICE_INFO >= 1) { - if (dev.has(aspect::ext_intel_pci_address)) { - std::cout << "PCI address = " - << dev.get_info() - << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_eu_count)) { - totalEUs = dev.get_info(); - std::cout << "Number of EUs = " << totalEUs << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_eu_simd_width)) { - int w = dev.get_info(); - std::cout << "EU SIMD width = " << w << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_slices)) { - numSlices = dev.get_info(); - std::cout << "Number of slices = " << numSlices << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_subslices_per_slice)) { - numSubslices = dev.get_info< - ext::intel::info::device::gpu_subslices_per_slice>(); - std::cout << "Number of subslices per slice = " << numSubslices - << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_eu_count_per_subslice)) { - numEUsPerSubslice = dev.get_info< - ext::intel::info::device::gpu_eu_count_per_subslice>(); - std::cout << "Number of EUs per subslice = " << numEUsPerSubslice - << std::endl; - } - if (SYCL_EXT_INTEL_DEVICE_INFO >= 3 && - dev.has(aspect::ext_intel_gpu_hw_threads_per_eu)) { - numHWThreadsPerEU = - dev.get_info(); - std::cout << "Number of HW threads per EU = " << numHWThreadsPerEU - << std::endl; - } - if (dev.has(aspect::ext_intel_max_mem_bandwidth)) { - // not supported yet - long m = - dev.get_info(); - std::cout << "Maximum memory bandwidth = " << m << std::endl; - } - // This is the only data we can verify. - if (totalEUs != numSlices * numSubslices * numEUsPerSubslice) { - std::cout << "Error: EU Count is incorrect!" << std::endl; - std::cout << "Failed!" << std::endl; - return 1; - } - if (dev.has(aspect::ext_intel_free_memory)) { - auto TotalMemory = dev.get_info(); - auto FreeMemory = - dev.get_info(); - assert((TotalMemory >= FreeMemory) && - "Expect total_memory >= free_memory"); - } - if (SYCL_EXT_INTEL_DEVICE_INFO >= 2 && - dev.has(aspect::ext_intel_device_info_uuid)) { - auto UUID = dev.get_info(); - std::cout << "Device UUID = "; - for (int i = 0; i < 16; i++) { - std::cout << std::to_string(UUID[i]); - } - std::cout << "\n"; - } - if (SYCL_EXT_INTEL_DEVICE_INFO >= 5 && - dev.has(aspect::ext_intel_device_id)) { - int deviceID = dev.get_info(); - std::cout << "Device ID = " << deviceID << std::endl; + if (dev.has(aspect::ext_intel_pci_address)) { + std::cout << "PCI address = " + << dev.get_info() + << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_eu_count)) { + totalEUs = dev.get_info(); + std::cout << "Number of EUs = " << totalEUs << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_eu_simd_width)) { + int w = dev.get_info(); + std::cout << "EU SIMD width = " << w << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_slices)) { + numSlices = dev.get_info(); + std::cout << "Number of slices = " << numSlices << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_subslices_per_slice)) { + numSubslices = + dev.get_info(); + std::cout << "Number of subslices per slice = " << numSubslices + << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_eu_count_per_subslice)) { + numEUsPerSubslice = dev.get_info< + ext::intel::info::device::gpu_eu_count_per_subslice>(); + std::cout << "Number of EUs per subslice = " << numEUsPerSubslice + << std::endl; + } + if (SYCL_EXT_INTEL_DEVICE_INFO >= 3 && + dev.has(aspect::ext_intel_gpu_hw_threads_per_eu)) { + numHWThreadsPerEU = + dev.get_info(); + std::cout << "Number of HW threads per EU = " << numHWThreadsPerEU + << std::endl; + } + if (dev.has(aspect::ext_intel_max_mem_bandwidth)) { + // not supported yet + long m = dev.get_info(); + std::cout << "Maximum memory bandwidth = " << m << std::endl; + } + // This is the only data we can verify. + if (totalEUs != numSlices * numSubslices * numEUsPerSubslice) { + std::cout << "Error: EU Count is incorrect!" << std::endl; + std::cout << "Failed!" << std::endl; + return 1; + } + if (dev.has(aspect::ext_intel_free_memory)) { + auto TotalMemory = dev.get_info(); + auto FreeMemory = + dev.get_info(); + assert((TotalMemory >= FreeMemory) && + "Expect total_memory >= free_memory"); + } + if (SYCL_EXT_INTEL_DEVICE_INFO >= 2 && + dev.has(aspect::ext_intel_device_info_uuid)) { + auto UUID = dev.get_info(); + std::cout << "Device UUID = "; + for (int i = 0; i < 16; i++) { + std::cout << std::to_string(UUID[i]); } - } // SYCL_EXT_INTEL_DEVICE_INFO - } + std::cout << "\n"; + } + if (SYCL_EXT_INTEL_DEVICE_INFO >= 5 && + dev.has(aspect::ext_intel_device_id)) { + int deviceID = dev.get_info(); + std::cout << "Device ID = " << deviceID << std::endl; + } + } // SYCL_EXT_INTEL_DEVICE_INFO std::cout << std::endl; } } diff --git a/sycl/test-e2e/DeprecatedFeatures/deprecated_intel_ext_device.cpp b/sycl/test-e2e/DeprecatedFeatures/deprecated_intel_ext_device.cpp index c7b412fb39338..30e188cc11704 100644 --- a/sycl/test-e2e/DeprecatedFeatures/deprecated_intel_ext_device.cpp +++ b/sycl/test-e2e/DeprecatedFeatures/deprecated_intel_ext_device.cpp @@ -44,73 +44,71 @@ int main(int argc, char **argv) { int numHWThreadsPerEU = 0; for (const auto &dev : plt.get_devices()) { std::cout << "Platform #" << pltCount++ << ":" << std::endl; - if (dev.has(aspect::gpu)) { - auto name = dev.get_info(); - std::cout << "Device #" << devCount++ << ": " - << dev.get_info() << ":" << std::endl; + auto name = dev.get_info(); + std::cout << "Device #" << devCount++ << ": " + << dev.get_info() << ":" << std::endl; - std::cout << "Backend: "; - if (plt.get_backend() == backend::ext_oneapi_level_zero) { - std::cout << "Level Zero" << std::endl; - } else if (plt.get_backend() == backend::opencl) { - std::cout << "OpenCL" << std::endl; - } else if (plt.get_backend() == backend::ext_oneapi_cuda) { - std::cout << "CUDA" << std::endl; - } else { - std::cout << "Unknown" << std::endl; - } + std::cout << "Backend: "; + if (plt.get_backend() == backend::ext_oneapi_level_zero) { + std::cout << "Level Zero" << std::endl; + } else if (plt.get_backend() == backend::opencl) { + std::cout << "OpenCL" << std::endl; + } else if (plt.get_backend() == backend::ext_oneapi_cuda) { + std::cout << "CUDA" << std::endl; + } else { + std::cout << "Unknown" << std::endl; + } - // Use Feature Test macro to see if extensions are supported. - if (SYCL_EXT_INTEL_DEVICE_INFO >= 1) { + // Use Feature Test macro to see if extensions are supported. + if (SYCL_EXT_INTEL_DEVICE_INFO >= 1) { - if (dev.has(aspect::ext_intel_pci_address)) { - std::cout << "PCI address = " - << dev.get_info() - << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_eu_count)) { - totalEUs = dev.get_info(); - std::cout << "Number of EUs = " << totalEUs << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_eu_simd_width)) { - int w = dev.get_info(); - std::cout << "EU SIMD width = " << w << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_slices)) { - numSlices = dev.get_info(); - std::cout << "Number of slices = " << numSlices << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_subslices_per_slice)) { - numSubslices = - dev.get_info(); - std::cout << "Number of subslices per slice = " << numSubslices - << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_eu_count_per_subslice)) { - numEUsPerSubslice = dev.get_info< - info::device::ext_intel_gpu_eu_count_per_subslice>(); - std::cout << "Number of EUs per subslice = " << numEUsPerSubslice - << std::endl; - } - if (dev.has(aspect::ext_intel_gpu_hw_threads_per_eu)) { - numHWThreadsPerEU = - dev.get_info(); - std::cout << "Number of HW threads per EU = " << numHWThreadsPerEU - << std::endl; - } - if (dev.has(aspect::ext_intel_max_mem_bandwidth)) { - // not supported yet - long m = dev.get_info(); - std::cout << "Maximum memory bandwidth = " << m << std::endl; - } - // This is the only data we can verify. - if (totalEUs != numSlices * numSubslices * numEUsPerSubslice) { - std::cout << "Error: EU Count is incorrect!" << std::endl; - std::cout << "Failed!" << std::endl; - return 1; - } - } // SYCL_EXT_INTEL_DEVICE_INFO - } + if (dev.has(aspect::ext_intel_pci_address)) { + std::cout << "PCI address = " + << dev.get_info() + << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_eu_count)) { + totalEUs = dev.get_info(); + std::cout << "Number of EUs = " << totalEUs << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_eu_simd_width)) { + int w = dev.get_info(); + std::cout << "EU SIMD width = " << w << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_slices)) { + numSlices = dev.get_info(); + std::cout << "Number of slices = " << numSlices << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_subslices_per_slice)) { + numSubslices = + dev.get_info(); + std::cout << "Number of subslices per slice = " << numSubslices + << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_eu_count_per_subslice)) { + numEUsPerSubslice = + dev.get_info(); + std::cout << "Number of EUs per subslice = " << numEUsPerSubslice + << std::endl; + } + if (dev.has(aspect::ext_intel_gpu_hw_threads_per_eu)) { + numHWThreadsPerEU = + dev.get_info(); + std::cout << "Number of HW threads per EU = " << numHWThreadsPerEU + << std::endl; + } + if (dev.has(aspect::ext_intel_max_mem_bandwidth)) { + // not supported yet + long m = dev.get_info(); + std::cout << "Maximum memory bandwidth = " << m << std::endl; + } + // This is the only data we can verify. + if (totalEUs != numSlices * numSubslices * numEUsPerSubslice) { + std::cout << "Error: EU Count is incorrect!" << std::endl; + std::cout << "Failed!" << std::endl; + return 1; + } + } // SYCL_EXT_INTEL_DEVICE_INFO std::cout << std::endl; } } diff --git a/sycl/test-e2e/DeviceLib/built-ins/ext_native_math_fp16.cpp b/sycl/test-e2e/DeviceLib/built-ins/ext_native_math_fp16.cpp index 74bd0f82132e9..8e25e86188597 100644 --- a/sycl/test-e2e/DeviceLib/built-ins/ext_native_math_fp16.cpp +++ b/sycl/test-e2e/DeviceLib/built-ins/ext_native_math_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-device-code-split=per_kernel %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -15,12 +16,6 @@ int main() { sycl::queue q; - if (!q.get_device().has(sycl::aspect::fp16)) { - std::cout << "skipping fp16 tests: requires fp16 device aspect." - << std::endl; - return 0; - } - const sycl::half tv[16] = {-2.0, -1.5, -1.0, 0.0, 2.0, 1.5, 1.0, 0.0, -1.7, 1.7, -1.2, 1.2, -3.0, 3.0, -10.0, 10.0}; const sycl::half tl[16] = {-0.97, -0.91, -0.77, -0.1, 0.95, 0.89, diff --git a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp index e435d8def5b3b..96705c88834bf 100644 --- a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out @@ -162,9 +163,7 @@ template void device_cmath_test(s::queue &deviceQueue) { int main() { s::queue deviceQueue; - if (deviceQueue.get_device().has(sycl::aspect::fp64)) { - device_cmath_test(deviceQueue); - std::cout << "Pass" << std::endl; - } + device_cmath_test(deviceQueue); + std::cout << "Pass" << std::endl; return 0; } diff --git a/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp index 4971409795f48..21d3b723bc646 100644 --- a/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -19,11 +20,6 @@ int main() { << device_queue.get_device().get_info() << "\n"; - if (!device_queue.get_device().has(sycl::aspect::fp64)) { - std::cout << "Test skipped on platform without fp64 support." << std::endl; - return 0; - } - { std::initializer_list input_vals = { __builtin_bit_cast(double, 0ULL), // 0 diff --git a/sycl/test-e2e/DeviceLib/imf_double2half.cpp b/sycl/test-e2e/DeviceLib/imf_double2half.cpp index 24b3a2271debe..6c1c18bacd385 100644 --- a/sycl/test-e2e/DeviceLib/imf_double2half.cpp +++ b/sycl/test-e2e/DeviceLib/imf_double2half.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64, aspect-fp16 // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -19,16 +20,6 @@ int main() { << device_queue.get_device().get_info() << "\n"; - if (!device_queue.get_device().has(sycl::aspect::fp64)) { - std::cout << "Test skipped on platform without fp64 support." << std::endl; - return 0; - } - - if (!device_queue.get_device().has(sycl::aspect::fp16)) { - std::cout << "Test skipped on platform without fp16 support." << std::endl; - return 0; - } - { std::initializer_list input_vals = { 0, // 0 diff --git a/sycl/test-e2e/DeviceLib/imf_fp16_trivial_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp16_trivial_test.cpp index aa7dba627b694..c8afe49f5a1ee 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp16_trivial_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp16_trivial_test.cpp @@ -1,5 +1,5 @@ +// REQUIRES: aspect-fp16 // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} - // RUN: %clangxx -fsycl %{mathflags} %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -16,11 +16,6 @@ int main(int, char **) { << device_queue.get_device().get_info() << "\n"; - if (!device_queue.get_device().has(sycl::aspect::fp16)) { - std::cout << "Test skipped on platform without fp16 support." << std::endl; - return 0; - } - { std::initializer_list input_vals1 = {0.5f, -1.125f, 100.5f, 0.f, 0.125f, 0.25f}; diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp index 7be6a29c127ea..805a7e68c8c1c 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out @@ -60,11 +61,6 @@ int main(int, char **) { std::cout << "Running on " << device_queue.get_device().get_info() << "\n"; - if (!device_queue.get_device().has(sycl::aspect::fp64)) { - std::cout << "Test skipped on platform without fp64 support." << std::endl; - return 0; - } - { std::initializer_list input_vals = {0.0, 2.5, diff --git a/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp b/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp index 9254bd42b988c..e61b76b756ae4 100644 --- a/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp +++ b/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -70,11 +71,6 @@ int main() { << device_queue.get_device().get_info() << "\n"; - if (!device_queue.get_device().has(sycl::aspect::fp16)) { - std::cout << "Test skipped on platform without fp16 support." << std::endl; - return 0; - } - // half2int tests { std::initializer_list input_vals = { diff --git a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp index 8f55710f8f8c3..1fcf81389446f 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -165,9 +166,7 @@ void device_math_test(s::queue &deviceQueue) { int main() { s::queue deviceQueue; - if (deviceQueue.get_device().has(sycl::aspect::fp64)) { - device_math_test(deviceQueue); - std::cout << "Pass" << std::endl; - } + device_math_test(deviceQueue); + std::cout << "Pass" << std::endl; return 0; } diff --git a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp index dd82ede2e4075..e9e5640c72ed8 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp @@ -1,6 +1,7 @@ // UNSUPPORTED: windows // Disabled on windows due to bug VS 2019 missing math builtins +// REQUIRES: aspect-fp64 // REQUIRES: (cpu || accelerator) && windows // RUN: %clangxx -fsycl -c %s -o %t.o // RUN: %clangxx -fsycl %t.o %sycl_libs_dir/../bin/libsycl-cmath-fp64.o -o %t.out @@ -125,9 +126,7 @@ void device_math_test(s::queue &deviceQueue) { int main() { s::queue deviceQueue; - if (deviceQueue.get_device().has(sycl::aspect::fp64)) { - device_math_test(deviceQueue); - std::cout << "Pass" << std::endl; - } + device_math_test(deviceQueue); + std::cout << "Pass" << std::endl; return 0; } diff --git a/sycl/test-e2e/DeviceLib/math_test_marray_vec_fp16.cpp b/sycl/test-e2e/DeviceLib/math_test_marray_vec_fp16.cpp index 7db7350ece12f..8bf84c6192c64 100644 --- a/sycl/test-e2e/DeviceLib/math_test_marray_vec_fp16.cpp +++ b/sycl/test-e2e/DeviceLib/math_test_marray_vec_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -11,11 +12,6 @@ int main() { queue deviceQueue; - if (!deviceQueue.get_device().has(sycl::aspect::fp16)) { - std::cout << "skipping fp16 tests: requires fp16 device aspect." - << std::endl; - return 0; - } math_tests_4(deviceQueue); math_tests_4>(deviceQueue); math_tests_3(deviceQueue); diff --git a/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp index 4080d3aa1860f..a48f44a71be31 100644 --- a/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out @@ -198,8 +199,6 @@ void device_complex_test(s::queue &deviceQueue) { int main() { s::queue deviceQueue; - if (deviceQueue.get_device().has(sycl::aspect::fp64)) { - device_complex_test(deviceQueue); - std::cout << "Pass" << std::endl; - } + device_complex_test(deviceQueue); + std::cout << "Pass" << std::endl; } diff --git a/sycl/test-e2e/DiscardEvents/discard_events_check_images.cpp b/sycl/test-e2e/DiscardEvents/discard_events_check_images.cpp index fc9c09de4d2d1..a9ffe1109a7c5 100644 --- a/sycl/test-e2e/DiscardEvents/discard_events_check_images.cpp +++ b/sycl/test-e2e/DiscardEvents/discard_events_check_images.cpp @@ -1,4 +1,5 @@ // UNSUPPORTED: hip +// REQUIRES: aspect-image // // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // @@ -175,18 +176,14 @@ int main(int Argc, const char *Argv[]) { sycl::queue Q(props); auto dev = Q.get_device(); - if (dev.has(aspect::image)) { - if (TestType == "image") { - std::cerr << "RunTest_ImageTest" << std::endl; - RunTest_ImageTest(Q); - } else if (TestType == "mixed") { - std::cerr << "RunTest_ImageTest_Mixed" << std::endl; - RunTest_ImageTest_Mixed(Q); - } else { - assert(0 && "Unsupported test type!"); - } + if (TestType == "image") { + std::cerr << "RunTest_ImageTest" << std::endl; + RunTest_ImageTest(Q); + } else if (TestType == "mixed") { + std::cerr << "RunTest_ImageTest_Mixed" << std::endl; + RunTest_ImageTest_Mixed(Q); } else { - std::cout << "device does not support image operations" << std::endl; + assert(0 && "Unsupported test type!"); } std::cout << "The test passed." << std::endl; diff --git a/sycl/test-e2e/ESIMD/histogram.cpp b/sycl/test-e2e/ESIMD/histogram.cpp index 0931d41f5ae91..e3b3d3e89592d 100644 --- a/sycl/test-e2e/ESIMD/histogram.cpp +++ b/sycl/test-e2e/ESIMD/histogram.cpp @@ -6,8 +6,9 @@ // //===----------------------------------------------------------------------===// // REQUIRES: gpu +// REQUIRES: aspect-image // UNSUPPORTED: gpu-intel-gen9 && windows -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/ESIMD/histogram_2d.cpp b/sycl/test-e2e/ESIMD/histogram_2d.cpp index 4c5c30fb9d836..aac12a6a31aed 100644 --- a/sycl/test-e2e/ESIMD/histogram_2d.cpp +++ b/sycl/test-e2e/ESIMD/histogram_2d.cpp @@ -5,9 +5,10 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES: aspect-image // REQUIRES: gpu // UNSUPPORTED: gpu-intel-gen9 && windows -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/ESIMD/histogram_2d_64.cpp b/sycl/test-e2e/ESIMD/histogram_2d_64.cpp index 466ce330b0c35..dda5bcd56798f 100644 --- a/sycl/test-e2e/ESIMD/histogram_2d_64.cpp +++ b/sycl/test-e2e/ESIMD/histogram_2d_64.cpp @@ -6,8 +6,9 @@ // //===----------------------------------------------------------------------===// // REQUIRES: gpu +// REQUIRES: aspect-image // UNSUPPORTED: gpu-intel-gen9 && windows -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // diff --git a/sycl/test-e2e/ESIMD/histogram_64.cpp b/sycl/test-e2e/ESIMD/histogram_64.cpp index 0202a041c1533..a659711ee86ae 100644 --- a/sycl/test-e2e/ESIMD/histogram_64.cpp +++ b/sycl/test-e2e/ESIMD/histogram_64.cpp @@ -5,9 +5,10 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// +// REQUIRES: aspect-image // REQUIRES: gpu // UNSUPPORTED: gpu-intel-gen9 && windows -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // diff --git a/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot.cpp b/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot.cpp index b0cb18407253c..f964fb5bf1868 100644 --- a/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot.cpp +++ b/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot.cpp @@ -7,8 +7,9 @@ //===----------------------------------------------------------------------===// // REQUIRES: gpu +// REQUIRES: aspect-image // UNSUPPORTED: gpu-intel-gen9 && windows -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -I%S/.. -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out %T/output.ppm %S/golden_hw.ppm diff --git a/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot_spec.cpp b/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot_spec.cpp index 534b46074797f..e6243a0fa04c2 100644 --- a/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot_spec.cpp +++ b/sycl/test-e2e/ESIMD/mandelbrot/mandelbrot_spec.cpp @@ -8,7 +8,8 @@ // TODO enable on Windows // REQUIRES: linux && gpu -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: cuda || hip // TODO online_compiler check fails for esimd_emulator // XFAIL: esimd_emulator // RUN: %clangxx -fsycl %s -I%S/.. -o %t.out diff --git a/sycl/test-e2e/ESIMD/matrix_transpose2.cpp b/sycl/test-e2e/ESIMD/matrix_transpose2.cpp index 48c17ded78be0..58d0d91122046 100644 --- a/sycl/test-e2e/ESIMD/matrix_transpose2.cpp +++ b/sycl/test-e2e/ESIMD/matrix_transpose2.cpp @@ -7,7 +7,8 @@ //===----------------------------------------------------------------------===// // FIXME: Investigate Windows-specific failures // REQUIRES: TEMPORARY_DISABLED -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: cuda || hip // TODO: esimd_emulator fails due to outdated __esimd_media_ld // XFAIL: esimd_emulator // RUN: %clangxx -fsycl %s -o %t.out diff --git a/sycl/test-e2e/ESIMD/regression/dgetrf_8x8.cpp b/sycl/test-e2e/ESIMD/regression/dgetrf_8x8.cpp index 183341b4504ca..431f01510d1ef 100644 --- a/sycl/test-e2e/ESIMD/regression/dgetrf_8x8.cpp +++ b/sycl/test-e2e/ESIMD/regression/dgetrf_8x8.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// REQUIRES: gpu +// REQUIRES: gpu, aspect-fp64 // UNSUPPORTED: gpu-intel-gen9 && windows // UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -I%S/.. -o %t.out @@ -270,9 +270,6 @@ static int dgetrfnp_batch_strided_check(int64_t m, int64_t n, double *a_in, int main(int argc, char *argv[]) { queue queue((gpu_selector())); - if (!queue.get_device().has(aspect::fp64)) - return 0; - int exit_status = 0; constexpr int64_t m = 8, n = 8, lda = 8; int64_t stride_a = lda * n, stride_ipiv = n; diff --git a/sycl/test-e2e/ESIMD/spec_const/Inputs/spec-const-2020-common.hpp b/sycl/test-e2e/ESIMD/spec_const/Inputs/spec-const-2020-common.hpp index 8c15561771913..1bf7c796fc226 100644 --- a/sycl/test-e2e/ESIMD/spec_const/Inputs/spec-const-2020-common.hpp +++ b/sycl/test-e2e/ESIMD/spec_const/Inputs/spec-const-2020-common.hpp @@ -39,8 +39,6 @@ int main(int argc, char **argv) { queue q(esimd_test::ESIMDSelector, esimd_test::createExceptionHandler()); auto dev = q.get_device(); - if (std::is_same_v && !dev.has(aspect::fp64)) - return 0; std::cout << "Running on " << dev.get_info() << "\n"; std::vector etalon = {DEF_VAL, REDEF_VAL}; diff --git a/sycl/test-e2e/ESIMD/spec_const/spec_const_double.cpp b/sycl/test-e2e/ESIMD/spec_const/spec_const_double.cpp index 96a0fc1bd736d..19940f50b4105 100644 --- a/sycl/test-e2e/ESIMD/spec_const/spec_const_double.cpp +++ b/sycl/test-e2e/ESIMD/spec_const/spec_const_double.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// REQUIRES: gpu +// REQUIRES: gpu, aspect-fp64 // UNSUPPORTED: gpu-intel-gen9 && windows // RUN: %clangxx -fsycl -I%S/.. %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/ESIMD/vadd_2d.cpp b/sycl/test-e2e/ESIMD/vadd_2d.cpp index 30982fe88372c..38a477f18d56b 100644 --- a/sycl/test-e2e/ESIMD/vadd_2d.cpp +++ b/sycl/test-e2e/ESIMD/vadd_2d.cpp @@ -6,8 +6,9 @@ // //===----------------------------------------------------------------------===// // REQUIRES: gpu +// REQUIRES: aspect-image // UNSUPPORTED: gpu-intel-gen9 && windows -// UNSUPPORTED: cuda || hip || gpu-intel-pvc +// UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/ESIMD/vadd_half.cpp b/sycl/test-e2e/ESIMD/vadd_half.cpp index ecdb42513a916..2a4034a7b7c69 100644 --- a/sycl/test-e2e/ESIMD/vadd_half.cpp +++ b/sycl/test-e2e/ESIMD/vadd_half.cpp @@ -6,7 +6,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// REQUIRES: gpu +// REQUIRES: gpu, aspect-fp16 // UNSUPPORTED: gpu-intel-gen9 && windows // UNSUPPORTED: cuda || hip // RUN: %clangxx -fsycl %s -o %t.out @@ -60,13 +60,6 @@ int main(int argc, char **argv) { auto dev = q.get_device(); std::cout << "Running on " << dev.get_info() << "\n"; - if (!dev.has(sycl::aspect::fp16)) { - std::cout << "Test was skipped becasue the selected device does not " - "support sycl::aspect::fp16" - << std::endl; - return 0; - } - TstT *A = malloc_shared(Size, q); SrcT *B = malloc_shared(Size, q); using DstT = __ESIMD_DNS::computation_type_t; diff --git a/sycl/test-e2e/GroupAlgorithm/barrier.cpp b/sycl/test-e2e/GroupAlgorithm/barrier.cpp index 32bda789cc097..1c6f3bbcad125 100644 --- a/sycl/test-e2e/GroupAlgorithm/barrier.cpp +++ b/sycl/test-e2e/GroupAlgorithm/barrier.cpp @@ -5,6 +5,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_80 // RUN: %GPU_RUN_PLACEHOLDER %t.out +// REQUIRES: aspect-ext_oneapi_cuda_async_barrier // REQUIRES: cuda #include "CL/sycl.hpp" @@ -145,11 +146,6 @@ void interface() { int main() { queue q; - if (!q.get_device().has(aspect::ext_oneapi_cuda_async_barrier)) { - std::cout << "Barrier is not supported by the device. Skipping test." - << std::endl; - return 0; - } basic(); interface(); diff --git a/sycl/test-e2e/KernelFusion/event_wait_cancel.cpp b/sycl/test-e2e/KernelFusion/event_wait_cancel.cpp index 63a049aaa1ba4..1f4771d7d5b0d 100644 --- a/sycl/test-e2e/KernelFusion/event_wait_cancel.cpp +++ b/sycl/test-e2e/KernelFusion/event_wait_cancel.cpp @@ -2,7 +2,7 @@ // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // UNSUPPORTED: cuda || hip -// REQUIRES: fusion +// REQUIRES: fusion, aspect-usm_shared_allocations // Test validity of events after cancel_fusion. @@ -17,10 +17,6 @@ int main() { queue q{ext::codeplay::experimental::property::queue::enable_fusion{}}; - if (!q.get_device().has(sycl::aspect::usm_shared_allocations)) { - return 0; - } - int *in1 = sycl::malloc_shared(dataSize, q); int *in2 = sycl::malloc_shared(dataSize, q); int *in3 = sycl::malloc_shared(dataSize, q); diff --git a/sycl/test-e2e/KernelFusion/event_wait_complete.cpp b/sycl/test-e2e/KernelFusion/event_wait_complete.cpp index e0ab53bf566dd..cf48a9c1ced43 100644 --- a/sycl/test-e2e/KernelFusion/event_wait_complete.cpp +++ b/sycl/test-e2e/KernelFusion/event_wait_complete.cpp @@ -2,7 +2,7 @@ // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // UNSUPPORTED: cuda || hip -// REQUIRES: fusion +// REQUIRES: fusion, aspect-usm_shared_allocations // Test validity of events after complete_fusion. @@ -17,10 +17,6 @@ int main() { queue q{ext::codeplay::experimental::property::queue::enable_fusion{}}; - if (!q.get_device().has(sycl::aspect::usm_shared_allocations)) { - return 0; - } - int *in1 = sycl::malloc_shared(dataSize, q); int *in2 = sycl::malloc_shared(dataSize, q); int *in3 = sycl::malloc_shared(dataSize, q); diff --git a/sycl/test-e2e/KernelFusion/internal_explicit_dependency.cpp b/sycl/test-e2e/KernelFusion/internal_explicit_dependency.cpp index b30082788c9cb..22e3f5ba2b34d 100644 --- a/sycl/test-e2e/KernelFusion/internal_explicit_dependency.cpp +++ b/sycl/test-e2e/KernelFusion/internal_explicit_dependency.cpp @@ -2,7 +2,7 @@ // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // UNSUPPORTED: cuda || hip -// REQUIRES: fusion +// REQUIRES: fusion, aspect-usm_shared_allocations // Test complete fusion where one kernel in the fusion list specifies an // explicit dependency (via events) on another kernel in the fusion list. @@ -18,10 +18,6 @@ int main() { queue q{ext::codeplay::experimental::property::queue::enable_fusion{}}; - if (!q.get_device().has(sycl::aspect::usm_shared_allocations)) { - return 0; - } - int *in1 = sycl::malloc_shared(dataSize, q); int *in2 = sycl::malloc_shared(dataSize, q); int *in3 = sycl::malloc_shared(dataSize, q); diff --git a/sycl/test-e2e/KernelFusion/usm_no_dependencies.cpp b/sycl/test-e2e/KernelFusion/usm_no_dependencies.cpp index 2f18f758bad76..13290d06e25f1 100644 --- a/sycl/test-e2e/KernelFusion/usm_no_dependencies.cpp +++ b/sycl/test-e2e/KernelFusion/usm_no_dependencies.cpp @@ -2,7 +2,7 @@ // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // UNSUPPORTED: cuda || hip -// REQUIRES: fusion +// REQUIRES: fusion, aspect-usm_shared_allocations // Test complete fusion using USM pointers. @@ -15,10 +15,6 @@ int main() { queue q{ext::codeplay::experimental::property::queue::enable_fusion{}}; - if (!q.get_device().has(sycl::aspect::usm_shared_allocations)) { - return 0; - } - int *in1 = sycl::malloc_shared(dataSize, q); int *in2 = sycl::malloc_shared(dataSize, q); int *in3 = sycl::malloc_shared(dataSize, q); diff --git a/sycl/test-e2e/KernelFusion/wrapped_usm.cpp b/sycl/test-e2e/KernelFusion/wrapped_usm.cpp index 8532a9dadfab8..aa112ca064ec0 100644 --- a/sycl/test-e2e/KernelFusion/wrapped_usm.cpp +++ b/sycl/test-e2e/KernelFusion/wrapped_usm.cpp @@ -2,7 +2,7 @@ // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // UNSUPPORTED: cuda || hip -// REQUIRES: fusion +// REQUIRES: fusion, aspect-usm_shared_allocations // Test complete fusion using an wrapped USM pointer as kernel functor argument. @@ -25,10 +25,6 @@ int main() { queue q{ext::codeplay::experimental::property::queue::enable_fusion{}}; - if (!q.get_device().has(sycl::aspect::usm_shared_allocations)) { - return 0; - } - wrapper in1{dataSize, q}; wrapper in2{dataSize, q}; wrapper in3{dataSize, q}; diff --git a/sycl/test-e2e/Plugin/enqueue-arg-order-image.cpp b/sycl/test-e2e/Plugin/enqueue-arg-order-image.cpp index 6975f4aab1902..ced90d9e6a72b 100644 --- a/sycl/test-e2e/Plugin/enqueue-arg-order-image.cpp +++ b/sycl/test-e2e/Plugin/enqueue-arg-order-image.cpp @@ -1,4 +1,5 @@ -// UNSUPPORTED: hip, gpu-intel-pvc +// REQUIRES: aspect-image +// UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // Native images are created with host pointers only with host unified memory // support, enforce it for this test. diff --git a/sycl/test-e2e/Plugin/interop-level-zero-interop-task-mem-image.cpp b/sycl/test-e2e/Plugin/interop-level-zero-interop-task-mem-image.cpp index 0348536f0e645..85e327c0281b4 100644 --- a/sycl/test-e2e/Plugin/interop-level-zero-interop-task-mem-image.cpp +++ b/sycl/test-e2e/Plugin/interop-level-zero-interop-task-mem-image.cpp @@ -1,5 +1,5 @@ +// REQUIRES: aspect-image // REQUIRES: level_zero, level_zero_dev_kit -// UNSUPPORTED: gpu-intel-pvc // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test-e2e/Plugin/level_zero_device_free_mem.cpp b/sycl/test-e2e/Plugin/level_zero_device_free_mem.cpp index 66b7970f538cb..1dfbfd75a426a 100644 --- a/sycl/test-e2e/Plugin/level_zero_device_free_mem.cpp +++ b/sycl/test-e2e/Plugin/level_zero_device_free_mem.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-ext_intel_free_memory // REQUIRES: level_zero, level_zero_dev_kit // UNSUPPORTED: gpu-intel-gen9, gpu-intel-gen12 // The query of free memory is not supported on integrated devices @@ -20,42 +21,35 @@ int main() { auto dev = Queue.get_device(); std::cout << "Device: " << dev.get_info() << std::endl; - if (!dev.is_host() && dev.has(aspect::ext_intel_free_memory)) { - auto TotalMemory = dev.get_info(); - auto FreeMemory = dev.get_info(); - std::cout << "Root-device total memory: " << TotalMemory << std::endl; - std::cout << "Root-device free memory: " << FreeMemory << std::endl; - assert(TotalMemory >= FreeMemory); - - try { // guard for when no partitioning is supported - - auto sub_devices = dev.create_sub_devices< - info::partition_property::partition_by_affinity_domain>( - info::partition_affinity_domain::next_partitionable); - - int I = 0; - for (auto &sub_device : sub_devices) { - ++I; - auto SubDeviceTotalMemory = - sub_device.get_info(); - auto SubDeviceFreeMemory = - sub_device.get_info(); - std::cout << I << " sub-device total memory: " << SubDeviceTotalMemory - << std::endl; - std::cout << I << " sub-device free memory: " << SubDeviceFreeMemory - << std::endl; - assert(SubDeviceFreeMemory <= FreeMemory); - assert(SubDeviceTotalMemory >= SubDeviceFreeMemory); - assert(SubDeviceTotalMemory <= TotalMemory); - } - - } catch (...) { + auto TotalMemory = dev.get_info(); + auto FreeMemory = dev.get_info(); + std::cout << "Root-device total memory: " << TotalMemory << std::endl; + std::cout << "Root-device free memory: " << FreeMemory << std::endl; + assert(TotalMemory >= FreeMemory); + + try { // guard for when no partitioning is supported + + auto sub_devices = dev.create_sub_devices< + info::partition_property::partition_by_affinity_domain>( + info::partition_affinity_domain::next_partitionable); + + int I = 0; + for (auto &sub_device : sub_devices) { + ++I; + auto SubDeviceTotalMemory = + sub_device.get_info(); + auto SubDeviceFreeMemory = + sub_device.get_info(); + std::cout << I << " sub-device total memory: " << SubDeviceTotalMemory + << std::endl; + std::cout << I << " sub-device free memory: " << SubDeviceFreeMemory + << std::endl; + assert(SubDeviceFreeMemory <= FreeMemory); + assert(SubDeviceTotalMemory >= SubDeviceFreeMemory); + assert(SubDeviceTotalMemory <= TotalMemory); } - } else { - std::cout - << "Query ext_intel_device_info_free_memory not supported by the device" - << std::endl; + } catch (...) { } return 0; diff --git a/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp b/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp index ff6c9a4bffa68..8f41ee1e5d021 100644 --- a/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp +++ b/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-ext_intel_device_id // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out // RUN: env ZEX_NUMBER_OF_CCS=0:4 env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out > %t.default.log 2>&1 @@ -53,8 +54,6 @@ void test_pvc(device &d) { std::cout << "Test PVC Begin" << std::endl; // CHECK-PVC: Test PVC Begin bool IsPVC = [&]() { - if (!d.has(aspect::ext_intel_device_id)) - return false; return (d.get_info() & 0xff0) == 0xbd0; }(); std::cout << "IsPVC: " << std::boolalpha << IsPVC << std::endl; @@ -156,8 +155,6 @@ void test_pvc(device &d) { void test_non_pvc(device d) { bool IsPVC = [&]() { - if (!d.has(aspect::ext_intel_device_id)) - return false; return (d.get_info() & 0xff0) == 0xbd0; }(); diff --git a/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp b/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp index f1a8593db4f1a..94eaf9120ea58 100644 --- a/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp +++ b/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-ext_intel_device_id // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out // RUN: env ZEX_NUMBER_OF_CCS=0:4 env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out > %t.log 2>&1 // RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --check-prefixes=CHECK-PVC < %t.log @@ -16,8 +17,6 @@ void test_pvc(device &d) { std::cout << "Test PVC Begin" << std::endl; // CHECK-PVC: Test PVC Begin bool IsPVC = [&]() { - if (!d.has(aspect::ext_intel_device_id)) - return false; return (d.get_info() & 0xff0) == 0xbd0; }(); std::cout << "IsPVC: " << std::boolalpha << IsPVC << std::endl; diff --git a/sycl/test-e2e/Plugin/level_zero_inorder.cpp b/sycl/test-e2e/Plugin/level_zero_inorder.cpp index 64248fbe9467c..0c2386994c1da 100644 --- a/sycl/test-e2e/Plugin/level_zero_inorder.cpp +++ b/sycl/test-e2e/Plugin/level_zero_inorder.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-usm_shared_allocations // REQUIRES: level_zero // // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -78,11 +79,8 @@ void IfTrueIncrementByValue(sycl::queue Q, sycl::range<1> Range, int *Harray, void RunCalculation(sycl::queue Q) { sycl::range<1> Range(buffer_size); - auto Dev = Q.get_device(); - if (!Dev.has(sycl::aspect::usm_shared_allocations)) - return; - int *values = sycl::malloc(buffer_size, Dev, Q.get_context(), AllocType); + int *values = sycl::malloc(buffer_size, Q, AllocType); try { Q.submit([&](sycl::handler &cgh) { diff --git a/sycl/test-e2e/Plugin/level_zero_inorder_interleaving_kernel_copy.cpp b/sycl/test-e2e/Plugin/level_zero_inorder_interleaving_kernel_copy.cpp index 8b138a495cf65..5f76645d6fb05 100644 --- a/sycl/test-e2e/Plugin/level_zero_inorder_interleaving_kernel_copy.cpp +++ b/sycl/test-e2e/Plugin/level_zero_inorder_interleaving_kernel_copy.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-usm_device_allocations // REQUIRES: level_zero // // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -67,14 +68,9 @@ void ValidationPrint(const std::string &vectName, const std::vector &vect, void RunCalculation(sycl::queue Q) { sycl::range<1> Range(buffer_size); - auto Dev = Q.get_device(); - if (!Dev.has(sycl::aspect::usm_device_allocations)) - return; - - int *Dvalues = - sycl::malloc(buffer_size, Dev, Q.get_context(), AllocType); - int *DvaluesTmp = - sycl::malloc(buffer_size, Dev, Q.get_context(), AllocType); + + int *Dvalues = sycl::malloc(buffer_size, Q, AllocType); + int *DvaluesTmp = sycl::malloc(buffer_size, Q, AllocType); std::vector Hvalues1(buffer_size, 0); std::vector HvaluesTmp(buffer_size, 0); diff --git a/sycl/test-e2e/Plugin/level_zero_uuid.cpp b/sycl/test-e2e/Plugin/level_zero_uuid.cpp index 90fa7a5b9b1a0..6ff3367b26aca 100644 --- a/sycl/test-e2e/Plugin/level_zero_uuid.cpp +++ b/sycl/test-e2e/Plugin/level_zero_uuid.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-ext_intel_device_info_uuid // REQUIRES: gpu, level_zero, level_zero_dev_kit // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out @@ -14,28 +15,25 @@ int main() { sycl::device dev; - if (dev.has(sycl::aspect::ext_intel_device_info_uuid)) { - auto uuid = dev.get_info(); - std::stringstream uuid_sycl; - for (int i = 0; i < uuid.size(); ++i) - uuid_sycl << std::hex << std::setw(2) << std::setfill('0') - << int(uuid[i]); - std::cout << "SYCL: " << uuid_sycl.str() << std::endl; + auto uuid = dev.get_info(); + std::stringstream uuid_sycl; + for (int i = 0; i < uuid.size(); ++i) + uuid_sycl << std::hex << std::setw(2) << std::setfill('0') << int(uuid[i]); + std::cout << "SYCL: " << uuid_sycl.str() << std::endl; - auto zedev = sycl::get_native(dev); - ze_device_properties_t device_properties{}; - zeDeviceGetProperties(zedev, &device_properties); - std::stringstream uuid_l0; - for (int i = 0; i < ZE_MAX_DEVICE_UUID_SIZE; ++i) - uuid_l0 << std::hex << std::setw(2) << std::setfill('0') - << int(device_properties.uuid.id[i]); - std::cout << "L0 : " << uuid_l0.str() << std::endl; + auto zedev = sycl::get_native(dev); + ze_device_properties_t device_properties{}; + zeDeviceGetProperties(zedev, &device_properties); + std::stringstream uuid_l0; + for (int i = 0; i < ZE_MAX_DEVICE_UUID_SIZE; ++i) + uuid_l0 << std::hex << std::setw(2) << std::setfill('0') + << int(device_properties.uuid.id[i]); + std::cout << "L0 : " << uuid_l0.str() << std::endl; - if (uuid_sycl.str() != uuid_l0.str()) { - std::cout << "FAILED" << std::endl; - return -1; - } - std::cout << "PASSED" << std::endl; + if (uuid_sycl.str() != uuid_l0.str()) { + std::cout << "FAILED" << std::endl; + return -1; } + std::cout << "PASSED" << std::endl; return 0; } diff --git a/sycl/test-e2e/Printf/double.cpp b/sycl/test-e2e/Printf/double.cpp index 2bdffac9d30f0..cd191dfdd202b 100644 --- a/sycl/test-e2e/Printf/double.cpp +++ b/sycl/test-e2e/Printf/double.cpp @@ -4,6 +4,7 @@ // The test is written using conversion specifiers table from cppreference [1] // [1]: https://en.cppreference.com/w/cpp/io/c/fprintf // +// REQUIRES: aspect-fp64 // Temporarily disable test on Windows due to regressions in GPU driver. // UNSUPPORTED: hip_amd, windows // @@ -68,20 +69,10 @@ class DoubleTest; int main() { queue q; - if (q.get_device().has(aspect::fp64)) { - q.submit([](handler &cgh) { - cgh.single_task([]() { do_double_test(); }); - }); - q.wait(); - } else - std::cout << "Skipping the actual test. " - "Printing hard-coded output from the host side:\n" - << "double -6.813800e+00, -6.813800E+00\n" - "mixed 3.140000e+00, -6.813800E+00\n" - "double -0x1.b4154d8cccccdp+2, -0X1.B4154D8CCCCCDP+2\n" - "mixed 0x1.91eb86p+1, -0X1.B4154D8CCCCCDP+2\n" - "double -6.8138, -6.8138\n" - "mixed 3.14, -6.8138" - << std::endl; + q.submit([](handler &cgh) { + cgh.single_task([]() { do_double_test(); }); + }); + q.wait(); + return 0; } diff --git a/sycl/test-e2e/Regression/fp16-with-unnamed-lambda.cpp b/sycl/test-e2e/Regression/fp16-with-unnamed-lambda.cpp index 3e061278097ec..20212fced51fa 100644 --- a/sycl/test-e2e/Regression/fp16-with-unnamed-lambda.cpp +++ b/sycl/test-e2e/Regression/fp16-with-unnamed-lambda.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -20,8 +21,6 @@ int main() { sycl::queue Q(AsyncHandler); sycl::device D = Q.get_device(); - if (!D.has(sycl::aspect::fp16)) - return 0; // Skip the test if halfs are not supported sycl::buffer Buf(1); diff --git a/sycl/test-e2e/Regression/image_access.cpp b/sycl/test-e2e/Regression/image_access.cpp index 0e26300f56d1b..6dce293f61827 100644 --- a/sycl/test-e2e/Regression/image_access.cpp +++ b/sycl/test-e2e/Regression/image_access.cpp @@ -1,10 +1,10 @@ +// REQUIRES: aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER // RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER // No execution of FPGA because it does not support images // -// PVC doesn't support images. -// UNSUPPORTED: hip, gpu-intel-pvc +// UNSUPPORTED: hip // CUDA doesn't fully support OpenCL spec conform images. //==-------------- image_access.cpp - SYCL image accessors test -----------==// diff --git a/sycl/test-e2e/Regression/reduction_64bit_atomic64.cpp b/sycl/test-e2e/Regression/reduction_64bit_atomic64.cpp index ecc86f6a980a9..9909c3dabad2f 100644 --- a/sycl/test-e2e/Regression/reduction_64bit_atomic64.cpp +++ b/sycl/test-e2e/Regression/reduction_64bit_atomic64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-atomic64 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -20,13 +21,6 @@ using namespace sycl; int main() { queue Q; - if (Q.get_device().has(aspect::atomic64)) { - std::cout << "Device supports aspect::atomic64 so we do not need to run " - "the test." - << std::endl; - return 0; - } - long long *Out = malloc_shared(1, Q); // Case 1: nd_range reduction with 64-bit integer and either sycl::plus, diff --git a/sycl/test-e2e/Sampler/basic-rw-float.cpp b/sycl/test-e2e/Sampler/basic-rw-float.cpp index 55f31e8c71251..c22ec7df90810 100644 --- a/sycl/test-e2e/Sampler/basic-rw-float.cpp +++ b/sycl/test-e2e/Sampler/basic-rw-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -82,24 +83,19 @@ void test_rw(image_channel_order ChanOrder, image_channel_type ChanType) { int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_rw(image_channel_order::rgba, image_channel_type::fp32); - - // CUDA, strangely, does not support 8-bit channels. Turning this off for - // now. - // std::cout << "unorm_int8 -------" << std::endl; - // test_rw(image_channel_order::rgba, image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_rw(image_channel_order::rgba, image_channel_type::fp32); + + // CUDA, strangely, does not support 8-bit channels. Turning this off for + // now. + // std::cout << "unorm_int8 -------" << std::endl; + // test_rw(image_channel_order::rgba, image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/basic-rw.cpp b/sycl/test-e2e/Sampler/basic-rw.cpp index 2f800b0fc71f6..59eae4cfe6632 100644 --- a/sycl/test-e2e/Sampler/basic-rw.cpp +++ b/sycl/test-e2e/Sampler/basic-rw.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -98,17 +99,13 @@ int main() { queue Q; device D = Q.get_device(); - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_rw(image_channel_order::rgba, image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_rw(image_channel_order::rgba, image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-clamp-linear-float.cpp b/sycl/test-e2e/Sampler/normalized-clamp-linear-float.cpp index 83b09de93e9c7..7dc21c0ba7080 100644 --- a/sycl/test-e2e/Sampler/normalized-clamp-linear-float.cpp +++ b/sycl/test-e2e/Sampler/normalized-clamp-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -144,24 +145,19 @@ void test_normalized_clamp_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_normalized_clamp_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_normalized_clamp_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_normalized_clamp_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_normalized_clamp_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-clamp-nearest.cpp b/sycl/test-e2e/Sampler/normalized-clamp-nearest.cpp index 58141abfd501c..413b57efd8504 100644 --- a/sycl/test-e2e/Sampler/normalized-clamp-nearest.cpp +++ b/sycl/test-e2e/Sampler/normalized-clamp-nearest.cpp @@ -1,11 +1,9 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out -// LevelZero has a bug wherein it always returns the first pixel value. -// Will re-enable once fixed. - /* This file sets up an image, initializes it with data, and verifies that the data is sampled correctly with a @@ -125,20 +123,15 @@ void test_normalized_clamp_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_normalized_clamp_nearest_sampler(image_channel_order::rgba, - image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_normalized_clamp_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-clampedge-linear-float.cpp b/sycl/test-e2e/Sampler/normalized-clampedge-linear-float.cpp index be752f0748d05..ed00243e4a514 100644 --- a/sycl/test-e2e/Sampler/normalized-clampedge-linear-float.cpp +++ b/sycl/test-e2e/Sampler/normalized-clampedge-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -133,24 +134,19 @@ void test_normalized_clampedge_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_normalized_clampedge_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_normalized_clampedge_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_normalized_clampedge_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_normalized_clampedge_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-clampedge-nearest.cpp b/sycl/test-e2e/Sampler/normalized-clampedge-nearest.cpp index 06ad8a0353411..2d573925af9be 100644 --- a/sycl/test-e2e/Sampler/normalized-clampedge-nearest.cpp +++ b/sycl/test-e2e/Sampler/normalized-clampedge-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -127,20 +128,15 @@ void test_normalized_clampedge_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_normalized_clampedge_nearest_sampler( - image_channel_order::rgba, image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_normalized_clampedge_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-mirror-linear-float.cpp b/sycl/test-e2e/Sampler/normalized-mirror-linear-float.cpp index 01de013bede12..95c9105d10194 100644 --- a/sycl/test-e2e/Sampler/normalized-mirror-linear-float.cpp +++ b/sycl/test-e2e/Sampler/normalized-mirror-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -151,24 +152,19 @@ void test_normalized_mirrored_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_normalized_mirrored_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_normalized_mirrored_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_normalized_mirrored_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_normalized_mirrored_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-mirror-nearest.cpp b/sycl/test-e2e/Sampler/normalized-mirror-nearest.cpp index 471697dfb2148..04e4f9159c77e 100644 --- a/sycl/test-e2e/Sampler/normalized-mirror-nearest.cpp +++ b/sycl/test-e2e/Sampler/normalized-mirror-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -149,20 +150,14 @@ void test_normalized_mirrored_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_normalized_mirrored_nearest_sampler( - image_channel_order::rgba, image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_normalized_mirrored_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-none-linear-float.cpp b/sycl/test-e2e/Sampler/normalized-none-linear-float.cpp index 205fbd906e0fb..e7344d6145321 100644 --- a/sycl/test-e2e/Sampler/normalized-none-linear-float.cpp +++ b/sycl/test-e2e/Sampler/normalized-none-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -133,24 +134,18 @@ void test_normalized_none_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_normalized_none_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_normalized_none_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_normalized_none_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_normalized_none_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-none-nearest.cpp b/sycl/test-e2e/Sampler/normalized-none-nearest.cpp index ddefd4b8282c5..ae331aba75ea3 100644 --- a/sycl/test-e2e/Sampler/normalized-none-nearest.cpp +++ b/sycl/test-e2e/Sampler/normalized-none-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -144,20 +145,15 @@ void test_normalized_none_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_normalized_none_nearest_sampler(image_channel_order::rgba, - image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_normalized_none_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-repeat-linear-float.cpp b/sycl/test-e2e/Sampler/normalized-repeat-linear-float.cpp index c9f92a1632341..49b7a4522e2c6 100644 --- a/sycl/test-e2e/Sampler/normalized-repeat-linear-float.cpp +++ b/sycl/test-e2e/Sampler/normalized-repeat-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -151,25 +152,20 @@ void test_normalized_repeat_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - - std::cout << "fp32 -------------" << std::endl; - test_normalized_repeat_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_normalized_repeat_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + + std::cout << "fp32 -------------" << std::endl; + test_normalized_repeat_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_normalized_repeat_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/normalized-repeat-nearest.cpp b/sycl/test-e2e/Sampler/normalized-repeat-nearest.cpp index 528b54e3f9474..c13e5bee425dc 100644 --- a/sycl/test-e2e/Sampler/normalized-repeat-nearest.cpp +++ b/sycl/test-e2e/Sampler/normalized-repeat-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -147,20 +148,15 @@ void test_normalized_repeat_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_normalized_repeat_nearest_sampler(image_channel_order::rgba, - image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_normalized_repeat_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/unnormalized-clamp-linear-float.cpp b/sycl/test-e2e/Sampler/unnormalized-clamp-linear-float.cpp index 17701b4395977..785259a930a4d 100644 --- a/sycl/test-e2e/Sampler/unnormalized-clamp-linear-float.cpp +++ b/sycl/test-e2e/Sampler/unnormalized-clamp-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -127,24 +128,19 @@ void test_unnormalized_clamp_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_unnormalized_clamp_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_unnormalized_clamp_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_unnormalized_clamp_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_unnormalized_clamp_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/unnormalized-clamp-nearest.cpp b/sycl/test-e2e/Sampler/unnormalized-clamp-nearest.cpp index cb8821fb15bc4..e4a7c4fa0f57d 100644 --- a/sycl/test-e2e/Sampler/unnormalized-clamp-nearest.cpp +++ b/sycl/test-e2e/Sampler/unnormalized-clamp-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -100,20 +101,15 @@ void test_unnormalized_clamp_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_unnormalized_clamp_nearest_sampler(image_channel_order::rgba, - image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_unnormalized_clamp_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/unnormalized-clampedge-linear-float.cpp b/sycl/test-e2e/Sampler/unnormalized-clampedge-linear-float.cpp index 92e24804d9a78..455876b8f5289 100644 --- a/sycl/test-e2e/Sampler/unnormalized-clampedge-linear-float.cpp +++ b/sycl/test-e2e/Sampler/unnormalized-clampedge-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -127,25 +128,19 @@ void test_unnormalized_clampedge_linear_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). - std::cout << "fp32 -------------" << std::endl; - test_unnormalized_clampedge_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); + std::cout << "fp32 -------------" << std::endl; + test_unnormalized_clampedge_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); - std::cout << "unorm_int8 -------" << std::endl; - test_unnormalized_clampedge_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - - } else { - std::cout << "device does not support image operations" << std::endl; - } + std::cout << "unorm_int8 -------" << std::endl; + test_unnormalized_clampedge_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/unnormalized-clampedge-nearest.cpp b/sycl/test-e2e/Sampler/unnormalized-clampedge-nearest.cpp index e06e90f1023d0..c7890149ff055 100644 --- a/sycl/test-e2e/Sampler/unnormalized-clampedge-nearest.cpp +++ b/sycl/test-e2e/Sampler/unnormalized-clampedge-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -103,20 +104,15 @@ void test_unnormalized_clampedge_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_unnormalized_clampedge_nearest_sampler( - image_channel_order::rgba, image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_unnormalized_clampedge_nearest_sampler( + image_channel_order::rgba, image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/Sampler/unnormalized-none-linear-float.cpp b/sycl/test-e2e/Sampler/unnormalized-none-linear-float.cpp index 7388eb11f3764..1bd237df065a1 100644 --- a/sycl/test-e2e/Sampler/unnormalized-none-linear-float.cpp +++ b/sycl/test-e2e/Sampler/unnormalized-none-linear-float.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip, cuda // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -174,22 +175,18 @@ int main() { queue Q; device D = Q.get_device(); - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - - std::cout << "fp32 -------------" << std::endl; - test_unnormalized_none_linear_sampler(image_channel_order::rgba, - image_channel_type::fp32); - - std::cout << "unorm_int8 -------" << std::endl; - test_unnormalized_none_linear_sampler(image_channel_order::rgba, - image_channel_type::unorm_int8); - } else { - std::cout << "device does not support image operations" << std::endl; - } + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + + std::cout << "fp32 -------------" << std::endl; + test_unnormalized_none_linear_sampler(image_channel_order::rgba, + image_channel_type::fp32); + + std::cout << "unorm_int8 -------" << std::endl; + test_unnormalized_none_linear_sampler(image_channel_order::rgba, + image_channel_type::unorm_int8); return 0; } diff --git a/sycl/test-e2e/Sampler/unnormalized-none-nearest.cpp b/sycl/test-e2e/Sampler/unnormalized-none-nearest.cpp index b635032fff95a..887bb01c06d3a 100644 --- a/sycl/test-e2e/Sampler/unnormalized-none-nearest.cpp +++ b/sycl/test-e2e/Sampler/unnormalized-none-nearest.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-image // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out @@ -96,20 +97,15 @@ void test_unnormalized_none_nearest_sampler(image_channel_order ChanOrder, int main() { queue Q; - device D = Q.get_device(); - - if (D.has(aspect::image)) { - // the _int8 channels are one byte per channel, or four bytes per pixel (for - // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes - // per pixel (for RGBA) the _int32/fp32 channels are four bytes per - // channel, or sixteen bytes per pixel (for RGBA). - // CUDA has limited support for image_channel_type, so the tests use - // unsigned_int32 - test_unnormalized_none_nearest_sampler(image_channel_order::rgba, - image_channel_type::unsigned_int32); - } else { - std::cout << "device does not support image operations" << std::endl; - } + + // the _int8 channels are one byte per channel, or four bytes per pixel (for + // RGBA) the _int16/fp16 channels are two bytes per channel, or eight bytes + // per pixel (for RGBA) the _int32/fp32 channels are four bytes per + // channel, or sixteen bytes per pixel (for RGBA). + // CUDA has limited support for image_channel_type, so the tests use + // unsigned_int32 + test_unnormalized_none_nearest_sampler(image_channel_order::rgba, + image_channel_type::unsigned_int32); return 0; } diff --git a/sycl/test-e2e/SubGroup/broadcast_fp16.cpp b/sycl/test-e2e/SubGroup/broadcast_fp16.cpp index 4e2a35f660f87..710976a66d489 100644 --- a/sycl/test-e2e/SubGroup/broadcast_fp16.cpp +++ b/sycl/test-e2e/SubGroup/broadcast_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -13,12 +14,7 @@ int main() { queue Queue; - if (Queue.get_device().has(sycl::aspect::fp16)) { - check(Queue); - std::cout << "Test passed." << std::endl; - } else { - std::cout << "Test skipped because device doesn't support aspect::fp16" - << std::endl; - } + check(Queue); + std::cout << "Test passed." << std::endl; return 0; } diff --git a/sycl/test-e2e/SubGroup/broadcast_fp64.cpp b/sycl/test-e2e/SubGroup/broadcast_fp64.cpp index a7762706904a7..4a4e5f4ba4e42 100644 --- a/sycl/test-e2e/SubGroup/broadcast_fp64.cpp +++ b/sycl/test-e2e/SubGroup/broadcast_fp64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -15,12 +16,7 @@ int main() { queue Queue; - if (Queue.get_device().has(sycl::aspect::fp64)) { - check(Queue); - std::cout << "Test passed." << std::endl; - } else { - std::cout << "Test skipped because device doesn't support aspect::fp64" - << std::endl; - } + check(Queue); + std::cout << "Test passed." << std::endl; return 0; } diff --git a/sycl/test-e2e/SubGroup/reduce_fp16.cpp b/sycl/test-e2e/SubGroup/reduce_fp16.cpp index 9c1193791f50a..0b6a370d28f82 100644 --- a/sycl/test-e2e/SubGroup/reduce_fp16.cpp +++ b/sycl/test-e2e/SubGroup/reduce_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // @@ -10,8 +11,7 @@ int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp16)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/reduce_fp64.cpp b/sycl/test-e2e/SubGroup/reduce_fp64.cpp index 523ff2550cd70..f8b2e135c9d6d 100644 --- a/sycl/test-e2e/SubGroup/reduce_fp64.cpp +++ b/sycl/test-e2e/SubGroup/reduce_fp64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -9,8 +10,7 @@ int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp64)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/reduce_spirv13_fp16.cpp b/sycl/test-e2e/SubGroup/reduce_spirv13_fp16.cpp index 7cedd8af5da26..03d7131083ff7 100644 --- a/sycl/test-e2e/SubGroup/reduce_spirv13_fp16.cpp +++ b/sycl/test-e2e/SubGroup/reduce_spirv13_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -10,8 +11,7 @@ int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp16)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/reduce_spirv13_fp64.cpp b/sycl/test-e2e/SubGroup/reduce_spirv13_fp64.cpp index 9d1f75e2de42c..349ce3ba5795f 100644 --- a/sycl/test-e2e/SubGroup/reduce_spirv13_fp64.cpp +++ b/sycl/test-e2e/SubGroup/reduce_spirv13_fp64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -12,8 +13,7 @@ #include int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp64)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/scan_fp16.cpp b/sycl/test-e2e/SubGroup/scan_fp16.cpp index e5d4956a83767..5d56fdbdb7bee 100644 --- a/sycl/test-e2e/SubGroup/scan_fp16.cpp +++ b/sycl/test-e2e/SubGroup/scan_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // @@ -12,8 +13,7 @@ #include int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp16)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/scan_fp64.cpp b/sycl/test-e2e/SubGroup/scan_fp64.cpp index 328334c222ad8..2a61b1f8f876a 100644 --- a/sycl/test-e2e/SubGroup/scan_fp64.cpp +++ b/sycl/test-e2e/SubGroup/scan_fp64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -10,8 +11,7 @@ #include int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp64)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/scan_spirv13_fp16.cpp b/sycl/test-e2e/SubGroup/scan_spirv13_fp16.cpp index 334d43f85c3b3..5db8102830140 100644 --- a/sycl/test-e2e/SubGroup/scan_spirv13_fp16.cpp +++ b/sycl/test-e2e/SubGroup/scan_spirv13_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -11,8 +12,7 @@ int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp16)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/scan_spirv13_fp64.cpp b/sycl/test-e2e/SubGroup/scan_spirv13_fp64.cpp index ee521e51dbaef..579cc926cd1e7 100644 --- a/sycl/test-e2e/SubGroup/scan_spirv13_fp64.cpp +++ b/sycl/test-e2e/SubGroup/scan_spirv13_fp64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // UNSUPPORTED: hip // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out @@ -13,8 +14,7 @@ int main() { queue Queue; - if (!core_sg_supported(Queue.get_device()) || - !Queue.get_device().has(sycl::aspect::fp64)) { + if (!core_sg_supported(Queue.get_device())) { std::cout << "Skipping test\n"; return 0; } diff --git a/sycl/test-e2e/SubGroup/shuffle_fp16.cpp b/sycl/test-e2e/SubGroup/shuffle_fp16.cpp index 4fa766b93a140..1a0f48a345112 100644 --- a/sycl/test-e2e/SubGroup/shuffle_fp16.cpp +++ b/sycl/test-e2e/SubGroup/shuffle_fp16.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp16 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // @@ -22,16 +23,11 @@ int main() { queue Queue; - if (Queue.get_device().has(sycl::aspect::fp16)) { - check(Queue); - check(Queue); - check(Queue); - check(Queue); - check(Queue); - std::cout << "Test passed." << std::endl; - } else { - std::cout << "Test skipped because device doesn't support aspect::fp16" - << std::endl; - } + check(Queue); + check(Queue); + check(Queue); + check(Queue); + check(Queue); + std::cout << "Test passed." << std::endl; return 0; } diff --git a/sycl/test-e2e/SubGroup/shuffle_fp64.cpp b/sycl/test-e2e/SubGroup/shuffle_fp64.cpp index a0aa02b116d5e..636d15eb14f10 100644 --- a/sycl/test-e2e/SubGroup/shuffle_fp64.cpp +++ b/sycl/test-e2e/SubGroup/shuffle_fp64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-fp64 // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -16,16 +17,11 @@ int main() { queue Queue; - if (Queue.get_device().has(sycl::aspect::fp64)) { - check(Queue); - check(Queue); - check(Queue); - check(Queue); - check(Queue); - std::cout << "Test passed." << std::endl; - } else { - std::cout << "Test skipped because device doesn't support aspect::fp64" - << std::endl; - } + check(Queue); + check(Queue); + check(Queue); + check(Queue); + check(Queue); + std::cout << "Test passed." << std::endl; return 0; } diff --git a/sycl/test-e2e/Tracing/image_printers.cpp b/sycl/test-e2e/Tracing/image_printers.cpp index 076ff5c6c545e..029440741b008 100644 --- a/sycl/test-e2e/Tracing/image_printers.cpp +++ b/sycl/test-e2e/Tracing/image_printers.cpp @@ -1,9 +1,10 @@ +// REQUIRES: aspect-image // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // // Unsupported hip call on AMD -// UNSUPPORTED: hip_amd, gpu-intel-pvc +// UNSUPPORTED: hip_amd // Test image-specific printers of the Plugin Interace // diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index daa229453e9be..07df3307f08b8 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -187,6 +187,42 @@ else: config.substitutions.append( ('%cuda_options', '') ) +# The code below is slightly more complex than currently necessary because of +# the plans to allow running the same tests on multiple backends in a single +# llvm-lit invocation. +sycl_dev_aspects = [] +for be in [config.sycl_be]: + for device in config.target_devices.split(','): + cmd = ('env ONEAPI_DEVICE_SELECTOR={}:{} sycl-ls --verbose'.format(be, device)) + sp = subprocess.run(cmd, env=llvm_config.config.environment, + shell=True, capture_output=True, text=True) + if sp.returncode != 0: + lit_config.error('Cannot list device aspects for {}:{}\nstdout:\n{}\nstderr:\n'.format( + be, device, sp.stdout, sp.stderr)) + + dev_aspects = [] + for line in sp.stdout.split('\n'): + if not re.search(r'^ *Aspects *:', line): + continue + _, aspects_str = line.split(':', 1) + dev_aspects.append(aspects_str.strip().split(' ')) + + if dev_aspects == []: + lit_config.error('Cannot detect device aspect for {}:{}\nstdout:\n{}\nstderr:\n'.format( + be, device, sp.stdout, sp.stderr)) + sycl_dev_aspects.append(set()) + continue + + # We might have several devices matching the same filter in the system. + # Compute intersection of aspects. + result = set(dev_aspects[0]).intersection(*dev_aspects) + sycl_dev_aspects.append(result) + +resulting_aspects = sycl_dev_aspects[0].intersection(*sycl_dev_aspects) +lit_config.note('Aspects: {}'.format(' '.join(resulting_aspects))) +for aspect in resulting_aspects: + config.available_features.add('aspect-{}'.format(aspect)) + # Check for OpenCL ICD if config.opencl_libs_dir: if cl_options: