Skip to content

Commit 200f075

Browse files
committed
[L0]: fix missing destroy of event given enqueue wait out event
- Added check during event handle release to perform an additional release and cleanup of an enqueue wait event once the user has released their usage of the out event. Signed-off-by: Neil R. Spruit <[email protected]>
1 parent f3ed45b commit 200f075

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/adapters/level_zero/event.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,12 @@ urEventRelease(ur_event_handle_t Event ///< [in] handle of the event object
882882
) {
883883
Event->RefCountExternal--;
884884
UR_CALL(urEventReleaseInternal(Event));
885+
// If this is a Completed Event Wait Out Event, then we need to cleanup the
886+
// event at user release and not at the time of completion.
887+
if (Event->CommandType == UR_COMMAND_EVENTS_WAIT && Event->Completed) {
888+
UR_CALL(CleanupCompletedEvent((Event), false, false));
889+
UR_CALL(urEventReleaseInternal((Event)));
890+
}
885891

886892
return UR_RESULT_SUCCESS;
887893
}

0 commit comments

Comments
 (0)