Skip to content

[FEA] Remove bridge infrastructure and device_memory_resource #2296

@bdice

Description

@bdice

Remove bridge infrastructure and device_memory_resource

Part of #2011. Depends on removal of device_memory_resource inheritance (#2295).

Problem

After #2295, no resource inherits from device_memory_resource, but the class
and its bridge infrastructure still exist:

  1. device_memory_resource (cpp/include/rmm/mr/device_memory_resource.hpp)
  2. device_memory_resource_view (cpp/include/rmm/mr/detail/device_memory_resource_view.hpp)
  3. Pointer-based per_device_resource APIs and bridge helpers
  4. cccl_adaptors.hpp wrapper is simplified but retained (deleted in [FEA] Delete cccl_adaptors.hpp and use raw CCCL resource_ref types #2323)

With no resource inheriting from device_memory_resource, these components are
dead code and can be deleted.

Goal

After this work:

  • device_memory_resource.hpp is deleted
  • device_memory_resource_view.hpp is deleted
  • Pointer-based per_device_resource APIs are removed
  • to_device_async_resource_ref_checked and similar bridge helpers are removed
  • cccl_adaptors.hpp is simplified (most bridge code removed, but file retained
    for deletion in [FEA] Delete cccl_adaptors.hpp and use raw CCCL resource_ref types #2323)
  • Test mock resources (mock_resource.hpp, device_check_resource_adaptor.hpp)
    use CCCL concepts directly

Branch

delete-device-memory-resource (based on remove-dmr-inheritance)

5 commits (#2295's 4 + 1):

Tasks

1. Delete device_memory_resource_view

File: cpp/include/rmm/mr/detail/device_memory_resource_view.hpp

  • Delete the file
  • Remove all #include directives referencing it

2. Delete device_memory_resource.hpp

File: cpp/include/rmm/mr/device_memory_resource.hpp

  • Delete the file
  • Remove all #include directives across the codebase

3. Simplify cccl_adaptors.hpp

File: cpp/include/rmm/detail/cccl_adaptors.hpp

4. Remove pointer-based per_device_resource APIs and bridge helpers

File: cpp/include/rmm/mr/per_device_resource.hpp

  • Remove get_per_device_resource() returning device_memory_resource*
  • Remove set_per_device_resource() accepting device_memory_resource*
  • Remove get_current_device_resource() returning device_memory_resource*
  • Remove set_current_device_resource() accepting device_memory_resource*
  • Remove to_device_async_resource_ref_checked and similar helpers

5. Update test infrastructure

  • Rewrite mock_resource.hpp to satisfy CCCL concepts directly
  • Rewrite device_check_resource_adaptor.hpp for CCCL concepts
  • Update callback_memory_resource tests
  • Update aligned, arena, failure_callback test files
  • Update stream_ordered_memory_resource to remove DMR dependencies

Validation

  • build-rmm-cpp -j0 succeeds (with -DBUILD_BENCHMARKS=ON)
  • All 103 C++ tests pass (test-rmm-cpp)
  • build-rmm-python -j0 succeeds
  • All 1781 Python tests pass (test-rmm-python)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    To-do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions