From f42b6b86d59f009fc13912083f481393fcb9c761 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Mon, 4 Nov 2024 07:14:21 -0800 Subject: [PATCH 01/14] [SYCL] [E2E] fix reenabled tests --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 11 +++++------ .../is_compatible/is_compatible_several_targets.cpp | 11 +++++------ sycl/test-e2e/lit.cfg.py | 1 + 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index fd6503772d356..1c9d805799c95 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,4 +1,4 @@ -// XFAIL: any-device-is-opencl, any-device-is-cuda, any-device-is-level_zero, gpu-intel-dg2, hip_amd +// XFAIL: any-device-is-opencl, any-device-is-cuda, any-device-is-level_zero // XFAIL-TRACKER: https://github.com/intel/llvm/issues/15819 // RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %} // RUN: %if any-device-is-level_zero %{ %{build} -DBUILD_FOR_L0 -o %t-l0.out %} @@ -12,7 +12,6 @@ using namespace sycl; #ifdef BUILD_FOR_CUDA -#include constexpr auto BACKEND = backend::ext_oneapi_cuda; using nativeDevice = CUdevice; using nativeQueue = CUstream; @@ -20,9 +19,9 @@ using nativeEvent = CUevent; #elif defined(BUILD_FOR_HIP) #include constexpr auto BACKEND = backend::ext_oneapi_hip; -using nativeDevice = hipDevice_t; -using nativeQueue = hipStream_t; -using nativeEvent = hipEvent_t; +using nativeDevice = device; +using nativeQueue = ihipStream_t; +using nativeEvent = ihipEvent_t; #elif defined(BUILD_FOR_L0) constexpr auto BACKEND = backend::ext_oneapi_level_zero; using nativeDevice = ze_device_handle_t; @@ -30,7 +29,7 @@ using nativeQueue = ze_command_queue_handle_t; using nativeEvent = ze_event_handle_t; #else constexpr auto BACKEND = backend::opencl; -using nativeDevice = cl_device; +using nativeDevice = cl_device_id; using nativeQueue = cl_command_queue; using nativeEvent = cl_event; #endif diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp index 042874b90290c..db246a1cdd445 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp @@ -1,8 +1,7 @@ -// REQUIRES: ocloc, level_zero, gpu, cpu +// REQUIRES: ocloc, any-device-is-level_zero, any-device-is-gpu, any-device-is-cpu -// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga,spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:fpga %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} %t.out +// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run-unfiltered-devices} not %t.out +// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run-unfiltered-devices} %t.out +// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run-unfiltered-devices} %t.out \ No newline at end of file diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index ee91220fd3be3..92a27bb83cf09 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -78,6 +78,7 @@ "CL_CONFIG_DEVICES", "SYCL_DEVICE_ALLOWLIST", "SYCL_CONFIG_FILE_NAME", + "OCL_ICD_VENDORS", ] ) From e9df52d098bafaebb74df17ffe5821805a08f23b Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Tue, 12 Nov 2024 02:07:21 -0800 Subject: [PATCH 02/14] [SYCL] do not test zero level backend with other backends --- sycl/include/sycl/backend.hpp | 21 ++++- .../interop/Interop_level_zero_backend.cpp | 85 +++++++++++++++++++ .../Basic/interop/interop_all_backends.cpp | 11 +-- 3 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index 24750732b08ff..ea4f0f5896eac 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -350,9 +350,18 @@ make_queue(const typename backend_traits::template input_type const context &TargetContext, const async_handler Handler = {}) { auto KeepOwnership = Backend == backend::ext_oneapi_cuda || Backend == backend::ext_oneapi_hip; - return detail::make_queue(detail::ur::cast(BackendObject), + if constexpr (Backend == backend::ext_oneapi_level_zero) + { + return detail::make_queue(detail::ur::cast(std::get(BackendObject.NativeHandle)), false, TargetContext, nullptr, KeepOwnership, {}, Handler, Backend); + } + if constexpr (Backend != backend::ext_oneapi_level_zero) + { + return detail::make_queue(detail::ur::cast(BackendObject), + false, TargetContext, nullptr, KeepOwnership, {}, + Handler, Backend); + } } template @@ -361,8 +370,16 @@ std::enable_if_t::MakeEvent == true, make_event(const typename backend_traits::template input_type &BackendObject, const context &TargetContext) { - return detail::make_event(detail::ur::cast(BackendObject), + if constexpr (Backend == backend::ext_oneapi_level_zero) + { + return detail::make_event(detail::ur::cast(BackendObject.NativeHandle), TargetContext, Backend); + } + if constexpr (Backend != backend::ext_oneapi_level_zero) + { + return detail::make_event(detail::ur::cast(BackendObject), + TargetContext, Backend); + } } template diff --git a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp new file mode 100644 index 0000000000000..95502afdea70e --- /dev/null +++ b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp @@ -0,0 +1,85 @@ +// RUN: %if any-device-is-level_zero %{ %{build} -isystem %sycl_include -DBUILD_FOR_L0 -o %t-l0.out %} + +#include +#include +#include +#include +using namespace sycl; + +constexpr auto BACKEND = backend::ext_oneapi_level_zero; +using nativeDevice = ze_device_handle_t; +using nativeQueue = ze_command_queue_handle_t; +using nativeEvent = ze_event_handle_t; + +constexpr int N = 100; +constexpr int VAL = 3; + +int main() { + + assert(static_cast( + std::is_same_v::return_type, + nativeDevice>)); + assert(static_cast( + std::is_same_v::return_type, + nativeQueue>)); + assert(static_cast( + std::is_same_v::return_type, + nativeEvent>)); + + device Device; + backend_traits::return_type NativeDevice = + get_native(Device); + // Create sycl device with a native device. + auto InteropDevice = make_device(NativeDevice); + + context Context(InteropDevice); + + // Create sycl queue with device created from a native device. + queue Queue(InteropDevice, {sycl::property::queue::in_order()}); + backend_traits::return_type NativeQueue = + get_native(Queue); + backend_traits::input_type InputType(NativeQueue, Device); + + auto InteropQueue = make_queue(InputType, Context); + + auto A = (int *)malloc_device(N * sizeof(int), InteropQueue); + std::vector vec(N, 0); + + auto Event = Queue.submit([&](handler &h) { + h.parallel_for(range<1>(N), + [=](id<1> item) { A[item] = VAL; }); + }); + + backend_traits::return_type NativeEvent = + get_native(Event); + backend_traits::input_type EventInputType; + EventInputType.NativeHandle = NativeEvent; + // Create sycl event with a native event. + event InteropEvent = make_event(EventInputType, Context); + + // depends_on sycl event created from a native event. + auto Event2 = InteropQueue.submit([&](handler &h) { + h.depends_on(InteropEvent); + h.parallel_for(range<1>(N), [=](id<1> item) { A[item]++; }); + }); + + auto Event3 = InteropQueue.memcpy(&vec[0], A, N * sizeof(int), Event2); + Event3.wait(); + + if constexpr (BACKEND == backend::ext_oneapi_hip) { + try { + backend_traits::return_type NativeContext = + get_native(Context); + } catch (sycl::exception &e) { + assert(e.code() == sycl::errc::feature_not_supported); + } + } + + free(A, InteropQueue); + + for (const auto &val : vec) { + assert(val == VAL + 1); + } + + return 0; +} diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 1c9d805799c95..14266459a7754 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,8 +1,5 @@ -// XFAIL: any-device-is-opencl, any-device-is-cuda, any-device-is-level_zero -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15819 // RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %} -// RUN: %if any-device-is-level_zero %{ %{build} -DBUILD_FOR_L0 -o %t-l0.out %} -// RUN: %if any-device-is-cuda %{ %{build} -DBUILD_FOR_CUDA -o %t-cuda.out %} +// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -o %t-cuda.out %} // RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %} #include @@ -12,6 +9,7 @@ using namespace sycl; #ifdef BUILD_FOR_CUDA +#include constexpr auto BACKEND = backend::ext_oneapi_cuda; using nativeDevice = CUdevice; using nativeQueue = CUstream; @@ -22,11 +20,6 @@ constexpr auto BACKEND = backend::ext_oneapi_hip; using nativeDevice = device; using nativeQueue = ihipStream_t; using nativeEvent = ihipEvent_t; -#elif defined(BUILD_FOR_L0) -constexpr auto BACKEND = backend::ext_oneapi_level_zero; -using nativeDevice = ze_device_handle_t; -using nativeQueue = ze_command_queue_handle_t; -using nativeEvent = ze_event_handle_t; #else constexpr auto BACKEND = backend::opencl; using nativeDevice = cl_device_id; From 6c55155f886701f76dbedbc6d7e16b6ae4f08db8 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Tue, 12 Nov 2024 02:35:14 -0800 Subject: [PATCH 03/14] [SYCL] fix firmatting --- sycl/include/sycl/backend.hpp | 43 +++++++++---------- .../interop/Interop_level_zero_backend.cpp | 4 +- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index ea4f0f5896eac..7fc3b7d5b0ba6 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -350,18 +350,17 @@ make_queue(const typename backend_traits::template input_type const context &TargetContext, const async_handler Handler = {}) { auto KeepOwnership = Backend == backend::ext_oneapi_cuda || Backend == backend::ext_oneapi_hip; - if constexpr (Backend == backend::ext_oneapi_level_zero) - { - return detail::make_queue(detail::ur::cast(std::get(BackendObject.NativeHandle)), - false, TargetContext, nullptr, KeepOwnership, {}, - Handler, Backend); - } - if constexpr (Backend != backend::ext_oneapi_level_zero) - { - return detail::make_queue(detail::ur::cast(BackendObject), - false, TargetContext, nullptr, KeepOwnership, {}, - Handler, Backend); - } + if constexpr (Backend == backend::ext_oneapi_level_zero) { + return detail::make_queue( + detail::ur::cast( + std::get(BackendObject.NativeHandle)), + false, TargetContext, nullptr, KeepOwnership, {}, Handler, Backend); + } + if constexpr (Backend != backend::ext_oneapi_level_zero) { + return detail::make_queue( + detail::ur::cast(BackendObject), false, + TargetContext, nullptr, KeepOwnership, {}, Handler, Backend); + } } template @@ -370,16 +369,16 @@ std::enable_if_t::MakeEvent == true, make_event(const typename backend_traits::template input_type &BackendObject, const context &TargetContext) { - if constexpr (Backend == backend::ext_oneapi_level_zero) - { - return detail::make_event(detail::ur::cast(BackendObject.NativeHandle), - TargetContext, Backend); - } - if constexpr (Backend != backend::ext_oneapi_level_zero) - { - return detail::make_event(detail::ur::cast(BackendObject), - TargetContext, Backend); - } + if constexpr (Backend == backend::ext_oneapi_level_zero) { + return detail::make_event( + detail::ur::cast(BackendObject.NativeHandle), + TargetContext, Backend); + } + if constexpr (Backend != backend::ext_oneapi_level_zero) { + return detail::make_event( + detail::ur::cast(BackendObject), TargetContext, + Backend); + } } template diff --git a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp index 95502afdea70e..bc417a5077769 100644 --- a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp +++ b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp @@ -39,7 +39,7 @@ int main() { backend_traits::return_type NativeQueue = get_native(Queue); backend_traits::input_type InputType(NativeQueue, Device); - + auto InteropQueue = make_queue(InputType, Context); auto A = (int *)malloc_device(N * sizeof(int), InteropQueue); @@ -69,7 +69,7 @@ int main() { if constexpr (BACKEND == backend::ext_oneapi_hip) { try { backend_traits::return_type NativeContext = - get_native(Context); + get_native(Context); } catch (sycl::exception &e) { assert(e.code() == sycl::errc::feature_not_supported); } From ef0c989516d62529872d4c1db547537a001b6e9d Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Tue, 12 Nov 2024 04:03:24 -0800 Subject: [PATCH 04/14] [SYCL] remove unnecessary include for cuda build --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 14266459a7754..41cc102cf9811 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -9,7 +9,6 @@ using namespace sycl; #ifdef BUILD_FOR_CUDA -#include constexpr auto BACKEND = backend::ext_oneapi_cuda; using nativeDevice = CUdevice; using nativeQueue = CUstream; From fe763c31fc114570928a1692baa2e1c4ea067f2b Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Tue, 12 Nov 2024 05:40:14 -0800 Subject: [PATCH 05/14] [SYCL] fix include issue --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 41cc102cf9811..168fc6a6892aa 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -2,13 +2,13 @@ // RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -o %t-cuda.out %} // RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %} -#include #include #include #include using namespace sycl; #ifdef BUILD_FOR_CUDA +#include constexpr auto BACKEND = backend::ext_oneapi_cuda; using nativeDevice = CUdevice; using nativeQueue = CUstream; @@ -20,6 +20,7 @@ using nativeDevice = device; using nativeQueue = ihipStream_t; using nativeEvent = ihipEvent_t; #else +#include constexpr auto BACKEND = backend::opencl; using nativeDevice = cl_device_id; using nativeQueue = cl_command_queue; From e3504c6054bd3ffe83bb1e1c53691af848d69b2f Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Tue, 12 Nov 2024 06:53:36 -0800 Subject: [PATCH 06/14] [SYCL] fix CUDA build --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 168fc6a6892aa..e9c5ef1dcea42 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,14 +1,14 @@ // RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %} -// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -o %t-cuda.out %} +// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -DSYCL_EXT_ONEAPI_BACKEND_CUDA -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL -o %t-cuda.out %} // RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %} +#include #include #include #include using namespace sycl; #ifdef BUILD_FOR_CUDA -#include constexpr auto BACKEND = backend::ext_oneapi_cuda; using nativeDevice = CUdevice; using nativeQueue = CUstream; @@ -20,7 +20,6 @@ using nativeDevice = device; using nativeQueue = ihipStream_t; using nativeEvent = ihipEvent_t; #else -#include constexpr auto BACKEND = backend::opencl; using nativeDevice = cl_device_id; using nativeQueue = cl_command_queue; From ebaf36e5682078a4a7308a9bab01bd637c945362 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Wed, 13 Nov 2024 00:45:27 -0800 Subject: [PATCH 07/14] [SYCL][E2E] fix cuda test build option --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index e9c5ef1dcea42..781b3e7ff6559 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,5 +1,5 @@ // RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %} -// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -DSYCL_EXT_ONEAPI_BACKEND_CUDA -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL -o %t-cuda.out %} +// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -DSYCL_EXT_ONEAPI_BACKEND_CUDA -o %t-cuda.out %} // RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %} #include From 8719cdc9a7a4befefa63b2705424da96cf823a36 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Wed, 13 Nov 2024 02:17:47 -0800 Subject: [PATCH 08/14] [SYCL][E2E] include missing header --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 781b3e7ff6559..0867e5fb0557e 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -9,6 +9,7 @@ using namespace sycl; #ifdef BUILD_FOR_CUDA +#include constexpr auto BACKEND = backend::ext_oneapi_cuda; using nativeDevice = CUdevice; using nativeQueue = CUstream; From 0d57a09cb7bddb1936c76a99d373e32bd4ba79cc Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Wed, 13 Nov 2024 03:08:04 -0800 Subject: [PATCH 09/14] [SYCL][E2E] do not use additional cuda build option --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 0867e5fb0557e..14266459a7754 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,5 +1,5 @@ // RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %} -// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -DSYCL_EXT_ONEAPI_BACKEND_CUDA -o %t-cuda.out %} +// RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -o %t-cuda.out %} // RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %} #include From d208a9b254325bbd8d79b2adc5a01ec993ff137b Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Wed, 13 Nov 2024 04:28:10 -0800 Subject: [PATCH 10/14] [SYCL][E2E] disable cuda test and create issue --- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 14266459a7754..902ab1f1d09b9 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,3 +1,5 @@ +// XFAIL: any-device-is-cuda +// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16070 // RUN: %if any-device-is-opencl %{ %{build} -o %t-opencl.out %} // RUN: %if any-device-is-cuda %{ %{build} -isystem %sycl_include -DBUILD_FOR_CUDA -o %t-cuda.out %} // RUN: %if any-device-is-hip %{ %{build} -DBUILD_FOR_HIP -o %t-hip.out %} From 173303bc4648a679fc31841616bfce4da6d3f8c2 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Fri, 15 Nov 2024 01:00:36 -0800 Subject: [PATCH 11/14] [SYCL][E2E] do not pass unused variable --- sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp index bc417a5077769..67b9441f5cc39 100644 --- a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp +++ b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp @@ -1,4 +1,4 @@ -// RUN: %if any-device-is-level_zero %{ %{build} -isystem %sycl_include -DBUILD_FOR_L0 -o %t-l0.out %} +// RUN: %if any-device-is-level_zero %{ %{build} -isystem %sycl_include -o %t-l0.out %} #include #include From 8625a1be69a5e7e56b0616165110664e43d78656 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Wed, 20 Nov 2024 01:27:41 -0800 Subject: [PATCH 12/14] [SYCL][E2E] remove test which exists in sycl/test --- .../interop/Interop_level_zero_backend.cpp | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp diff --git a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp b/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp deleted file mode 100644 index 67b9441f5cc39..0000000000000 --- a/sycl/test-e2e/Basic/interop/Interop_level_zero_backend.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// RUN: %if any-device-is-level_zero %{ %{build} -isystem %sycl_include -o %t-l0.out %} - -#include -#include -#include -#include -using namespace sycl; - -constexpr auto BACKEND = backend::ext_oneapi_level_zero; -using nativeDevice = ze_device_handle_t; -using nativeQueue = ze_command_queue_handle_t; -using nativeEvent = ze_event_handle_t; - -constexpr int N = 100; -constexpr int VAL = 3; - -int main() { - - assert(static_cast( - std::is_same_v::return_type, - nativeDevice>)); - assert(static_cast( - std::is_same_v::return_type, - nativeQueue>)); - assert(static_cast( - std::is_same_v::return_type, - nativeEvent>)); - - device Device; - backend_traits::return_type NativeDevice = - get_native(Device); - // Create sycl device with a native device. - auto InteropDevice = make_device(NativeDevice); - - context Context(InteropDevice); - - // Create sycl queue with device created from a native device. - queue Queue(InteropDevice, {sycl::property::queue::in_order()}); - backend_traits::return_type NativeQueue = - get_native(Queue); - backend_traits::input_type InputType(NativeQueue, Device); - - auto InteropQueue = make_queue(InputType, Context); - - auto A = (int *)malloc_device(N * sizeof(int), InteropQueue); - std::vector vec(N, 0); - - auto Event = Queue.submit([&](handler &h) { - h.parallel_for(range<1>(N), - [=](id<1> item) { A[item] = VAL; }); - }); - - backend_traits::return_type NativeEvent = - get_native(Event); - backend_traits::input_type EventInputType; - EventInputType.NativeHandle = NativeEvent; - // Create sycl event with a native event. - event InteropEvent = make_event(EventInputType, Context); - - // depends_on sycl event created from a native event. - auto Event2 = InteropQueue.submit([&](handler &h) { - h.depends_on(InteropEvent); - h.parallel_for(range<1>(N), [=](id<1> item) { A[item]++; }); - }); - - auto Event3 = InteropQueue.memcpy(&vec[0], A, N * sizeof(int), Event2); - Event3.wait(); - - if constexpr (BACKEND == backend::ext_oneapi_hip) { - try { - backend_traits::return_type NativeContext = - get_native(Context); - } catch (sycl::exception &e) { - assert(e.code() == sycl::errc::feature_not_supported); - } - } - - free(A, InteropQueue); - - for (const auto &val : vec) { - assert(val == VAL + 1); - } - - return 0; -} From 2aa9d1206ce5ac6c5213d233fc25ca08a60c3722 Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Fri, 13 Dec 2024 10:29:09 +0100 Subject: [PATCH 13/14] [SYCL] [E2E] remove duplicated env variable from lit config --- sycl/test-e2e/lit.cfg.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index f3362c2414799..2ef9ac91ce299 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -95,7 +95,6 @@ "CL_CONFIG_DEVICES", "SYCL_DEVICE_ALLOWLIST", "SYCL_CONFIG_FILE_NAME", - "OCL_ICD_VENDORS", ] ) From e7ffec6ea6f2dcfed8ca0e7ade535e851caf65fe Mon Sep 17 00:00:00 2001 From: "Klochkov, Denis" Date: Wed, 18 Dec 2024 11:10:07 +0100 Subject: [PATCH 14/14] [SYCL] include kernel bundle header in test --- .../is_compatible/Inputs/is_compatible_with_env.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/Inputs/is_compatible_with_env.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/Inputs/is_compatible_with_env.cpp index 365614f780337..fe956704868a0 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/Inputs/is_compatible_with_env.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/Inputs/is_compatible_with_env.cpp @@ -1,4 +1,5 @@ #include +#include int main() { sycl::device dev;