Skip to content

Commit

Permalink
Revert "Merge pull request #1028 from jandres742/listhostsync"
Browse files Browse the repository at this point in the history
This reverts commit 62e6d2f, reversing
changes made to ba27855.
  • Loading branch information
kbenzie committed Nov 9, 2023
1 parent 8a59336 commit 936d7d8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/adapters/level_zero/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,18 @@ ur_result_t ur_queue_handle_t_::synchronize() {
if (ImmCmdList == Queue->CommandListMap.end())
return UR_RESULT_SUCCESS;

// wait for all commands previously submitted to this immediate command list
ZE2UR_CALL(zeCommandListHostSynchronize, (ImmCmdList->first, UINT64_MAX));
ur_event_handle_t Event{};
ur_result_t Res = createEventAndAssociateQueue(
reinterpret_cast<ur_queue_handle_t>(Queue), &Event,
UR_EXT_COMMAND_TYPE_USER, ImmCmdList, /* IsInternal */ false);
if (Res != UR_RESULT_SUCCESS)
return Res;
auto zeEvent = Event->ZeEvent;
ZE2UR_CALL(zeCommandListAppendBarrier,
(ImmCmdList->first, zeEvent, 0, nullptr));
ZE2UR_CALL(zeHostSynchronize, (zeEvent));
Event->Completed = true;
UR_CALL(urEventRelease(Event));

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

0 comments on commit 936d7d8

Please sign in to comment.