Memory resource that uses cudaMallocAsync/cudaFreeAsync for allocation/deallocation.
More...
#include <cuda_async_view_memory_resource.hpp>
Public Member Functions | |
| cuda_async_view_memory_resource (cudaMemPool_t pool_handle) | |
| Constructs a cuda_async_view_memory_resource which uses an existing CUDA memory pool. The provided pool is not owned by cuda_async_view_memory_resource and must remain valid during the lifetime of the memory resource. More... | |
| cudaMemPool_t | pool_handle () const noexcept |
| Returns the underlying native handle to the CUDA pool. More... | |
| cuda_async_view_memory_resource (cuda_async_view_memory_resource const &)=default | |
| Default copy constructor. | |
| cuda_async_view_memory_resource (cuda_async_view_memory_resource &&)=default | |
| Default move constructor. | |
| cuda_async_view_memory_resource & | operator= (cuda_async_view_memory_resource const &)=default |
| Default copy assignment operator. More... | |
| cuda_async_view_memory_resource & | operator= (cuda_async_view_memory_resource &&)=default |
| Default move assignment operator. More... | |
| void * | allocate (cuda::stream_ref stream, std::size_t bytes, [[maybe_unused]] std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
Allocates memory of size at least bytes. More... | |
| void | deallocate (cuda::stream_ref stream, void *ptr, [[maybe_unused]] 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 memory of size at least 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== (cuda_async_view_memory_resource const &other) const noexcept |
| Compare this resource to another. More... | |
| bool | operator!= (cuda_async_view_memory_resource const &other) const noexcept |
| Compare this resource to another. More... | |
Friends | |
| void | get_property (cuda_async_view_memory_resource const &, cuda::mr::device_accessible) noexcept |
Enables the cuda::mr::device_accessible property. More... | |
Memory resource that uses cudaMallocAsync/cudaFreeAsync for allocation/deallocation.
|
inline |
Constructs a cuda_async_view_memory_resource which uses an existing CUDA memory pool. The provided pool is not owned by cuda_async_view_memory_resource and must remain valid during the lifetime of the memory resource.
| rmm::logic_error | if the CUDA version does not support cudaMallocAsync |
| pool_handle | Handle to a CUDA memory pool which will be used to serve allocation requests. |
|
inline |
Allocates memory of size at least bytes.
The returned pointer will have at minimum 256 byte alignment.
| stream | Stream on which to perform allocation |
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
|
inline |
Allocates memory of size at least bytes synchronously.
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
|
inlinenoexcept |
Deallocate memory pointed to by ptr.
| stream | Stream on which to perform deallocation |
| 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.
| other | The other resource to compare to |
|
default |
Default move assignment operator.
|
default |
Default copy assignment operator.
|
inlinenoexcept |
Compare this resource to another.
| other | The other resource to compare to |
|
inlinenoexcept |
Returns the underlying native handle to the CUDA pool.
|
friend |
Enables the cuda::mr::device_accessible property.
This property declares that a cuda_async_view_memory_resource provides device accessible memory