Skip to content

Commit 6db9291

Browse files
committed
[L0] Maintain Lock of Queue while syncing the Last Command Event
- To avoid usecases where the LastcommandEvent could be updated in another thread and a thread can be expecting the Queue Wait to include this event, then hold the queue lock such that the last command event remains unchanged during synchronization. Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent b13c5e1 commit 6db9291

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

source/adapters/level_zero/queue.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,14 +1697,7 @@ ur_result_t ur_queue_handle_t_::synchronize() {
16971697
// zero handle can have device scope, so we can't synchronize the last
16981698
// event.
16991699
if (isInOrderQueue() && !LastCommandEvent->IsDiscarded) {
1700-
if (UrL0QueueSyncNonBlocking) {
1701-
auto SyncZeEvent = LastCommandEvent->ZeEvent;
1702-
this->Mutex.unlock();
1703-
ZE2UR_CALL(zeHostSynchronize, (SyncZeEvent));
1704-
this->Mutex.lock();
1705-
} else {
1706-
ZE2UR_CALL(zeHostSynchronize, (LastCommandEvent->ZeEvent));
1707-
}
1700+
ZE2UR_CALL(zeHostSynchronize, (LastCommandEvent->ZeEvent));
17081701

17091702
// clean up all events known to have been completed as well,
17101703
// so they can be reused later

0 commit comments

Comments
 (0)