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() {
16961696 // If event is discarded then it can be in reset state or underlying level
16971697 // zero handle can have device scope, so we can't synchronize the last
16981698 // event.
1699+ auto savedLastCommandEvent = LastCommandEvent;
16991700 if (isInOrderQueue () && !LastCommandEvent->IsDiscarded ) {
17001701 ZE2UR_CALL (zeHostSynchronize, (LastCommandEvent->ZeEvent ));
17011702
@@ -1737,7 +1738,12 @@ ur_result_t ur_queue_handle_t_::synchronize() {
17371738 }
17381739 }
17391740 }
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+ }
17411747 }
17421748
17431749 // Since all timestamp recordings should have finished with the
You can’t perform that action at this time.
0 commit comments