Skip to content

Remove bridge infrastructure and device_memory_resource#2324

Draft
bdice wants to merge 5 commits intorapidsai:stagingfrom
bdice:delete-device-memory-resource
Draft

Remove bridge infrastructure and device_memory_resource#2324
bdice wants to merge 5 commits intorapidsai:stagingfrom
bdice:delete-device-memory-resource

Conversation

@bdice
Copy link
Collaborator

@bdice bdice commented Mar 20, 2026

⚠️ This PR builds on top of #2301. It should be reviewed and merged after that PR lands.

Summary

  • Delete device_memory_resource.hpp and device_memory_resource_view.hpp
  • Remove pointer-based per_device_resource APIs and bridge helpers
  • Simplify cccl_adaptors.hpp (remove DMR bridge code, retain wrapper for deletion in a follow-up)
  • Rewrite test mock resources (mock_resource.hpp, device_check_resource_adaptor.hpp) to use CCCL concepts directly
  • Update callback_memory_resource, aligned, arena, and failure_callback tests

Closes #2296
Part of #2011

bdice added 5 commits March 17, 2026 23:44
…tors

Remove the device_memory_resource virtual base class inheritance from all
production memory resources, adaptors, and stream_ordered_memory_resource.

Resources now derive publicly from cuda::mr::shared_resource<Impl> (for
stateful/adaptor types) or stand alone with direct CCCL concept methods
(for stateless types). The legacy do_allocate/do_deallocate/do_is_equal
virtual overrides and pointer-based per-device-resource APIs are removed.

stream_ordered_memory_resource provides allocate/deallocate/allocate_sync/
deallocate_sync directly instead of through the DMR virtual dispatch.

All 103 C++ tests and 1165 Python tests pass.
Rewrite benchmark factory functions from shared_ptr<device_memory_resource>
to any_device_resource, convert simulated_memory_resource from DMR
inheritance to CCCL concepts, and change copy/move from = delete to
= default on cuda_async_memory_resource, cuda_async_managed_memory_resource,
sam_headroom_memory_resource, and simulated_memory_resource to satisfy
CCCL resource_ref copyability requirements.
Delete device_memory_resource.hpp and device_memory_resource_view.hpp.
Strip DMR bridge code from cccl_adaptors.hpp, keeping shared_resource_cast
wrappers. Inline do_allocate/do_deallocate into allocate/deallocate in
stream_ordered_memory_resource. Convert benchmarks from shared_ptr<DMR> to
any_device_resource. Rewrite test mocks to satisfy CCCL concepts directly,
with copyable forwarding wrappers to work around basic_any type-erasure
limitations with GMock types. Replace reinterpret_cast stream constructions
with cuda_stream_view{}.
@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 20, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant