Skip to content

Commit a1f66a9

Browse files
authored
Revert "Fix potential deadlock in the WaitEvent path of CmdBuffers"
1 parent ba13487 commit a1f66a9

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

source/adapters/level_zero/command_buffer.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,28 +1682,25 @@ ur_result_t enqueueWaitEventPath(ur_exp_command_buffer_handle_t CommandBuffer,
16821682
(ZeCopyCommandQueue, 1, &CommandBuffer->ZeCopyCommandList, nullptr));
16831683
}
16841684

1685-
ZE2UR_CALL(zeCommandListAppendBarrier,
1686-
(SignalCommandList->first, nullptr, 1,
1687-
&(CommandBuffer->ExecutionFinishedEvent->ZeEvent)));
1688-
16891685
// Reset the wait-event for the UR command-buffer that is signaled when its
16901686
// submission dependencies have been satisfied.
16911687
ZE2UR_CALL(zeCommandListAppendEventReset,
16921688
(SignalCommandList->first, CommandBuffer->WaitEvent->ZeEvent));
1693-
16941689
// Reset the all-reset-event for the UR command-buffer that is signaled when
16951690
// all events of the main command-list have been reset.
16961691
ZE2UR_CALL(zeCommandListAppendEventReset,
16971692
(SignalCommandList->first, CommandBuffer->AllResetEvent->ZeEvent));
16981693

16991694
if (DoProfiling) {
17001695
UR_CALL(appendProfilingQueries(CommandBuffer, SignalCommandList->first,
1701-
nullptr, nullptr));
1696+
*Event,
1697+
CommandBuffer->ExecutionFinishedEvent));
1698+
} else {
1699+
ZE2UR_CALL(zeCommandListAppendBarrier,
1700+
(SignalCommandList->first, (*Event)->ZeEvent, 1,
1701+
&(CommandBuffer->ExecutionFinishedEvent->ZeEvent)));
17021702
}
17031703

1704-
ZE2UR_CALL(zeCommandListAppendBarrier,
1705-
(SignalCommandList->first, (*Event)->ZeEvent, 0, nullptr));
1706-
17071704
UR_CALL(Queue->executeCommandList(SignalCommandList, false /*IsBlocking*/,
17081705
false /*OKToBatchCommand*/));
17091706

0 commit comments

Comments
 (0)