@@ -85,7 +85,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWait(
8585 // Get a new command list to be used on this call
8686 ur_command_list_ptr_t CommandList{};
8787 UR_CALL (Queue->Context ->getAvailableCommandList (
88- Queue, CommandList, UseCopyEngine, NumEventsInWaitList, EventWaitList));
88+ Queue, CommandList, UseCopyEngine, NumEventsInWaitList, EventWaitList,
89+ false /* AllowBatching*/ , nullptr /* ForceCmdQueue*/ ));
8990
9091 ze_event_handle_t ZeEvent = nullptr ;
9192 ur_event_handle_t InternalEvent;
@@ -106,7 +107,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWait(
106107
107108 // Execute command list asynchronously as the event will be used
108109 // to track down its completion.
109- return Queue->executeCommandList (CommandList);
110+ return Queue->executeCommandList (CommandList, false /* IsBlocking*/ ,
111+ false /* OKToBatchCommand*/ );
110112 }
111113
112114 {
@@ -258,12 +260,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
258260 ur_command_list_ptr_t CmdList;
259261 UR_CALL (Queue->Context ->getAvailableCommandList (
260262 Queue, CmdList, false /* UseCopyEngine=*/ , NumEventsInWaitList,
261- EventWaitList, OkToBatch));
263+ EventWaitList, OkToBatch, nullptr /* ForcedCmdQueue */ ));
262264
263265 // Insert the barrier into the command-list and execute.
264266 UR_CALL (insertBarrierIntoCmdList (CmdList, TmpWaitList, *Event, IsInternal));
265267
266- UR_CALL (Queue->executeCommandList (CmdList, false , OkToBatch));
268+ UR_CALL (
269+ Queue->executeCommandList (CmdList, false /* IsBlocking*/ , OkToBatch));
267270
268271 // Because of the dependency between commands in the in-order queue we don't
269272 // need to keep track of any active barriers if we have in-order queue.
@@ -328,7 +331,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
328331 ur_command_list_ptr_t CmdList;
329332 UR_CALL (Queue->Context ->getAvailableCommandList (
330333 Queue, CmdList, false /* UseCopyEngine=*/ , NumEventsInWaitList,
331- EventWaitList, OkToBatch));
334+ EventWaitList, OkToBatch, nullptr /* ForcedCmdQueue */ ));
332335 CmdLists.push_back (CmdList);
333336 }
334337
@@ -377,7 +380,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
377380 // Only batch if the matching CmdList is already open.
378381 OkToBatch = CommandBatch.OpenCommandList == CmdList;
379382
380- UR_CALL (Queue->executeCommandList (CmdList, false , OkToBatch));
383+ UR_CALL (
384+ Queue->executeCommandList (CmdList, false /* IsBlocking*/ , OkToBatch));
381385 }
382386
383387 UR_CALL (Queue->ActiveBarriers .clear ());
@@ -687,7 +691,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
687691 ur_command_list_ptr_t CommandList{};
688692 UR_CALL (Queue->Context ->getAvailableCommandList (
689693 Queue, CommandList, UseCopyEngine, NumEventsInWaitList, EventWaitList,
690- /* AllowBatching */ false ));
694+ /* AllowBatching */ false , nullptr /* ForcedCmdQueue */ ));
691695
692696 UR_CALL (createEventAndAssociateQueue (
693697 Queue, OutEvent, UR_COMMAND_TIMESTAMP_RECORDING_EXP, CommandList,
@@ -710,7 +714,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
710714 (*OutEvent)->WaitList .ZeEventList ));
711715
712716 UR_CALL (
713- Queue->executeCommandList (CommandList, Blocking, /* OkToBatch */ false ));
717+ Queue->executeCommandList (CommandList, Blocking, false /* OkToBatch */ ));
714718
715719 return UR_RESULT_SUCCESS;
716720}
@@ -738,7 +742,8 @@ ur_result_t ur_event_handle_t_::getOrCreateHostVisibleEvent(
738742
739743 ur_command_list_ptr_t CommandList{};
740744 UR_CALL (UrQueue->Context ->getAvailableCommandList (
741- UrQueue, CommandList, false /* UseCopyEngine */ , 0 , nullptr , OkToBatch))
745+ UrQueue, CommandList, false /* UseCopyEngine */ , 0 , nullptr , OkToBatch,
746+ nullptr /* ForcedCmdQueue*/ ))
742747
743748 // Create a "proxy" host-visible event.
744749 UR_CALL (createEventAndAssociateQueue (
@@ -756,7 +761,8 @@ ur_result_t ur_event_handle_t_::getOrCreateHostVisibleEvent(
756761 ZE2UR_CALL (zeCommandListAppendSignalEvent,
757762 (CommandList->first , HostVisibleEvent->ZeEvent ));
758763
759- UR_CALL (UrQueue->executeCommandList (CommandList, false , OkToBatch))
764+ UR_CALL (UrQueue->executeCommandList (CommandList, false /* IsBlocking*/ ,
765+ OkToBatch))
760766 this ->IsCreatingHostProxyEvent = false ;
761767 }
762768
@@ -835,7 +841,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventWait(
835841 else {
836842 // NOTE: we are cleaning up after the event here to free resources
837843 // sooner in case run-time is not calling urEventRelease soon enough.
838- CleanupCompletedEvent (reinterpret_cast <ur_event_handle_t >(Event));
844+ CleanupCompletedEvent (reinterpret_cast <ur_event_handle_t >(Event),
845+ false /* QueueLocked*/ ,
846+ false /* SetEventCompleted*/ );
839847 // For the case when we have out-of-order queue or regular command
840848 // lists its more efficient to check fences so put the queue in the
841849 // set to cleanup later.
@@ -903,7 +911,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urExtEventCreate(
903911 ur_event_handle_t
904912 *Event // /< [out] pointer to the handle of the event object created.
905913) {
906- UR_CALL (EventCreate (Context, nullptr , false , true , Event));
914+ UR_CALL (EventCreate (Context, nullptr /* Queue*/ , false /* IsMultiDevice*/ ,
915+ true /* HostVisible*/ , Event,
916+ false /* CounterBasedEventEnabled*/ ,
917+ false /* ForceDisableProfiling*/ ));
907918
908919 (*Event)->RefCountExternal ++;
909920 if (!(*Event)->CounterBasedEventsEnabled )
@@ -922,7 +933,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(
922933 // we dont have urEventCreate, so use this check for now to know that
923934 // the call comes from urEventCreate()
924935 if (reinterpret_cast <ze_event_handle_t >(NativeEvent) == nullptr ) {
925- UR_CALL (EventCreate (Context, nullptr , false , true , Event));
936+ UR_CALL (EventCreate (Context, nullptr /* Queue*/ , false /* IsMultiDevice*/ ,
937+ true /* HostVisible*/ , Event,
938+ false /* CounterBasedEventEnabled*/ ,
939+ false /* ForceDisableProfiling*/ ));
926940
927941 (*Event)->RefCountExternal ++;
928942 if (!(*Event)->CounterBasedEventsEnabled )
@@ -1497,7 +1511,8 @@ ur_result_t _ur_ze_event_list_t::createAndRetainUrZeEventList(
14971511 // This prevents a potential deadlock with recursive
14981512 // event locks.
14991513 UR_CALL (Queue->Context ->getAvailableCommandList (
1500- Queue, CommandList, false , 0 , nullptr , true ));
1514+ Queue, CommandList, false /* UseCopyEngine*/ , 0 , nullptr ,
1515+ true /* AllowBatching*/ , nullptr /* ForcedCmdQueue*/ ));
15011516 }
15021517
15031518 std::shared_lock<ur_shared_mutex> Lock (EventList[I]->Mutex );
0 commit comments