File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -405,6 +405,18 @@ pi_result _pi_event::wait() {
405405 return retErr;
406406}
407407
408+ pi_result _pi_event::release () {
409+ assert (queue_ != nullptr );
410+ PI_CHECK_ERROR (cuEventDestroy (evEnd_));
411+
412+ if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
413+ PI_CHECK_ERROR (cuEventDestroy (evQueued_));
414+ PI_CHECK_ERROR (cuEventDestroy (evStart_));
415+ }
416+
417+ return PI_SUCCESS;
418+ }
419+
408420// makes all future work submitted to queue wait for all work captured in event.
409421pi_result enqueueEventWait (pi_queue queue, pi_event event) {
410422 // for native events, the cuStreamWaitEvent call is used.
@@ -2889,8 +2901,7 @@ pi_result cuda_piEventRelease(pi_event event) {
28892901 pi_result result = PI_INVALID_EVENT;
28902902 try {
28912903 ScopedContext active (event->get_context ());
2892- auto cuEvent = event->get ();
2893- result = PI_CHECK_ERROR (cuEventDestroy (cuEvent));
2904+ result = event->release ();
28942905 } catch (...) {
28952906 result = PI_OUT_OF_RESOURCES;
28962907 }
Original file line number Diff line number Diff line change @@ -374,6 +374,8 @@ class _pi_event {
374374 return new _pi_event (type, queue->get_context (), queue);
375375 }
376376
377+ pi_result release ();
378+
377379 ~_pi_event ();
378380
379381private:
You can’t perform that action at this time.
0 commit comments