Skip to content

Commit 2baf1de

Browse files
authored
[SYCL][CUDA] Retain context with CUDA event interop (#6361)
This PR fixes an issue found in the SYCL-CTS cuda interop tests. Where the context had not been properly retained when creating a native event with CUDA interop.
1 parent 1afa98f commit 2baf1de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ _pi_event::_pi_event(pi_context context, CUevent eventNative)
476476
hasBeenWaitedOn_{false}, isRecorded_{false}, isStarted_{false},
477477
streamToken_{std::numeric_limits<pi_uint32>::max()}, evEnd_{eventNative},
478478
evStart_{nullptr}, evQueued_{nullptr}, queue_{nullptr}, context_{
479-
context} {}
479+
context} {
480+
cuda_piContextRetain(context_);
481+
}
480482

481483
_pi_event::~_pi_event() {
482484
if (queue_ != nullptr) {

0 commit comments

Comments
 (0)