-
Notifications
You must be signed in to change notification settings - Fork 35
Assert if tracking provider is not empty #153
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
Assert if tracking provider is not empty #153
Conversation
great job with finding this problems :) |
Hm, I'm not sure if this is correct. We have a single critnib (hTracker) for the entire library and tracking provider is per-pool (trackingFinalize will be called on each umfPoolDestroy). This means that if we have multiple pools opened (and with active allocations), this assert will fail, even, if we are destroying a pool that did all necessary cleanup. |
@igchor ok and what about moving this code to tracker destructor? providerFini() and deleteLibTracker() |
Yes, that should work. But I think checking the leaks per each memory pool would be also good. We can implement a provider in tests, that will be a wrapper and will forward all allocs/free to the upstream provider + will count all allocs and frees. If the counter is not 0 at the end, report an error. You can see here, how you can implement a custom provider easily: https://github.com/oneapi-src/unified-memory-framework/blob/main/test/memoryPoolAPI.cpp#L205 |
5f9428b
to
79cc4e1
Compare
@igchor checking the leaks per each memory pool done :-) |
Looks good. I would just put those checks (especially the iteration in trackingFinalize) under some define (maybe just |
79cc4e1
to
5c32aa9
Compare
@igchor Done. |
See the version with all required fixes: #155 |
5c32aa9
to
887bb1f
Compare
Requires the following PRs to be merged in order to pass all CI builds (see #155): |
887bb1f
to
1ea502a
Compare
@ldorau is this PR ready to review? Could you rebase and re-run checks? |
1ea502a
to
6a710cb
Compare
Rebased and checks re-run, but not all of them pass yet :-( |
6a710cb
to
5a189e3
Compare
5a189e3
to
269ec74
Compare
Signed-off-by: Lukasz Dorau <[email protected]>
269ec74
to
273e05a
Compare
No description provided.