Skip to content

Commit 0b8e574

Browse files
committed
[SYCL] Fix memory leak in InterOp make_event
Retain should be called only for OpenCL backend. Signed-off-by: Byoungro So <[email protected]>
1 parent 4c6bdbf commit 0b8e574

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sycl/source/detail/event_impl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ event_impl::event_impl(RT::PiEvent Event, const context &SyclContext)
123123
"clEvent.",
124124
PI_INVALID_CONTEXT);
125125
}
126-
127-
getPlugin().call<PiApiKind::piEventRetain>(MEvent);
126+
// Ref count should be incremented for OpenCL backend only.
127+
if (getPlugin().getBackend() == cl::sycl::backend::opencl)
128+
getPlugin().call<PiApiKind::piEventRetain>(MEvent);
128129
}
129130

130131
event_impl::event_impl(const QueueImplPtr &Queue)

0 commit comments

Comments
 (0)