We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccd73c7 commit 8ccf75aCopy full SHA for 8ccf75a
source/adapters/level_zero/event.cpp
@@ -691,7 +691,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventWait(
691
692
ze_event_handle_t ZeEvent = HostVisibleEvent->ZeEvent;
693
logger::debug("ZeEvent = {}", ur_cast<std::uintptr_t>(ZeEvent));
694
- ZE2UR_CALL(zeHostSynchronize, (ZeEvent));
+ // If this event was an inner batched event, then lock and sync with
695
+ // the Queue instead of waiting on the event.
696
+ if (HostVisibleEvent->IsInnerBatchedEvent && Event->UrQueue) {
697
+ std::scoped_lock<ur_shared_mutex> Lock(Event->UrQueue->Mutex);
698
+ UR_CALL(Event->UrQueue->synchronize());
699
+ } else {
700
+ ZE2UR_CALL(zeHostSynchronize, (ZeEvent));
701
+ }
702
Event->Completed = true;
703
}
704
0 commit comments