Skip to content

Commit

Permalink
Merge pull request #2612 from nrspruit/destroy_wait_always
Browse files Browse the repository at this point in the history
[L0]: fix missing destroy of event given enqueue wait out event
  • Loading branch information
kbenzie authored Feb 3, 2025
2 parents af4f331 + 21bf4be commit b487b62
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 b487b62

Please sign in to comment.