diff --git a/sycl/source/detail/kernel_bundle_impl.hpp b/sycl/source/detail/kernel_bundle_impl.hpp index d1e688e3e63ca..db084dd8c30d4 100644 --- a/sycl/source/detail/kernel_bundle_impl.hpp +++ b/sycl/source/detail/kernel_bundle_impl.hpp @@ -372,11 +372,15 @@ class kernel_bundle_impl { Plugin->call(PiProgram); + std::vector DeviceVec; + DeviceVec.reserve(Devices.size()); for (const auto &SyclDev : Devices) { pi::PiDevice Dev = getSyclObjImpl(SyclDev)->getHandleRef(); - Plugin->call( - PiProgram, 1, &Dev, nullptr, nullptr, nullptr); + DeviceVec.push_back(Dev); } + Plugin->call( + PiProgram, DeviceVec.size(), DeviceVec.data(), nullptr, nullptr, + nullptr); // Get the number of kernels in the program. size_t NumKernels; diff --git a/sycl/test-e2e/KernelCompiler/kernel_compiler.cpp b/sycl/test-e2e/KernelCompiler/kernel_compiler.cpp index 0f1cdf4eb44e4..c8b380adb3d59 100644 --- a/sycl/test-e2e/KernelCompiler/kernel_compiler.cpp +++ b/sycl/test-e2e/KernelCompiler/kernel_compiler.cpp @@ -8,10 +8,6 @@ // REQUIRES: ocloc -// UNSUPPORTED: (gpu-intel-dg2 && level_zero) || (gpu-intel-pvc && level_zero) -// Seems to be an incompatibility with the KernelCompiler on L0 with DG2 and -// PVC. - // RUN: %{build} -o %t.out // RUN: %{run} %t.out @@ -82,8 +78,11 @@ void test_build_and_run() { using source_kb = sycl::kernel_bundle; using exe_kb = sycl::kernel_bundle; - sycl::queue q; - sycl::context ctx = q.get_context(); + // only one device is supported at this time, so we limit the queue and + // context to that + sycl::device d{sycl::default_selector_v}; + sycl::context ctx{d}; + sycl::queue q{ctx, d}; bool ok = syclex::is_source_kernel_bundle_supported( ctx.get_backend(), syclex::source_language::opencl); @@ -135,8 +134,11 @@ void test_error() { using source_kb = sycl::kernel_bundle; using exe_kb = sycl::kernel_bundle; - sycl::queue q; - sycl::context ctx = q.get_context(); + // only one device is supported at this time, so we limit the queue and + // context to that + sycl::device d{sycl::default_selector_v}; + sycl::context ctx{d}; + sycl::queue q{ctx, d}; bool ok = syclex::is_source_kernel_bundle_supported( ctx.get_backend(), syclex::source_language::opencl); diff --git a/sycl/test-e2e/KernelCompiler/opencl_capabilities.cpp b/sycl/test-e2e/KernelCompiler/opencl_capabilities.cpp index 8cd8e0aa6c0fb..76500b13de705 100644 --- a/sycl/test-e2e/KernelCompiler/opencl_capabilities.cpp +++ b/sycl/test-e2e/KernelCompiler/opencl_capabilities.cpp @@ -8,16 +8,15 @@ // REQUIRES: ocloc -// UNSUPPORTED: (gpu-intel-dg2 && level_zero) || (gpu-intel-pvc && level_zero) -// Seems to be an incompatibility with the KernelCompiler on L0 with DG2 and -// PVC. - // RUN: %{build} -o %t.out // RUN: %{run} %t.out // Here we are testing some of the various args that SYCL can and cannot // pass to an OpenCL kernel that is compiled with the kernel_compiler. +// no backend supports compiling for multiple devices yet, so we limit +// the queue and context to just one. + // IMPORTANT: LevelZero YES! // Even though this test is covering which OpenCL capabilities // are covered by the kernel_compiler, this is not a test of only @@ -51,9 +50,9 @@ auto constexpr LocalAccCLSource = R"===( )==="; void test_local_accessor() { - - sycl::queue q; - sycl::context ctx = q.get_context(); + sycl::device d{sycl::default_selector_v}; + sycl::context ctx{d}; + sycl::queue q{ctx, d}; source_kb kbSrc = syclex::create_kernel_bundle_from_source( ctx, syclex::source_language::opencl, LocalAccCLSource); @@ -93,8 +92,9 @@ __kernel void usm_kernel(__global int *usmPtr, int multiplier, float added) { )==="; void test_usm_pointer_and_scalar() { - sycl::queue q; - sycl::context ctx = q.get_context(); + sycl::device d{sycl::default_selector_v}; + sycl::context ctx{d}; + sycl::queue q{ctx, d}; source_kb kbSrc = syclex::create_kernel_bundle_from_source( ctx, syclex::source_language::opencl, USMCLSource); @@ -146,8 +146,9 @@ struct pair { }; void test_struct() { - sycl::queue q; - sycl::context ctx = q.get_context(); + sycl::device d{sycl::default_selector_v}; + sycl::context ctx{d}; + sycl::queue q{ctx, d}; source_kb kbSrc = syclex::create_kernel_bundle_from_source( ctx, syclex::source_language::opencl, StructSrc);