Skip to content

Commit 7535752

Browse files
authored
[SYCL][L0] Avoid resetting same command list multiple times (#5529)
1 parent b831bd0 commit 7535752

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,13 @@ pi_result _pi_queue::resetCommandList(pi_command_list_ptr_t CommandList,
865865
// synchronized above already does that.
866866
auto &EventList = CommandList->second.EventList;
867867
for (auto &Event : EventList) {
868+
// All events in this loop are in the same command list which has been just
869+
// reset above. We don't want cleanup() to reset same command list again for
870+
// all events in the loop so set it to nullptr.
871+
Event->ZeCommandList = nullptr;
868872
if (!Event->CleanedUp) {
869873
Event->cleanup(this);
870874
}
871-
Event->ZeCommandList = nullptr;
872875
PI_CALL(EventRelease(Event, this));
873876
}
874877
EventList.clear();

0 commit comments

Comments
 (0)