Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions python/rmm/rmm/librmm/memory_resource.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,6 @@ cdef extern from "<cuda/memory_resource>" namespace "cuda::mr" nogil:
any_resource() except +
any_resource(device_async_resource_ref) except +


# Inline C++ helper to convert device_async_resource_ref to
# any_resource<device_accessible> for passing to constructor parameters.
# Needed because Cython wraps intermediate values in __Pyx_FakeReference<T>,
# a proxy with operator T&(). CCCL's any_resource only has a constrained
# forwarding constructor that cannot see through this proxy. A free function
# performs the conversion in pure C++ where it works directly.
# TODO: Remove once CCCL merges NVIDIA/cccl#8320 and RMM upgrades.
cdef extern from *:
"""
#include <cuda/memory_resource>
#include <rmm/resource_ref.hpp>
inline cuda::mr::any_resource<cuda::mr::device_accessible>
make_any_device_resource(rmm::device_async_resource_ref ref) {
return cuda::mr::any_resource<cuda::mr::device_accessible>(ref);
}
"""
any_resource[device_accessible] make_any_device_resource(
device_async_resource_ref) nogil except +


# Inline C++ helper to construct optional[device_async_resource_ref] from any
# concrete resource type. Returns optional so that Cython assignment
# (self.c_ref = make_device_async_resource_ref(...)) uses optional's
Expand Down
Loading