@@ -196,14 +196,13 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
196
196
//
197
197
if (Queue->isInOrderQueue () && InOrderBarrierBySignal &&
198
198
!Queue->isProfilingEnabled ()) {
199
- // If we are using driver in order lists, then append wait on events
200
- // is unnecessary IF the cmdlists match.
201
199
if (EventWaitList.Length ) {
202
200
if (CmdList->second .IsInOrderList ) {
203
- for (unsigned i = EventWaitList.Length ; i-- < 0 ;) {
204
- // if the events is from the same cmdlist, we can remove it
205
- // from the waitlist.
206
- if (EventWaitList.UrEventList [i]->CommandList == CmdList) {
201
+ for (unsigned i = EventWaitList.Length ; i-- > 0 ;) {
202
+ // If the event is a multidevice event, then given driver in order
203
+ // lists, we cannot include this into the wait event list due to
204
+ // driver limitations.
205
+ if (EventWaitList.UrEventList [i]->IsMultiDevice ) {
207
206
EventWaitList.Length --;
208
207
if (EventWaitList.Length != i) {
209
208
std::swap (EventWaitList.UrEventList [i],
@@ -1562,16 +1561,11 @@ ur_result_t _ur_ze_event_list_t::createAndRetainUrZeEventList(
1562
1561
const auto &ZeCommandList = CommandList->first ;
1563
1562
EventList[I]->RefCount .increment ();
1564
1563
1565
- ZE2UR_CALL (zeCommandListAppendWaitOnEvents,
1566
- (ZeCommandList, 1u , &EventList[I]->ZeEvent ));
1567
- if (!MultiDeviceEvent->CounterBasedEventsEnabled ) {
1568
- ZE2UR_CALL (zeEventHostSignal, (MultiDeviceZeEvent));
1569
- } else {
1570
- ZE2UR_CALL (zeCommandListAppendSignalEvent,
1571
- (ZeCommandList, MultiDeviceZeEvent));
1572
- }
1573
- MultiDeviceEvent->Completed = true ;
1574
-
1564
+ // Append a Barrier to wait on the original event while signalling the
1565
+ // new multi device event.
1566
+ ZE2UR_CALL (
1567
+ zeCommandListAppendBarrier,
1568
+ (ZeCommandList, MultiDeviceZeEvent, 1u , &EventList[I]->ZeEvent ));
1575
1569
UR_CALL (Queue->executeCommandList (CommandList, /* IsBlocking */ false ,
1576
1570
/* OkToBatchCommand */ true ));
1577
1571
0 commit comments