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 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]>
  • Loading branch information
nrspruit committed Jan 23, 2025
1 parent f3ed45b commit 200f075
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/adapters/level_zero/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,12 @@ urEventRelease(ur_event_handle_t Event ///< [in] handle of the event object
) {
Event->RefCountExternal--;
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 (Event->CommandType == UR_COMMAND_EVENTS_WAIT && Event->Completed) {
UR_CALL(CleanupCompletedEvent((Event), false, false));
UR_CALL(urEventReleaseInternal((Event)));
}

return UR_RESULT_SUCCESS;
}
Expand Down

0 comments on commit 200f075

Please sign in to comment.