-
Notifications
You must be signed in to change notification settings - Fork 485
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
VITIS-12792 HIP Binding: Memory pool APIs #8268
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
2) avoid crash from getting hip mem object from null pointer 3) allow setting 0 for kernel arguments Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
…tation. Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
…t char*. Signed-off-by: Chiming <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
…hipDeviceSetMemPool(). Signed-off-by: Chiming <[email protected]>
Signed-off-by: Chiming <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
chvamshi-xilinx
approved these changes
Aug 26, 2024
Signed-off-by: Chiming Zhang <[email protected]>
retest this please |
Signed-off-by: Chiming Zhang <[email protected]>
Signed-off-by: Chiming Zhang <[email protected]>
Merging this change. Will send separate PR later if there are any cleanups.. |
aktondak
pushed a commit
to aktondak/XRT
that referenced
this pull request
Oct 8, 2024
* add hipMemsetD32Async(). Signed-off-by: Chiming Zhang <[email protected]> * fix typo. Signed-off-by: Chiming Zhang <[email protected]> * Replace hard coded name with __func__. Signed-off-by: Chiming Zhang <[email protected]> * fix staled pointer error. Signed-off-by: Chiming Zhang <[email protected]> * fix double allocation issue. Signed-off-by: Chiming Zhang <[email protected]> * fix incorrect share_ptr use. Signed-off-by: Chiming Zhang <[email protected]> * add hipMemsetD32Async(). Signed-off-by: Chiming Zhang <[email protected]> * fix typo. Signed-off-by: Chiming Zhang <[email protected]> * Replace hard coded name with __func__. Signed-off-by: Chiming Zhang <[email protected]> * fix staled pointer error. Signed-off-by: Chiming Zhang <[email protected]> * fix double allocation issue. Signed-off-by: Chiming Zhang <[email protected]> * 1) add lock in memory_database::get_hip_mem_from_addr() 2) avoid crash from getting hip mem object from null pointer 3) allow setting 0 for kernel arguments Signed-off-by: Chiming Zhang <[email protected]> * fix incorrect share_ptr use. Signed-off-by: Chiming Zhang <[email protected]> * Fix rebase error. Signed-off-by: Chiming Zhang <[email protected]> * move to_hex() into core/common/utils.h Signed-off-by: Chiming Zhang <[email protected]> * remove extra member in class copy_buffer. Signed-off-by: Chiming Zhang <[email protected]> * fix a typo. Signed-off-by: Chiming Zhang <[email protected]> * fix a typo. Signed-off-by: Chiming Zhang <[email protected]> * fix some typo and remove template use from copy_buffer class implementation. Signed-off-by: Chiming Zhang <[email protected]> * change type of err_msg argument of helper function throw_if() to const char*. Signed-off-by: Chiming <[email protected]> * fix incorrect usage of shared_ptr in copy_buffer constructor. Signed-off-by: Chiming Zhang <[email protected]> * change the place where host_vec is moved. Signed-off-by: Chiming Zhang <[email protected]> * add back missing std::move in copy_from_host_buffer_commad constructor. Signed-off-by: Chiming Zhang <[email protected]> * Add initial implementation of hip stream ordered memory allocator. Signed-off-by: Chiming Zhang <[email protected]> * Fix the size alignment in memory pool allocator. Signed-off-by: Chiming Zhang <[email protected]> * fix rebase error. Signed-off-by: Chiming Zhang <[email protected]> * fix rebase error. Signed-off-by: Chiming Zhang <[email protected]> * fix rebase error. Signed-off-by: Chiming Zhang <[email protected]> * Add comment for the choice of shared_ptr vs unique_ptr in in enqueing the async memcpy commands. Signed-off-by: Chiming Zhang <[email protected]> * Add comment for using shared_ptr for storage of pointer to memory_pool pointers. Signed-off-by: Chiming Zhang <[email protected]> * use unique_ptr for device_cache. Signed-off-by: Chiming <[email protected]> * Fix issues raised in code review. Signed-off-by: Chiming <[email protected]> * fix the error in memory::write(). Signed-off-by: Chiming <[email protected]> * remove curly braces. Signed-off-by: Chiming <[email protected]> * Fix issues in hipMallocAsync() and hipFreeAsync(). Signed-off-by: Chiming <[email protected]> * fix error found in unit testing. Signed-off-by: Chiming <[email protected]> * use sub class of hip::memory for async allocation from hip memory pool. Signed-off-by: Chiming <[email protected]> * fix the error in sub mem lookup from memory_database. Signed-off-by: Chiming <[email protected]> * remove sub_mem address map. Signed-off-by: Chiming <[email protected]> * code clean up. Signed-off-by: Chiming <[email protected]> * add code for hipDeviceGetDefaultMemPool(), hipDeviceGetMemPool() and hipDeviceSetMemPool(). Signed-off-by: Chiming <[email protected]> * fix nullptr error. Signed-off-by: Chiming <[email protected]> * Fix compile error on Linux. Signed-off-by: Chiming Zhang <[email protected]> * Fix compile warning caused by using "int" type. Signed-off-by: Chiming Zhang <[email protected]> * fix compile error in release builds. Signed-off-by: Chiming Zhang <[email protected]> * Fix compile error. Signed-off-by: Chiming Zhang <[email protected]> --------- Signed-off-by: Chiming Zhang <[email protected]> Signed-off-by: Chiming <[email protected]> Co-authored-by: Chiming <[email protected]>
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.
Problem solved by the commit
add initial implementation of hip stream ordered memory allocator.
How problem was solved, alternative solutions (if any) and why they were rejected
N/A
Risks (if any) associated the changes in the commit
None. Code will only be built with switch "-hip".
What has been tested and how, request additional testing if necessary
Compiled and tested on Ubuntu 22.04 (running on Ryzen 7840).
Documentation impact (if any)
None.