File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ ur_result_t urEnqueueEventsWait(
145
145
std::unique_lock<ur_shared_mutex> Lock (Queue->Mutex );
146
146
resetCommandLists (Queue);
147
147
}
148
+ if (OutEvent && (*OutEvent)->Completed ) {
149
+ UR_CALL (CleanupCompletedEvent ((*OutEvent), false , false ));
150
+ UR_CALL (urEventReleaseInternal ((*OutEvent)));
151
+ }
148
152
149
153
return UR_RESULT_SUCCESS;
150
154
}
@@ -955,7 +959,6 @@ ur_result_t urEventCreateWithNativeHandle(
955
959
UREvent = new ur_event_handle_t_ (ZeEvent, nullptr /* ZeEventPool */ ,
956
960
Context, UR_EXT_COMMAND_TYPE_USER,
957
961
Properties->isNativeHandleOwned );
958
-
959
962
UREvent->RefCountExternal ++;
960
963
961
964
} catch (const std::bad_alloc &) {
@@ -1111,6 +1114,7 @@ ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
1111
1114
// enabled or not, so we access properties of the queue and that's why queue
1112
1115
// must released later.
1113
1116
if (DisableEventsCaching || !Event->OwnNativeHandle ) {
1117
+ ZE_CALL_NOCHECK (zeEventDestroy, (Event->ZeEvent ));
1114
1118
delete Event;
1115
1119
} else {
1116
1120
Event->Context ->addEventToContextCache (Event);
You can’t perform that action at this time.
0 commit comments