@@ -88,7 +88,8 @@ ur_result_t urEnqueueEventsWait(
8888 // Get a new command list to be used on this call
8989 ur_command_list_ptr_t CommandList{};
9090 UR_CALL (Queue->Context ->getAvailableCommandList (
91- Queue, CommandList, UseCopyEngine, NumEventsInWaitList, EventWaitList));
91+ Queue, CommandList, UseCopyEngine, NumEventsInWaitList, EventWaitList,
92+ false /* AllowBatching*/ , nullptr /* ForceCmdQueue*/ ));
9293
9394 ze_event_handle_t ZeEvent = nullptr ;
9495 ur_event_handle_t InternalEvent;
@@ -109,7 +110,8 @@ ur_result_t urEnqueueEventsWait(
109110
110111 // Execute command list asynchronously as the event will be used
111112 // to track down its completion.
112- return Queue->executeCommandList (CommandList);
113+ return Queue->executeCommandList (CommandList, false /* IsBlocking*/ ,
114+ false /* OKToBatchCommand*/ );
113115 }
114116
115117 {
@@ -261,12 +263,13 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
261263 ur_command_list_ptr_t CmdList;
262264 UR_CALL (Queue->Context ->getAvailableCommandList (
263265 Queue, CmdList, false /* UseCopyEngine=*/ , NumEventsInWaitList,
264- EventWaitList, OkToBatch));
266+ EventWaitList, OkToBatch, nullptr /* ForcedCmdQueue */ ));
265267
266268 // Insert the barrier into the command-list and execute.
267269 UR_CALL (insertBarrierIntoCmdList (CmdList, TmpWaitList, *Event, IsInternal));
268270
269- UR_CALL (Queue->executeCommandList (CmdList, false , OkToBatch));
271+ UR_CALL (
272+ Queue->executeCommandList (CmdList, false /* IsBlocking*/ , OkToBatch));
270273
271274 // Because of the dependency between commands in the in-order queue we don't
272275 // need to keep track of any active barriers if we have in-order queue.
@@ -331,7 +334,7 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
331334 ur_command_list_ptr_t CmdList;
332335 UR_CALL (Queue->Context ->getAvailableCommandList (
333336 Queue, CmdList, false /* UseCopyEngine=*/ , NumEventsInWaitList,
334- EventWaitList, OkToBatch));
337+ EventWaitList, OkToBatch, nullptr /* ForcedCmdQueue */ ));
335338 CmdLists.push_back (CmdList);
336339 }
337340
@@ -380,7 +383,8 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
380383 // Only batch if the matching CmdList is already open.
381384 OkToBatch = CommandBatch.OpenCommandList == CmdList;
382385
383- UR_CALL (Queue->executeCommandList (CmdList, false , OkToBatch));
386+ UR_CALL (
387+ Queue->executeCommandList (CmdList, false /* IsBlocking*/ , OkToBatch));
384388 }
385389
386390 UR_CALL (Queue->ActiveBarriers .clear ());
@@ -690,7 +694,7 @@ ur_result_t urEnqueueTimestampRecordingExp(
690694 ur_command_list_ptr_t CommandList{};
691695 UR_CALL (Queue->Context ->getAvailableCommandList (
692696 Queue, CommandList, UseCopyEngine, NumEventsInWaitList, EventWaitList,
693- /* AllowBatching */ false ));
697+ /* AllowBatching */ false , nullptr /* ForcedCmdQueue */ ));
694698
695699 UR_CALL (createEventAndAssociateQueue (
696700 Queue, OutEvent, UR_COMMAND_TIMESTAMP_RECORDING_EXP, CommandList,
@@ -714,7 +718,7 @@ ur_result_t urEnqueueTimestampRecordingExp(
714718 (*OutEvent)->WaitList .ZeEventList ));
715719
716720 UR_CALL (
717- Queue->executeCommandList (CommandList, Blocking, /* OkToBatch */ false ));
721+ Queue->executeCommandList (CommandList, Blocking, false /* OkToBatch */ ));
718722
719723 return UR_RESULT_SUCCESS;
720724}
@@ -790,7 +794,9 @@ urEventWait(uint32_t NumEvents, ///< [in] number of events in the event list
790794 else {
791795 // NOTE: we are cleaning up after the event here to free resources
792796 // sooner in case run-time is not calling urEventRelease soon enough.
793- CleanupCompletedEvent (reinterpret_cast <ur_event_handle_t >(Event));
797+ CleanupCompletedEvent (reinterpret_cast <ur_event_handle_t >(Event),
798+ false /* QueueLocked*/ ,
799+ false /* SetEventCompleted*/ );
794800 // For the case when we have out-of-order queue or regular command
795801 // lists its more efficient to check fences so put the queue in the
796802 // set to cleanup later.
@@ -858,7 +864,10 @@ ur_result_t urExtEventCreate(
858864 ur_event_handle_t
859865 *Event // /< [out] pointer to the handle of the event object created.
860866) {
861- UR_CALL (EventCreate (Context, nullptr , false , true , Event));
867+ UR_CALL (EventCreate (Context, nullptr /* Queue*/ , false /* IsMultiDevice*/ ,
868+ true /* HostVisible*/ , Event,
869+ false /* CounterBasedEventEnabled*/ ,
870+ false /* ForceDisableProfiling*/ ));
862871
863872 (*Event)->RefCountExternal ++;
864873 if (!(*Event)->CounterBasedEventsEnabled )
@@ -877,7 +886,10 @@ ur_result_t urEventCreateWithNativeHandle(
877886 // we dont have urEventCreate, so use this check for now to know that
878887 // the call comes from urEventCreate()
879888 if (reinterpret_cast <ze_event_handle_t >(NativeEvent) == nullptr ) {
880- UR_CALL (EventCreate (Context, nullptr , false , true , Event));
889+ UR_CALL (EventCreate (Context, nullptr /* Queue*/ , false /* IsMultiDevice*/ ,
890+ true /* HostVisible*/ , Event,
891+ false /* CounterBasedEventEnabled*/ ,
892+ false /* ForceDisableProfiling*/ ));
881893
882894 (*Event)->RefCountExternal ++;
883895 if (!(*Event)->CounterBasedEventsEnabled )
@@ -957,7 +969,8 @@ ur_result_t ur_event_handle_t_::getOrCreateHostVisibleEvent(
957969
958970 ur_command_list_ptr_t CommandList{};
959971 UR_CALL (UrQueue->Context ->getAvailableCommandList (
960- UrQueue, CommandList, false /* UseCopyEngine */ , 0 , nullptr , OkToBatch))
972+ UrQueue, CommandList, false /* UseCopyEngine */ , 0 , nullptr , OkToBatch,
973+ nullptr /* ForcedCmdQueue*/ ))
961974
962975 // Create a "proxy" host-visible event.
963976 UR_CALL (createEventAndAssociateQueue (
@@ -1503,7 +1516,8 @@ ur_result_t _ur_ze_event_list_t::createAndRetainUrZeEventList(
15031516 // This prevents a potential deadlock with recursive
15041517 // event locks.
15051518 UR_CALL (Queue->Context ->getAvailableCommandList (
1506- Queue, CommandList, false , 0 , nullptr , true ));
1519+ Queue, CommandList, false /* UseCopyEngine*/ , 0 , nullptr ,
1520+ true /* AllowBatching*/ , nullptr /* ForcedCmdQueue*/ ));
15071521 }
15081522
15091523 std::shared_lock<ur_shared_mutex> Lock (EventList[I]->Mutex );
0 commit comments