Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,24 @@ ur_result_t ur_exp_command_buffer_handle_t_::finalizeCommandBuffer() {
auto commandListLocked = commandListManager.lock();
UR_ASSERT(!isFinalized, UR_RESULT_ERROR_INVALID_OPERATION);

size_t numEventResets = 0;

if (!isInOrder) {
ZE2UR_CALL(zeCommandListAppendBarrier,
(commandListLocked->getZeCommandList(), nullptr, 0, nullptr));
for (size_t i = 0; i < usedSyncPoints.size(); ++i) {
if (!usedSyncPoints[i]) {
continue;
}
++numEventResets;
ZE2UR_CALL(
zeCommandListAppendEventReset,
(commandListLocked->getZeCommandList(), syncPoints[i]->getZeEvent()));
}
ZE2UR_CALL(zeCommandListAppendBarrier,
(commandListLocked->getZeCommandList(), nullptr, 0, nullptr));

if (numEventResets)
ZE2UR_CALL(zeCommandListAppendBarrier,
(commandListLocked->getZeCommandList(), nullptr, 0, nullptr));
}
// Close the command lists and have them ready for dispatch.
ZE2UR_CALL(zeCommandListClose, (commandListLocked->getZeCommandList()));
Expand Down