@@ -939,7 +939,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
939
939
// Create a command-list to signal RetEvent on completion
940
940
ur_command_list_ptr_t SignalCommandList{};
941
941
if (Event) {
942
- ur_event_handle_t SyncEvent = CommandBuffer->SignalEvent ;
943
942
UR_CALL (Queue->Context ->getAvailableCommandList (Queue, SignalCommandList,
944
943
false , false ));
945
944
@@ -954,9 +953,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
954
953
// before completing the command buffer execution, and then attach this
955
954
// memory to the event returned to users to allow to allow the profiling
956
955
// engine to recover these timestamps.
957
- UR_CALL (createEventAndAssociateQueue (
958
- Queue, &SyncEvent, UR_COMMAND_USM_MEMCPY, SignalCommandList, false ));
959
-
960
956
command_buffer_profiling_t *Profiling = new command_buffer_profiling_t ();
961
957
962
958
Profiling->NumEvents = WaitEventList.size ();
@@ -966,15 +962,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
966
962
ZE2UR_CALL (zeCommandListAppendQueryKernelTimestamps,
967
963
(SignalCommandList->first , WaitEventList.size (),
968
964
WaitEventList.data (), (void *)Profiling->Timestamps , 0 ,
969
- SyncEvent ->ZeEvent , 1 ,
965
+ RetEvent ->ZeEvent , 1 ,
970
966
&(CommandBuffer->SignalEvent ->ZeEvent )));
971
967
972
968
RetEvent->CommandData = static_cast <void *>(Profiling);
969
+ } else {
970
+ ZE2UR_CALL (zeCommandListAppendBarrier,
971
+ (SignalCommandList->first , RetEvent->ZeEvent , 1 ,
972
+ &(CommandBuffer->SignalEvent ->ZeEvent )));
973
973
}
974
-
975
- ZE2UR_CALL (zeCommandListAppendBarrier,
976
- (SignalCommandList->first , RetEvent->ZeEvent , 1 ,
977
- &(SyncEvent->ZeEvent )));
978
974
}
979
975
980
976
// Execution our command-lists asynchronously
0 commit comments