Skip to content

Commit 21bf4be

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 3a1b4c7 commit 21bf4be

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
@@ -887,7 +887,14 @@ ur_result_t
887887

888888
urEventRelease(/** [in] handle of the event object */ ur_event_handle_t Event) {
889889
Event->RefCountExternal--;
890+
bool isEventsWaitCompleted =
891+
Event->CommandType == UR_COMMAND_EVENTS_WAIT && Event->Completed;
890892
UR_CALL(urEventReleaseInternal(Event));
893+
// If this is a Completed Event Wait Out Event, then we need to cleanup the
894+
// event at user release and not at the time of completion.
895+
if (isEventsWaitCompleted) {
896+
UR_CALL(CleanupCompletedEvent((Event), false, false));
897+
}
891898

892899
return UR_RESULT_SUCCESS;
893900
}

0 commit comments

Comments
 (0)