Skip to content

Commit 3c22764

Browse files
[SYCL] Invert the KeepOwnership argument to match PI API definitions (#7089)
The existing test https://github.com/intel/llvm-test-suite/blob/intel/SYCL/OnlineCompiler/online_compiler_L0.cpp caught this problem when run with ZE_DEBUG=4 Signed-off-by: Sergey V Maslov <[email protected]>
1 parent c59f969 commit 3c22764

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sycl/source/backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext,
140140

141141
pi::PiProgram PiProgram = nullptr;
142142
Plugin.call<PiApiKind::piextProgramCreateWithNativeHandle>(
143-
NativeHandle, ContextImpl->getHandleRef(), KeepOwnership, &PiProgram);
143+
NativeHandle, ContextImpl->getHandleRef(), !KeepOwnership, &PiProgram);
144144

145145
std::vector<pi::PiDevice> ProgramDevices;
146146
size_t NumDevices = 0;
@@ -251,7 +251,7 @@ kernel make_kernel(const context &TargetContext,
251251
// Create PI kernel first.
252252
pi::PiKernel PiKernel = nullptr;
253253
Plugin.call<PiApiKind::piextKernelCreateWithNativeHandle>(
254-
NativeHandle, ContextImpl->getHandleRef(), PiProgram, KeepOwnership,
254+
NativeHandle, ContextImpl->getHandleRef(), PiProgram, !KeepOwnership,
255255
&PiKernel);
256256

257257
if (Backend == backend::opencl)

0 commit comments

Comments
 (0)