Free unlocked buffers before tests run in rng quality tests#3151
Merged
9prady9 merged 2 commits intoarrayfire:masterfrom Jun 22, 2021
Merged
Free unlocked buffers before tests run in rng quality tests#31519prady9 merged 2 commits intoarrayfire:masterfrom
9prady9 merged 2 commits intoarrayfire:masterfrom
Conversation
This is needed when running rng quality tests on lesser memory cards where higher memory usage is causing out of memory issues.
willyborn
reviewed
Jun 22, 2021
| virtual void SetUp() { | ||
| //Ensure all unlocked buffers are freed | ||
| // Ensure all unlocked buffers are freed | ||
| deviceGC(); |
Contributor
There was a problem hiding this comment.
If you want to unlock all buffers, you need to add af::sync() before the deviceGC().
Without the sync, the buffers which are still in use by executing kernels will not be freed.
Member
Author
There was a problem hiding this comment.
That is not the case with deviceGC in this location. When test finishes, all arrays involved are already evaluated because they need to be brought to host for comparison. So, they will be marked as unused by the time this line hits before the next test starts.
Member
There was a problem hiding this comment.
Additionally all allocation and free function are device synchronization events.
umar456
approved these changes
Jun 22, 2021
syurkevi
pushed a commit
that referenced
this pull request
Dec 28, 2021
* Free unlocked buffers before tests run in rng quality tests This is needed when running rng quality tests on lesser memory cards where higher memory usage is causing out of memory issues. * Fix formatting (cherry picked from commit bde5bd2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is needed when running rng quality tests on lesser memory cards
where higher memory usage is causing out of memory issues.
Changes to Users
None
Checklist
[ ] Functions added to unified API[ ] Functions documented