Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Cython to use resource_ref instead of device_memory_resource* #1500

Open
1 task
Tracked by #1445
harrism opened this issue Mar 6, 2024 · 0 comments
Open
1 task
Tracked by #1445
Assignees
Labels
feature request New feature or request Python Related to RMM Python API

Comments

@harrism
Copy link
Member

harrism commented Mar 6, 2024

As part of the cuda::mr refactoring, eventually there will be no device_memory_resource base class on the C++ side, instead everything will use the relevant type-erased concepts.

In cython, we currently map device_memory_resource onto a cdef DeviceMemoryResource base class that is responsible for keeping the C++ mr alive:

cdef class DeviceMemoryResource:
    shared_ptr[device_memory_resource] mr
    cdef device_memory_resource *get_mr(self)

The get_mr function is used when we need to pass the mr pointer into a C++ API.

There is, in addition, a class hierarchy that builds the various adaptor mrs on top of this (pool, logging, etc...). But this doesn't rely particularly on the existing C++ class hierarchy except that every C++ adaptor mr is-a device_memory_resource (and so can be stored in the same shared_ptr struct slot). This ability goes away once the inheritance disappears on the C++ side.

Tasks

  1. feature request
    wence-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Python Related to RMM Python API
Projects
Status: Todo
Development

No branches or pull requests

2 participants