Skip to content

Refactor thread_safe_resource_adaptor to shared CCCL MR design#2276

Merged
bdice merged 1 commit intorapidsai:stagingfrom
bdice:detemplate-thread-safe
Mar 10, 2026
Merged

Refactor thread_safe_resource_adaptor to shared CCCL MR design#2276
bdice merged 1 commit intorapidsai:stagingfrom
bdice:detemplate-thread-safe

Conversation

@bdice
Copy link
Copy Markdown
Collaborator

@bdice bdice commented Mar 6, 2026

Summary

  • Split thread_safe_resource_adaptor implementation into detail/thread_safe_resource_adaptor_impl.hpp + src/mr/detail/thread_safe_resource_adaptor_impl.cpp, using cuda::mr::shared_resource for shared ownership
  • Accept device_async_resource_ref upstream; class is now non-template
  • Add mr_ref_thread_safe_tests.cpp and integrate into cccl_adaptor_tests.cpp typed test suite
  • Update adaptor_tests.cpp type aliases, NullUpstream, and Equality tests for non-template type

Convert thread_safe_resource_adaptor from a class template to a non-template
class using the shared_resource pattern.

The adaptor now:
- Splits implementation into detail/thread_safe_resource_adaptor_impl.hpp and
  src/mr/detail/thread_safe_resource_adaptor_impl.cpp
- Inherits private cuda::mr::shared_resource<detail::thread_safe_resource_adaptor_impl>
- Accepts device_async_resource_ref upstream (not raw pointer)
- Exposes get_property for cuda::mr::device_accessible
- Is copyable via shared_resource (shared ownership semantics)

Add mr_ref_thread_safe_tests.cpp with CcclMrRef test instantiations.
Add thread_safe_resource_adaptor to cccl_adaptor_tests.cpp typed test suite.
Update adaptor_tests.cpp for non-template thread_safe type.
@bdice bdice added breaking Breaking change improvement Improvement / enhancement to an existing function labels Mar 6, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Mar 6, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@bdice
Copy link
Copy Markdown
Collaborator Author

bdice commented Mar 6, 2026

/ok to test 2fc4e7c

@bdice
Copy link
Copy Markdown
Collaborator Author

bdice commented Mar 6, 2026

This looks good, it's mostly aligned with the other MR refactorings aside from cleanup tasks I've already marked down for later. I'll admin-merge this once CI passes.

@bdice bdice moved this to In Progress in RMM Project Board Mar 6, 2026
@bdice bdice marked this pull request as ready for review March 10, 2026 20:35
@bdice bdice requested review from a team as code owners March 10, 2026 20:35
@bdice bdice requested review from shrshi and ttnghia and removed request for a team March 10, 2026 20:35
@bdice bdice merged commit 0afdd0e into rapidsai:staging Mar 10, 2026
85 of 89 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in RMM Project Board Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change improvement Improvement / enhancement to an existing function

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant