File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1696,6 +1696,7 @@ ur_result_t ur_queue_handle_t_::synchronize() {
1696
1696
// If event is discarded then it can be in reset state or underlying level
1697
1697
// zero handle can have device scope, so we can't synchronize the last
1698
1698
// event.
1699
+ auto savedLastCommandEvent = LastCommandEvent;
1699
1700
if (isInOrderQueue () && !LastCommandEvent->IsDiscarded ) {
1700
1701
ZE2UR_CALL (zeHostSynchronize, (LastCommandEvent->ZeEvent ));
1701
1702
@@ -1737,7 +1738,12 @@ ur_result_t ur_queue_handle_t_::synchronize() {
1737
1738
}
1738
1739
}
1739
1740
}
1740
- LastCommandEvent = nullptr ;
1741
+ // If the current version of the LastCommandEvent == savedLastCommandEvent,
1742
+ // then LastCommandEvent = nullptr; Otherwise, if LastCommandEvent !=
1743
+ // savedLastCommandEvent, then LastCommandEvent is unchanged.
1744
+ if (LastCommandEvent == savedLastCommandEvent) {
1745
+ LastCommandEvent = nullptr ;
1746
+ }
1741
1747
}
1742
1748
1743
1749
// Since all timestamp recordings should have finished with the
You can’t perform that action at this time.
0 commit comments