Skip to content

[SYCL][L0] Fix memory leak in USM prefetch #5461

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 20 commits into from
Feb 3, 2022
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f62375d
[SYCL][L0] return error code when ZE_DEBUG=4 detects memory leaks.
bso-intel Dec 22, 2021
7d9755e
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Dec 24, 2021
84b6710
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Dec 27, 2021
534f424
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Dec 28, 2021
81b4db5
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Dec 30, 2021
0c249f1
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 4, 2022
200f8ea
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 7, 2022
aaed454
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 11, 2022
d1c6404
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 20, 2022
1032a47
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 20, 2022
abbc3a0
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 24, 2022
1b2bcc7
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 25, 2022
4657e3b
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Jan 28, 2022
39515bd
Merge remote-tracking branch 'upstream/sycl' into sycl
bso-intel Feb 2, 2022
57dc2c2
[SYCL][L0] Fix memory leak in USM prefetch.
bso-intel Feb 2, 2022
1b8a422
removed the other call.
bso-intel Feb 2, 2022
50b60ea
Revert "removed the other call."
bso-intel Feb 2, 2022
f270be9
Merge remote-tracking branch 'upstream/sycl' into prefetch-leak
bso-intel Feb 2, 2022
c9a291d
remove the other call to createAndReainPiZeEventList.
bso-intel Feb 2, 2022
833e55e
clang-format
bso-intel Feb 2, 2022
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
10 changes: 6 additions & 4 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7319,6 +7319,11 @@ pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
// Lock automatically releases when this goes out of scope.
std::lock_guard<std::mutex> lock(Queue->PiQueueMutex);

/**
* @brief Please note that the following code should be run before the
* subsequent getAvailableCommandList() call so that there is no
* dead-lock from waiting unsubmitted events in an open batch.
*/
_pi_ze_event_list_t TmpWaitList;
if (auto Res = TmpWaitList.createAndRetainPiZeEventList(NumEventsInWaitList,
EventWaitList, Queue))
Expand All @@ -7339,10 +7344,7 @@ pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
if (Res != PI_SUCCESS)
return Res;
ZeEvent = (*Event)->ZeEvent;

if (auto Res = (*Event)->WaitList.createAndRetainPiZeEventList(
NumEventsInWaitList, EventWaitList, Queue))
return Res;
(*Event)->WaitList = TmpWaitList;

const auto &WaitList = (*Event)->WaitList;
const auto &ZeCommandList = CommandList->first;
Expand Down