Memory resource that provides pinned (page-locked) host memory using a pool. More...
#include <pinned_memory_resource.hpp>
Public Member Functions | |
| void * | allocate (cuda::stream_ref stream, std::size_t size, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
| Allocates pinned host memory associated with a CUDA stream. More... | |
| void | deallocate (cuda::stream_ref stream, void *ptr, std::size_t size, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept |
| Deallocates pinned host memory associated with a CUDA stream. More... | |
| bool | operator== (PinnedMemoryResource const &other) const noexcept |
| Equality comparison. More... | |
| std::int64_t | current_allocated () const noexcept |
| Returns the total number of currently allocated bytes. More... | |
| ScopedMemoryRecord | get_main_memory_record () const |
| Returns the main memory record for the pinned pool. More... | |
| constexpr PinnedPoolProperties const & | properties () const noexcept |
| Returns the properties used to configure the pool. More... | |
Public Member Functions inherited from rapidsmpf::BackRefMixin< BufferResource > | |
| BackRefMixin () noexcept=default | |
| Construct a mixin with no installed back-reference. | |
| BackRefMixin (BackRefMixin const &other) | |
Acquire shared ownership of other's back-referenced owner. More... | |
| BackRefMixin (BackRefMixin &&) noexcept=default | |
| Move constructor. | |
| BackRefMixin & | operator= (BackRefMixin const &other) |
| Copy assignment with the same semantics as the copy constructor. More... | |
| BackRefMixin & | operator= (BackRefMixin &&) noexcept=default |
| Move assignment operator. More... | |
| bool | operator== (BackRefMixin const &other) const noexcept |
| Owner-based equality. More... | |
| void | set_backref (std::weak_ptr< BufferResource > backref) |
| Install a back-reference on this instance. More... | |
Friends | |
| class | BufferResource |
| void | get_property (PinnedMemoryResource const &, cuda::mr::host_accessible) noexcept |
Enables the cuda::mr::host_accessible property. | |
Memory resource that provides pinned (page-locked) host memory using a pool.
Inherits from cuda::mr::shared_resource<RmmResourceAdaptorImpl<cuda::pinned_memory_pool>>, which holds the pool directly inside the shared control block — no extra heap allocation for the pool itself. Copies share the same underlying pool and memory statistics.
This resource allocates and deallocates pinned host memory asynchronously through CUDA streams. It offers higher bandwidth and lower latency for device transfers compared to regular pageable host memory.
Definition at line 128 of file pinned_memory_resource.hpp.
|
inline |
Allocates pinned host memory associated with a CUDA stream.
| stream | CUDA stream associated with the allocation. |
| size | Number of bytes to at least allocate. |
| alignment | Required alignment. |
| std::bad_alloc | If the allocation fails. |
| std::invalid_argument | If alignment is not a valid alignment. |
Definition at line 148 of file pinned_memory_resource.hpp.
|
inlinenoexcept |
Returns the total number of currently allocated bytes.
Definition at line 188 of file pinned_memory_resource.hpp.
|
inlinenoexcept |
Deallocates pinned host memory associated with a CUDA stream.
| stream | CUDA stream associated with operations that used ptr. |
| ptr | Pointer to the memory to deallocate. May be nullptr. |
| size | Number of bytes previously allocated at ptr. |
| alignment | Alignment originally used for the allocation. |
Definition at line 164 of file pinned_memory_resource.hpp.
|
inline |
Returns the main memory record for the pinned pool.
Definition at line 197 of file pinned_memory_resource.hpp.
|
inlinenoexcept |
Equality comparison.
| other | The other resource to compare. |
Definition at line 179 of file pinned_memory_resource.hpp.
|
inlineconstexprnoexcept |
Returns the properties used to configure the pool.
Definition at line 206 of file pinned_memory_resource.hpp.