@@ -498,11 +498,6 @@ urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t CommandBuffer) {
498498 (CommandBuffer->ZeCommandList , CommandBuffer->SignalEvent ->ZeEvent ,
499499 NumEvents, WaitEventList.data ()));
500500
501- // Reset the wait-event for the UR command-buffer that is signalled when its
502- // submission dependencies have been satisfied.
503- ZE2UR_CALL (zeCommandListAppendEventReset,
504- (CommandBuffer->ZeCommandList , CommandBuffer->WaitEvent ->ZeEvent ));
505-
506501 // Close the command list and have it ready for dispatch.
507502 ZE2UR_CALL (zeCommandListClose, (CommandBuffer->ZeCommandList ));
508503 return UR_RESULT_SUCCESS;
@@ -938,10 +933,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
938933 ur_event_handle_t RetEvent{};
939934 // Create a command-list to signal RetEvent on completion
940935 ur_command_list_ptr_t SignalCommandList{};
941- if (Event) {
942- UR_CALL (Queue->Context ->getAvailableCommandList (Queue, SignalCommandList,
943- false , false ));
936+ UR_CALL (Queue->Context ->getAvailableCommandList (Queue, SignalCommandList,
937+ false , false ));
938+ // Reset the wait-event for the UR command-buffer that is signalled when its
939+ // submission dependencies have been satisfied.
940+ ZE2UR_CALL (zeCommandListAppendEventReset,
941+ (SignalCommandList->first , CommandBuffer->WaitEvent ->ZeEvent ));
944942
943+ if (Event) {
945944 UR_CALL (createEventAndAssociateQueue (Queue, &RetEvent,
946945 UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP,
947946 SignalCommandList, false ));
@@ -968,8 +967,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
968967 RetEvent->CommandData = static_cast <void *>(Profiling);
969968 } else {
970969 ZE2UR_CALL (zeCommandListAppendBarrier,
971- (SignalCommandList->first , RetEvent->ZeEvent , 1 ,
972- &(CommandBuffer->SignalEvent ->ZeEvent )));
970+ (SignalCommandList->first , RetEvent->ZeEvent , 1 ,
971+ &(CommandBuffer->SignalEvent ->ZeEvent )));
973972 }
974973 }
975974
0 commit comments