@@ -498,11 +498,6 @@ urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t CommandBuffer) {
498
498
(CommandBuffer->ZeCommandList , CommandBuffer->SignalEvent ->ZeEvent ,
499
499
NumEvents, WaitEventList.data ()));
500
500
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
-
506
501
// Close the command list and have it ready for dispatch.
507
502
ZE2UR_CALL (zeCommandListClose, (CommandBuffer->ZeCommandList ));
508
503
return UR_RESULT_SUCCESS;
@@ -938,10 +933,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
938
933
ur_event_handle_t RetEvent{};
939
934
// Create a command-list to signal RetEvent on completion
940
935
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 ));
944
942
943
+ if (Event) {
945
944
UR_CALL (createEventAndAssociateQueue (Queue, &RetEvent,
946
945
UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP,
947
946
SignalCommandList, false ));
@@ -968,8 +967,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
968
967
RetEvent->CommandData = static_cast <void *>(Profiling);
969
968
} else {
970
969
ZE2UR_CALL (zeCommandListAppendBarrier,
971
- (SignalCommandList->first , RetEvent->ZeEvent , 1 ,
972
- &(CommandBuffer->SignalEvent ->ZeEvent )));
970
+ (SignalCommandList->first , RetEvent->ZeEvent , 1 ,
971
+ &(CommandBuffer->SignalEvent ->ZeEvent )));
973
972
}
974
973
}
975
974
0 commit comments