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() {
405
405
return retErr;
406
406
}
407
407
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
+
408
420
// makes all future work submitted to queue wait for all work captured in event.
409
421
pi_result enqueueEventWait (pi_queue queue, pi_event event) {
410
422
// for native events, the cuStreamWaitEvent call is used.
@@ -2889,8 +2901,7 @@ pi_result cuda_piEventRelease(pi_event event) {
2889
2901
pi_result result = PI_INVALID_EVENT;
2890
2902
try {
2891
2903
ScopedContext active (event->get_context ());
2892
- auto cuEvent = event->get ();
2893
- result = PI_CHECK_ERROR (cuEventDestroy (cuEvent));
2904
+ result = event->release ();
2894
2905
} catch (...) {
2895
2906
result = PI_OUT_OF_RESOURCES;
2896
2907
}
Original file line number Diff line number Diff line change @@ -374,6 +374,8 @@ class _pi_event {
374
374
return new _pi_event (type, queue->get_context (), queue);
375
375
}
376
376
377
+ pi_result release ();
378
+
377
379
~_pi_event ();
378
380
379
381
private:
You can’t perform that action at this time.
0 commit comments