Skip to content

Commit c0bc075

Browse files
authored
[SYCL] [UR] Fix issues that cause graph tests to fail (#17158)
Fixes issues with v2 level zero adapter in UR command buffer implementation, that resulted in failure of some tests in sycl/test-e2e/Graph/RecordReplay when using level zero adapter v2
1 parent f01edd3 commit c0bc075

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ command_list_cache_t::getCommandList(const command_list_descriptor_t &desc) {
169169
if (it->second.empty())
170170
ZeCommandListCache.erase(it);
171171

172+
if (std::holds_alternative<regular_command_list_descriptor_t>(desc)) {
173+
ZE2UR_CALL_THROWS(zeCommandListReset, (CommandListHandle.get()));
174+
}
175+
172176
return CommandListHandle;
173177
}
174178

unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,11 +878,16 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueGenericCommandListsExp(
878878

879879
auto [pWaitEvents, numWaitEvents] =
880880
getWaitListView(phEventWaitList, numEventsInWaitList);
881-
881+
// zeCommandListImmediateAppendCommandListsExp is not working with in-order
882+
// immediate lists what causes problems with synchronization
883+
// TODO: remove synchronization when it is not needed
884+
ZE_CALL_NOCHECK(zeCommandListHostSynchronize,
885+
(commandListManager.getZeCommandList(), UINT64_MAX));
882886
ZE2UR_CALL(zeCommandListImmediateAppendCommandListsExp,
883887
(commandListManager.getZeCommandList(), numCommandLists,
884888
phCommandLists, zeSignalEvent, numWaitEvents, pWaitEvents));
885-
889+
ZE_CALL_NOCHECK(zeCommandListHostSynchronize,
890+
(commandListManager.getZeCommandList(), UINT64_MAX));
886891
return UR_RESULT_SUCCESS;
887892
}
888893

0 commit comments

Comments
 (0)