Skip to content

Derive pinned_host_memory_resource from device_memory_resource#2102

Merged
rapids-bot[bot] merged 1 commit intorapidsai:mainfrom
bdice:pinned-host-mr-derive-from-device-mr
Oct 27, 2025
Merged

Derive pinned_host_memory_resource from device_memory_resource#2102
rapids-bot[bot] merged 1 commit intorapidsai:mainfrom
bdice:pinned-host-mr-derive-from-device-mr

Conversation

@bdice
Copy link
Copy Markdown
Collaborator

@bdice bdice commented Oct 24, 2025

Makes pinned_host_memory_resource derive from device_memory_resource by implementing the standard do_allocate, do_deallocate, and do_is_equal interface.

This is one step contributing to #2090 and is a prerequisite for #1429 / #2105.

Unblocks follow-up work:

@bdice bdice requested a review from a team as a code owner October 24, 2025 05:01
@bdice bdice requested review from ttnghia and vyasr October 24, 2025 05:01
@bdice bdice self-assigned this Oct 24, 2025
@bdice bdice added non-breaking Non-breaking change improvement Improvement / enhancement to an existing function breaking Breaking change and removed non-breaking Non-breaking change labels Oct 24, 2025
@bdice
Copy link
Copy Markdown
Collaborator Author

bdice commented Oct 24, 2025

Marking as breaking because the inheritance has changed for pinned_host_memory_resource, and it is now final (like other concrete memory resource implementations in RMM).

[[maybe_unused]] std::size_t alignment = rmm::RMM_DEFAULT_HOST_ALIGNMENT)
void* do_allocate(std::size_t bytes, [[maybe_unused]] cuda_stream_view stream) override
{
RMM_FUNC_RANGE();
Copy link
Copy Markdown

@ttnghia ttnghia Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these macros removed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ranges are supposed to be handled by the parent class's [de]allocate[_sync] in places like this:

@bdice
Copy link
Copy Markdown
Collaborator Author

bdice commented Oct 27, 2025

/merge

@rapids-bot rapids-bot Bot merged commit 5300235 into rapidsai:main Oct 27, 2025
153 of 155 checks passed
rapids-bot Bot pushed a commit that referenced this pull request Oct 28, 2025
rapids-bot Bot pushed a commit to rapidsai/cuvs that referenced this pull request Oct 30, 2025
…ource (#1466)

Removes custom `cuda_pinned_resource` implementation and uses `rmm::mr::pinned_host_memory_resource` directly.

Depends on rapidsai/rmm#2102.

Closes #754.

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Artem M. Chirkin (https://github.com/achirkin)

URL: #1466
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.

4 participants