Skip to content

Commit f832dd2

Browse files
committed
[L0]: fix missing destroy of event given enqueue wait out event
- Added check during event handle release to perform an additional cleanup of an enqueue wait event once the user has released their usage of the out event. Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent f3ed45b commit f832dd2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/adapters/level_zero/event.cpp

Lines changed: 7 additions & 0 deletions
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)