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(
145145 std::unique_lock<ur_shared_mutex> Lock (Queue->Mutex );
146146 resetCommandLists (Queue);
147147 }
148+ if (OutEvent && (*OutEvent)->Completed ) {
149+ UR_CALL (CleanupCompletedEvent ((*OutEvent), false , false ));
150+ UR_CALL (urEventReleaseInternal ((*OutEvent)));
151+ }
148152
149153 return UR_RESULT_SUCCESS;
150154}
@@ -955,7 +959,6 @@ ur_result_t urEventCreateWithNativeHandle(
955959 UREvent = new ur_event_handle_t_ (ZeEvent, nullptr /* ZeEventPool */ ,
956960 Context, UR_EXT_COMMAND_TYPE_USER,
957961 Properties->isNativeHandleOwned );
958-
959962 UREvent->RefCountExternal ++;
960963
961964 } catch (const std::bad_alloc &) {
@@ -1111,6 +1114,7 @@ ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
11111114 // enabled or not, so we access properties of the queue and that's why queue
11121115 // must released later.
11131116 if (DisableEventsCaching || !Event->OwnNativeHandle ) {
1117+ ZE_CALL_NOCHECK (zeEventDestroy, (Event->ZeEvent ));
11141118 delete Event;
11151119 } else {
11161120 Event->Context ->addEventToContextCache (Event);
You can’t perform that action at this time.
0 commit comments