-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add get_upstream_resource
to resource adaptors
#1456
Add get_upstream_resource
to resource adaptors
#1456
Conversation
We want to get rid of the raw `get_upstream` method. In order to achieve that we need to add an alternative that is based on our new `rmm::device_async_resource_ref` I am a stickler to consistency so I also cleaned the documentation of `get_upstream` up and added `[[nodiscard]]` closes rapidsai#1455
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you. Should we standardize the interface of resource adaptors somehow? I've often felt that MRs would be more composable if there were some common interface for accessing upstream MRs.
I believe we are on a good way. When moving everything towards |
But adaptors, suballocators, etc. will always have upstream resource refs. Just wondering if we need a legislated way to get the ref, or if we just stick with a de facto interface. |
I mean my thought was that we will just keep going with |
I believe @harrism is asking about adding a |
Coming back to this, I am all for providing a well defined way of extracting the upstream resource However, we want to make sure that we have the right one. Currently we have If we want to introduce a concept that checks whether an upstream resource is provided we need to decide whether we want |
My 2c: I think |
Co-authored-by: Mark Harris <[email protected]>
I also adopted `pool_memory_resource` and `thrust_allocator_adaptor` to use the new interface. We only added it this release AFAIK so it should not be used yet and we should settle on a universal design
@@ -121,9 +121,12 @@ class thrust_allocator : public thrust::device_malloc_allocator<T> { | |||
} | |||
|
|||
/** | |||
* @briefreturn{The resource used to allocate and deallocate} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has just been added in the recent push so I am pretty sure it is safe to rename the method so that it is consistent with the other adaptors
/merge |
I generally like to get 2 C++ codeowner approvals before merging. Just ping the auto-assigned reviewers if it has been a while. |
We want to get rid of the raw
get_upstream
method. In order to achieve that we need to add an alternative that is based on our newrmm::device_async_resource_ref
I am a stickler to consistency so I also cleaned the documentation of
get_upstream
up and added[[nodiscard]]
closes #1455