Skip to content
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

Ability to use temporary memory resource sets within ManagedArrays #174

Closed
rcarson3 opened this issue Jan 13, 2021 · 4 comments
Closed

Ability to use temporary memory resource sets within ManagedArrays #174

rcarson3 opened this issue Jan 13, 2021 · 4 comments

Comments

@rcarson3
Copy link
Member

@davidbeckingsale so for a library that I work on here at LLNL, I've been recently been looking at integrating CARE into it in-order to help simplify our internal memory management and our forall type kernels with the ever increasing need to support more and more hardware. I've been in talks with @adayton1 a bit about this, and he's been super helpful.

During some of our more recent discussions, I asked about how to make sure CARE uses the resource sets that an application code has told our library to use, so these would usually be resource sets associated with temporary memory. He pointed me to https://github.com/LLNL/CARE/blob/develop/src/care/care.cpp#L22, but warned me that this would change the global allocators that CHAI is using. I of course would rather avoid doing that for obvious reasons, and so @adayton1 mentioned there might be a way within CHAI to have a ManagedArray constructor take in a list of allocators which should allow me to make use of these temporary memory resource sets. Therefore, I figured it'd be a good idea to just open an issue and see if you had an advice/ideas for how best to handle this sort of use case of CHAI which could then be propagated up into CARE's use of ManagedArrays/host_device_ptrs.

@davidbeckingsale
Copy link
Member

Would this constructor work for you: https://github.com/LLNL/CHAI/blob/develop/src/chai/ManagedArray.hpp#L101 ?

See here for an example: https://github.com/LLNL/CHAI/blob/develop/examples/chai-umpire-allocators.cpp

@rcarson3
Copy link
Member Author

I believe that should work :) I should be able to use that method along with https://github.com/LLNL/CARE/blob/develop/src/care/host_device_ptr.h#L119 to at least initially prototype around with things.

@davidbeckingsale
Copy link
Member

Great! Let us know if you have any questions.

@rcarson3
Copy link
Member Author

I definitely will, and I'll reopen this issue if I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants