-
Notifications
You must be signed in to change notification settings - Fork 789
[SYCL] fix for leaking commands when exception thrown #16618
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
Changes from all commits
28de9d5
7279592
e24a731
626a833
9401ae1
a03da62
113927d
59ae241
5ac2f12
ea2fe36
194b47e
0d064b9
ce964b9
fd0052b
e85ac9b
334dfcf
fa814ca
724d6e0
2e61843
b396f7f
392a1fa
1bd79cb
32de860
db91aba
de45858
fce2915
6969256
7d08a9b
d8058c6
d7730d8
802858e
ec4ee66
ea328de
6193172
46490bc
432ecd6
e61ccfa
442d496
a20e93b
3978329
eea07da
7afd027
6fdfa2e
fac5ffa
134e3a9
9f5556f
c088821
bde54c6
f2b9298
a6ae675
92c9725
10ac7ca
cf5d553
f85aa0f
a95284c
6314b63
f12f495
cf8c1b4
979d6b2
8d111f1
caedef9
3b93f64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -486,6 +486,9 @@ Scheduler::GraphBuilder::addCopyBack(Requirement *Req, | |
|
||
std::vector<Command *> ToCleanUp; | ||
for (Command *Dep : Deps) { | ||
if (Dep->MEnqueueStatus == EnqueueResultT::SyclEnqueueFailed) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is too common change and could happen in the middle of program. I think it is not correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is definitely correct. I'm about to separate this out into its own PR, but what is happening is that we are enqueuing a set of dependencies/requirements and a command, during which an exception is thrown (and caught and rethrown). This sets the result to EnqueuFailed, but only for that particular item, not for things that depend on it (or vice versa). The Command pointers are all loose pointers, not smart pointers. So at the time of the exception some of that set is already in the DAG and then abandoned, and they leak. There is no other way to get the EnqueueFailed status. So the fix is to be more diligent about checking for EnqueuFailed and avoid the leak that way. And this strategy applies to the buffer destructors as well. |
||
continue; | ||
|
||
Command *ConnCmd = MemCpyCmd->addDep( | ||
DepDesc{Dep, MemCpyCmd->getRequirement(), SrcAllocaCmd}, ToCleanUp); | ||
if (ConnCmd) | ||
|
Uh oh!
There was an error while loading. Please reload this page.