Skip to content

Commit

Permalink
[L0]: fix missing destroy of event given enqueue wait out event
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
nrspruit committed Jan 28, 2025
1 parent 3a1b4c7 commit 21bf4be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/adapters/level_zero/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,14 @@ ur_result_t

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

return UR_RESULT_SUCCESS;
}
Expand Down

0 comments on commit 21bf4be

Please sign in to comment.