diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index fcfd2703f22ad..8e9d9e94a3223 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -140,7 +140,7 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext, pi::PiProgram PiProgram = nullptr; Plugin.call( - NativeHandle, ContextImpl->getHandleRef(), KeepOwnership, &PiProgram); + NativeHandle, ContextImpl->getHandleRef(), !KeepOwnership, &PiProgram); std::vector ProgramDevices; size_t NumDevices = 0; @@ -251,7 +251,7 @@ kernel make_kernel(const context &TargetContext, // Create PI kernel first. pi::PiKernel PiKernel = nullptr; Plugin.call( - NativeHandle, ContextImpl->getHandleRef(), PiProgram, KeepOwnership, + NativeHandle, ContextImpl->getHandleRef(), PiProgram, !KeepOwnership, &PiKernel); if (Backend == backend::opencl)