Skip to content

Commit 62e6d2f

Browse files
authored
Merge pull request #1028 from jandres742/listhostsync
[UR][L0] Add support for zeCommandListHostSynchronize
2 parents ba27855 + 3b26f7b commit 62e6d2f

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

source/adapters/level_zero/queue.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,18 +1406,8 @@ ur_result_t ur_queue_handle_t_::synchronize() {
14061406
if (ImmCmdList == Queue->CommandListMap.end())
14071407
return UR_RESULT_SUCCESS;
14081408

1409-
ur_event_handle_t Event{};
1410-
ur_result_t Res = createEventAndAssociateQueue(
1411-
reinterpret_cast<ur_queue_handle_t>(Queue), &Event,
1412-
UR_EXT_COMMAND_TYPE_USER, ImmCmdList, /* IsInternal */ false);
1413-
if (Res != UR_RESULT_SUCCESS)
1414-
return Res;
1415-
auto zeEvent = Event->ZeEvent;
1416-
ZE2UR_CALL(zeCommandListAppendBarrier,
1417-
(ImmCmdList->first, zeEvent, 0, nullptr));
1418-
ZE2UR_CALL(zeHostSynchronize, (zeEvent));
1419-
Event->Completed = true;
1420-
UR_CALL(urEventRelease(Event));
1409+
// wait for all commands previously submitted to this immediate command list
1410+
ZE2UR_CALL(zeCommandListHostSynchronize, (ImmCmdList->first, UINT64_MAX));
14211411

14221412
// Cleanup all events from the synced command list.
14231413
CleanupEventListFromResetCmdList(ImmCmdList->second.EventList, true);

0 commit comments

Comments
 (0)