Skip to content

[SYCL] [L0] Fix for event leakage when using immediate commandlists. #7546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,13 +1036,15 @@ _pi_queue::resetCommandList(pi_command_list_ptr_t CommandList,
EventList.clear();
} else {
// For immediate commandlist reset only those events that have signalled.
for (auto it = EventList.begin(); it != EventList.end(); it++) {
for (auto it = EventList.begin(); it != EventList.end();) {
std::scoped_lock<pi_shared_mutex> EventLock((*it)->Mutex);
ze_result_t ZeResult =
ZE_CALL_NOCHECK(zeEventQueryStatus, ((*it)->ZeEvent));
if (ZeResult == ZE_RESULT_SUCCESS) {
std::move(it, it, std::back_inserter(EventListToCleanup));
EventList.erase(it, it);
EventListToCleanup.push_back(std::move((*it)));
it = EventList.erase(it);
} else {
it++;
}
}
}
Expand Down