From ceb0465d40908fed5319a93e472d6ea2a11b7c00 Mon Sep 17 00:00:00 2001 From: Martin Grant Date: Fri, 3 Jan 2025 15:57:21 +0000 Subject: [PATCH] Revert "Fix potential deadlock in the WaitEvent path of CmdBuffers" --- source/adapters/level_zero/command_buffer.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source/adapters/level_zero/command_buffer.cpp b/source/adapters/level_zero/command_buffer.cpp index f5ca71a706..c4d9614159 100644 --- a/source/adapters/level_zero/command_buffer.cpp +++ b/source/adapters/level_zero/command_buffer.cpp @@ -1682,15 +1682,10 @@ ur_result_t enqueueWaitEventPath(ur_exp_command_buffer_handle_t CommandBuffer, (ZeCopyCommandQueue, 1, &CommandBuffer->ZeCopyCommandList, nullptr)); } - ZE2UR_CALL(zeCommandListAppendBarrier, - (SignalCommandList->first, nullptr, 1, - &(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, (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, @@ -1698,12 +1693,14 @@ ur_result_t enqueueWaitEventPath(ur_exp_command_buffer_handle_t CommandBuffer, if (DoProfiling) { UR_CALL(appendProfilingQueries(CommandBuffer, SignalCommandList->first, - nullptr, nullptr)); + *Event, + CommandBuffer->ExecutionFinishedEvent)); + } else { + ZE2UR_CALL(zeCommandListAppendBarrier, + (SignalCommandList->first, (*Event)->ZeEvent, 1, + &(CommandBuffer->ExecutionFinishedEvent->ZeEvent))); } - ZE2UR_CALL(zeCommandListAppendBarrier, - (SignalCommandList->first, (*Event)->ZeEvent, 0, nullptr)); - UR_CALL(Queue->executeCommandList(SignalCommandList, false /*IsBlocking*/, false /*OKToBatchCommand*/));