Skip to content

Commit 211a101

Browse files
kbenzienrspruit
authored andcommitted
Merge pull request #2612 from nrspruit/destroy_wait_always
[L0]: fix missing destroy of event given enqueue wait out event
1 parent 0936073 commit 211a101

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/adapters/level_zero/event.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,14 @@ ur_result_t
881881
urEventRelease(ur_event_handle_t Event ///< [in] handle of the event object
882882
) {
883883
Event->RefCountExternal--;
884+
bool isEventsWaitCompleted =
885+
Event->CommandType == UR_COMMAND_EVENTS_WAIT && Event->Completed;
884886
UR_CALL(urEventReleaseInternal(Event));
887+
// If this is a Completed Event Wait Out Event, then we need to cleanup the
888+
// event at user release and not at the time of completion.
889+
if (isEventsWaitCompleted) {
890+
UR_CALL(CleanupCompletedEvent((Event), false, false));
891+
}
885892

886893
return UR_RESULT_SUCCESS;
887894
}

0 commit comments

Comments
 (0)