@@ -196,7 +196,9 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
196196 //
197197 if (Queue->isInOrderQueue () && InOrderBarrierBySignal &&
198198 !Queue->isProfilingEnabled ()) {
199- if (EventWaitList.Length ) {
199+ // If we are using driver in order lists, then append wait on events
200+ // is unnecessary and we can signal the event created.
201+ if (EventWaitList.Length && !CmdList->second .IsInOrderList ) {
200202 ZE2UR_CALL (zeCommandListAppendWaitOnEvents,
201203 (CmdList->first , EventWaitList.Length ,
202204 EventWaitList.ZeEventList ));
@@ -1546,8 +1548,13 @@ ur_result_t _ur_ze_event_list_t::createAndRetainUrZeEventList(
15461548
15471549 ZE2UR_CALL (zeCommandListAppendWaitOnEvents,
15481550 (ZeCommandList, 1u , &EventList[I]->ZeEvent ));
1549- if (!MultiDeviceEvent->CounterBasedEventsEnabled )
1551+ if (!MultiDeviceEvent->CounterBasedEventsEnabled ) {
15501552 ZE2UR_CALL (zeEventHostSignal, (MultiDeviceZeEvent));
1553+ } else {
1554+ ZE2UR_CALL (zeCommandListAppendSignalEvent,
1555+ (ZeCommandList, MultiDeviceZeEvent));
1556+ }
1557+ MultiDeviceEvent->Completed = true ;
15511558
15521559 UR_CALL (Queue->executeCommandList (CommandList, /* IsBlocking */ false ,
15531560 /* OkToBatchCommand */ true ));
0 commit comments