Memory resource that uses cudaMallocAsync/cudaFreeAsync for allocation/deallocation.
More...
#include <cuda_async_view_memory_resource.hpp>
Memory resource that uses cudaMallocAsync/cudaFreeAsync for allocation/deallocation.
◆ cuda_async_view_memory_resource()
| rmm::mr::cuda_async_view_memory_resource::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.
- Exceptions
-
- Parameters
-
| pool_handle | Handle to a CUDA memory pool which will be used to serve allocation requests. |
◆ allocate()
| void * rmm::mr::cuda_async_view_memory_resource::allocate |
( |
cuda::stream_ref | stream, |
|
|
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
nodiscard |
Allocates memory of size at least bytes.
The returned pointer will have at minimum 256 byte alignment.
- Parameters
-
| stream | Stream on which to perform allocation |
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
- Returns
- void* Pointer to the newly allocated memory
◆ allocate_sync()
| void * rmm::mr::cuda_async_view_memory_resource::allocate_sync |
( |
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
nodiscard |
Allocates memory of size at least bytes synchronously.
- Parameters
-
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
- Returns
- void* Pointer to the newly allocated memory
◆ deallocate()
| void rmm::mr::cuda_async_view_memory_resource::deallocate |
( |
cuda::stream_ref | stream, |
|
|
void * | ptr, |
|
|
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
noexcept |
Deallocate memory pointed to by ptr.
- Parameters
-
| 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 |
◆ deallocate_sync()
| void rmm::mr::cuda_async_view_memory_resource::deallocate_sync |
( |
void * | ptr, |
|
|
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
noexcept |
Deallocate memory pointed to by ptr synchronously.
- Parameters
-
| 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 |
◆ operator!=()
Compare this resource to another.
- Parameters
-
| other | The other resource to compare to |
- Returns
- true If the two resources are equivalent
-
false If the two resources are not equal
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
Compare this resource to another.
- Parameters
-
| other | The other resource to compare to |
- Returns
- true If the two resources are equivalent
-
false If the two resources are not equal
◆ pool_handle()
| cudaMemPool_t rmm::mr::cuda_async_view_memory_resource::pool_handle |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the underlying native handle to the CUDA pool.
- Returns
- cudaMemPool_t Handle to the underlying CUDA pool
◆ get_property
The documentation for this class was generated from the following file: