Memory resource class for allocating pinned host memory. More...
#include <pinned_host_memory_resource.hpp>
Public Member Functions | |
| pinned_host_memory_resource (pinned_host_memory_resource const &)=default | |
| Default copy constructor. | |
| pinned_host_memory_resource (pinned_host_memory_resource &&)=default | |
| Default move constructor. | |
| pinned_host_memory_resource & | operator= (pinned_host_memory_resource const &)=default |
| Default copy assignment operator. More... | |
| pinned_host_memory_resource & | operator= (pinned_host_memory_resource &&)=default |
| Default move assignment operator. More... | |
| void * | allocate ([[maybe_unused]] cuda::stream_ref stream, std::size_t bytes, [[maybe_unused]] std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
Allocates pinned host memory of size at least bytes bytes. More... | |
| void | deallocate ([[maybe_unused]] cuda::stream_ref stream, void *ptr, std::size_t bytes, [[maybe_unused]] std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept |
Deallocate memory pointed to by ptr. More... | |
| void * | allocate_sync (std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
Allocates pinned host memory of size at least bytes bytes synchronously. More... | |
| void | deallocate_sync (void *ptr, std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept |
Deallocate memory pointed to by ptr synchronously. More... | |
| bool | operator== (pinned_host_memory_resource const &) const noexcept |
| Compare this resource to another. More... | |
| bool | operator!= (pinned_host_memory_resource const &) const noexcept |
| Compare this resource to another. More... | |
Friends | |
| void | get_property (pinned_host_memory_resource const &, cuda::mr::device_accessible) noexcept |
Enables the cuda::mr::device_accessible property. More... | |
| void | get_property (pinned_host_memory_resource const &, cuda::mr::host_accessible) noexcept |
Enables the cuda::mr::host_accessible property. More... | |
Memory resource class for allocating pinned host memory.
This class uses CUDA's cudaHostAlloc to allocate pinned host memory. It satisfies the cuda::mr::resource and cuda::mr::synchronous_resource concepts, and the cuda::mr::host_accessible and cuda::mr::device_accessible properties.
|
inline |
Allocates pinned host memory of size at least bytes bytes.
| rmm::out_of_memory | if the requested allocation could not be fulfilled due to a CUDA out of memory error. |
| rmm::bad_alloc | if the requested allocation could not be fulfilled due to any other reason. |
The stream argument is ignored.
| stream | CUDA stream on which to perform the allocation (ignored). |
| bytes | The size, in bytes, of the allocation. |
| alignment | The alignment of the allocation |
|
inline |
Allocates pinned host memory of size at least bytes bytes synchronously.
| bytes | The size, in bytes, of the allocation. |
| alignment | The alignment of the allocation |
|
inlinenoexcept |
Deallocate memory pointed to by ptr.
The stream argument is ignored.
| stream | This argument is ignored. |
| ptr | Pointer to be deallocated |
| bytes | The size in bytes of the allocation. This must be equal to the value of bytes that was passed to the allocate call that returned ptr. |
| alignment | The alignment that was passed to the allocate call that returned ptr |
|
inlinenoexcept |
Deallocate memory pointed to by ptr synchronously.
| ptr | Pointer to be deallocated |
| bytes | The size in bytes of the allocation |
| alignment | The alignment that was passed to the allocate call that returned ptr |
|
inlinenoexcept |
Compare this resource to another.
All instances of pinned_host_memory_resource are equivalent.
|
default |
Default move assignment operator.
|
default |
Default copy assignment operator.
|
inlinenoexcept |
Compare this resource to another.
All instances of pinned_host_memory_resource are equivalent.
|
friend |
Enables the cuda::mr::device_accessible property.
This property declares that a pinned_host_memory_resource provides device accessible memory
|
friend |
Enables the cuda::mr::host_accessible property.
This property declares that a pinned_host_memory_resource provides host accessible memory