Memory resource class for allocating pinned host memory. More...
#include <pinned_host_memory_resource.hpp>
Public Member Functions | |
| bool | operator== (const pinned_host_memory_resource &) const |
| true if the specified resource is the same type as this resource. More... | |
| bool | operator!= (const pinned_host_memory_resource &) const |
| true if the specified resource is not the same type as this resource, otherwise false. More... | |
Static Public Member Functions | |
| static void * | allocate (std::size_t bytes, [[maybe_unused]] std::size_t alignment=rmm::RMM_DEFAULT_HOST_ALIGNMENT) |
Allocates pinned host memory of size at least bytes bytes. More... | |
| static void | deallocate (void *ptr, std::size_t bytes, std::size_t alignment=rmm::RMM_DEFAULT_HOST_ALIGNMENT) noexcept |
Deallocate memory pointed to by ptr of size bytes bytes. More... | |
| static void * | allocate_async (std::size_t bytes, [[maybe_unused]] cuda::stream_ref stream) |
Allocates pinned host memory of size at least bytes bytes. More... | |
| static void * | allocate_async (std::size_t bytes, std::size_t alignment, [[maybe_unused]] cuda::stream_ref stream) |
Allocates pinned host memory of size at least bytes bytes and alignment alignment. More... | |
| static void | deallocate_async (void *ptr, std::size_t bytes, [[maybe_unused]] cuda::stream_ref stream) noexcept |
Deallocate memory pointed to by ptr of size bytes bytes. More... | |
| static void | deallocate_async (void *ptr, std::size_t bytes, std::size_t alignment, [[maybe_unused]] cuda::stream_ref stream) noexcept |
Deallocate memory pointed to by ptr of size bytes bytes and alignment alignment bytes. 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 implements the cuda::mr::memory_resource and cuda::mr::device_memory_resource concepts, and the cuda::mr::host_accessible and cuda::mr::device_accessible properties.
|
inlinestatic |
Allocates pinned host memory of size at least bytes bytes.
| rmm::out_of_memory | if the requested allocation could not be fulfilled due to to a CUDA out of memory error. |
| rmm::bad_alloc | if the requested allocation could not be fulfilled due to any other reason. |
| bytes | The size, in bytes, of the allocation. |
| alignment | Alignment in bytes. Default alignment is used if unspecified. |
|
inlinestatic |
Allocates pinned host memory of size at least bytes bytes.
| rmm::out_of_memory | if the requested allocation could not be fulfilled due to to a CUDA out of memory error. |
| rmm::bad_alloc | if the requested allocation could not be fulfilled due to any other error. |
| bytes | The size, in bytes, of the allocation. |
| stream | CUDA stream on which to perform the allocation (ignored). |
|
inlinestatic |
Allocates pinned host memory of size at least bytes bytes and alignment alignment.
| rmm::out_of_memory | if the requested allocation could not be fulfilled due to to a CUDA out of memory error. |
| rmm::bad_alloc | if the requested allocation could not be fulfilled due to any other error. |
| bytes | The size, in bytes, of the allocation. |
| alignment | Alignment in bytes. |
| stream | CUDA stream on which to perform the allocation (ignored). |
|
inlinestaticnoexcept |
Deallocate memory pointed to by ptr of size bytes bytes.
| ptr | Pointer to be deallocated. |
| bytes | Size of the allocation. |
| alignment | Alignment in bytes. Default alignment is used if unspecified. |
|
inlinestaticnoexcept |
Deallocate memory pointed to by ptr of size bytes bytes.
| ptr | Pointer to be deallocated. |
| bytes | Size of the allocation. |
| stream | CUDA stream on which to perform the deallocation (ignored). |
|
inlinestaticnoexcept |
Deallocate memory pointed to by ptr of size bytes bytes and alignment alignment bytes.
| ptr | Pointer to be deallocated. |
| bytes | Size of the allocation. |
| alignment | Alignment in bytes. |
| stream | CUDA stream on which to perform the deallocation (ignored). |
|
inline |
true if the specified resource is not the same type as this resource, otherwise false.
|
inline |
true if the specified resource is the same type as this resource.
|
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