Store any_resource in device-resource global mapping#2200
Merged
rapids-bot[bot] merged 3 commits intorapidsai:mainfrom Jan 10, 2026
Merged
Store any_resource in device-resource global mapping#2200rapids-bot[bot] merged 3 commits intorapidsai:mainfrom
rapids-bot[bot] merged 3 commits intorapidsai:mainfrom
Conversation
Change the per-device resource ref map to store `cuda::mr::any_resource<device_accessible>` instead of `device_async_resource_ref`. This provides ownership semantics - the global map now owns the stored resources. Key changes: - `get_ref_map()` now returns map with `any_resource` values - `set_per_device_resource_ref()` reifies incoming refs to `any_resource` - `get_per_device_resource_ref()` returns refs from stored `any_resource` - Added conversion operator and constructor in `cccl_async_resource_ref` to support conversion to/from `any_resource` Note: Refs returned from get/set operations now point to the owned copy inside `any_resource`, not the original object. Tests updated to verify functional correctness rather than ref identity.
44 tasks
This reverts commit e791a1e.
This was referenced Jan 8, 2026
miscco
approved these changes
Jan 9, 2026
wence-
approved these changes
Jan 10, 2026
Collaborator
Author
|
/merge |
rapids-bot bot
pushed a commit
that referenced
this pull request
Jan 12, 2026
## Summary Part of #2011. This PR adopts `any_resource` in `device_buffer` and `device_uvector`. - Change `device_buffer::_mr` from `device_async_resource_ref` to `cuda::mr::any_resource<cuda::mr::device_accessible>` - Make `memory_resource()` non-const on `device_buffer` and `device_uvector` (required because CCCL's `resource_ref` can only be constructed from non-const `any_resource&`) - Use `std::move` for `_mr` in move constructor and move assignment This ensures `device_buffer` owns its memory resource, preventing use-after-free if the original resource is destroyed while the buffer still exists. ## Stacked PR This PR is stacked on top of #2200. To view only the changes in this PR: bdice/rmm@device-ref-map-any-resource...containers-any-resource ## Test plan - [x] RMM C++ tests pass locally - [x] cuDF C++ tests pass locally Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Yunsong Wang (https://github.com/PointKernel) URL: #2201
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.
Summary
Part of #2011.
cuda::mr::any_resource<device_accessible>instead ofdevice_async_resource_refcccl_async_resource_refto support conversion to/fromany_resourceNotes
Refs returned from
get_per_device_resource_ref()andset_per_device_resource_ref()now point to the owned copy insideany_resource, not the original object. Tests updated to verify functional correctness rather than ref identity.Test plan