diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index 7800032db33cc..35304d06428a3 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -339,9 +339,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; - 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 @@ -350,8 +358,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), - 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_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index fd6503772d356..902ab1f1d09b9 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -1,8 +1,7 @@ -// XFAIL: any-device-is-opencl, any-device-is-cuda, any-device-is-level_zero, gpu-intel-dg2, hip_amd -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15819 +// 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-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 @@ -20,17 +19,12 @@ 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; -#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; +using nativeDevice = device; +using nativeQueue = ihipStream_t; +using nativeEvent = ihipEvent_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/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; 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 55b9f7037e4f2..3e9124954b774 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,9 +1,8 @@ -// REQUIRES: ocloc, level_zero, gpu, cpu +// REQUIRES: ocloc, any-device-is-level_zero, any-device-is-gpu, any-device-is-cpu // REQUIRES: build-and-run-mode -// 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