Skip to content

Commit

Permalink
[SYCL] Invert the KeepOwnership argument to match PI API definitions (#…
Browse files Browse the repository at this point in the history
…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 <sergey.v.maslov@intel.com>
  • Loading branch information
smaslov-intel committed Oct 19, 2022
1 parent c59f969 commit 3c22764
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sycl/source/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext,

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

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

if (Backend == backend::opencl)
Expand Down

0 comments on commit 3c22764

Please sign in to comment.