diff --git a/source/adapters/level_zero/command_buffer.cpp b/source/adapters/level_zero/command_buffer.cpp index b96aeeede9..3e36d828d6 100644 --- a/source/adapters/level_zero/command_buffer.cpp +++ b/source/adapters/level_zero/command_buffer.cpp @@ -834,6 +834,16 @@ finalizeWaitEventPath(ur_exp_command_buffer_handle_t CommandBuffer) { (CommandBuffer->ZeCommandListResetEvents, CommandBuffer->ExecutionFinishedEvent->ZeEvent)); + // Reset the wait-event for the UR command-buffer that is signaled when its + // submission dependencies have been satisfied. + ZE2UR_CALL(zeCommandListAppendEventReset, + (CommandBuffer->ZeComputeCommandList, CommandBuffer->WaitEvent->ZeEvent)); + + // Reset the all-reset-event for the UR command-buffer that is signaled when + // all events of the main command-list have been reset. + ZE2UR_CALL(zeCommandListAppendEventReset, + (CommandBuffer->ZeComputeCommandList, CommandBuffer->AllResetEvent->ZeEvent)); + if (CommandBuffer->IsInOrderCmdList) { ZE2UR_CALL(zeCommandListAppendSignalEvent, (CommandBuffer->ZeComputeCommandList, @@ -1683,15 +1693,6 @@ ur_result_t enqueueWaitEventPath(ur_exp_command_buffer_handle_t CommandBuffer, (ZeCopyCommandQueue, 1, &CommandBuffer->ZeCopyCommandList, nullptr)); } - // Reset the wait-event for the UR command-buffer that is signaled when its - // submission dependencies have been satisfied. - ZE2UR_CALL(zeCommandListAppendEventReset, - (SignalCommandList->first, CommandBuffer->WaitEvent->ZeEvent)); - // Reset the all-reset-event for the UR command-buffer that is signaled when - // all events of the main command-list have been reset. - ZE2UR_CALL(zeCommandListAppendEventReset, - (SignalCommandList->first, CommandBuffer->AllResetEvent->ZeEvent)); - if (DoProfiling) { UR_CALL(appendProfilingQueries(CommandBuffer, SignalCommandList->first, *Event,