Skip to content

Commit bcf389b

Browse files
author
Jaime Arteaga
committed
[SYCL][UR][L0] Add support for zeCommandListHostSynchronize
Instead of creating an event, appending it, and synchronizing on it to wait for all commands in an immediate command list, emit a zeCommandListHostSynchronize instead. Signed-off-by: Jaime Arteaga <[email protected]>
1 parent 85d8411 commit bcf389b

File tree

1 file changed

+2
-12
lines changed
  • sycl/plugins/unified_runtime/ur/adapters/level_zero

1 file changed

+2
-12
lines changed

sycl/plugins/unified_runtime/ur/adapters/level_zero/queue.cpp

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

1361-
ur_event_handle_t Event{};
1362-
ur_result_t Res = createEventAndAssociateQueue(
1363-
reinterpret_cast<ur_queue_handle_t>(Queue), &Event,
1364-
UR_EXT_COMMAND_TYPE_USER, ImmCmdList, /* IsInternal */ false);
1365-
if (Res != UR_RESULT_SUCCESS)
1366-
return Res;
1367-
auto zeEvent = Event->ZeEvent;
1368-
ZE2UR_CALL(zeCommandListAppendBarrier,
1369-
(ImmCmdList->first, zeEvent, 0, nullptr));
1370-
ZE2UR_CALL(zeHostSynchronize, (zeEvent));
1371-
Event->Completed = true;
1372-
UR_CALL(urEventRelease(Event));
1361+
// wait for all commands previously submitted to this immediate command list
1362+
ZE2UR_CALL(zeCommandListHostSynchronize, (ImmCmdList->first, UINT64_MAX));
13731363

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

0 commit comments

Comments
 (0)