Memory resource that uses cudaMallocAsync/cudaFreeAsync for allocation/deallocation.
More...
#include <cuda_async_memory_resource.hpp>
|
|
void | get_property (cuda_async_memory_resource const &, cuda::mr::device_accessible) noexcept |
| | Enables the cuda::mr::device_accessible property.
|
Memory resource that uses cudaMallocAsync/cudaFreeAsync for allocation/deallocation.
◆ allocation_handle_type
Flags for specifying memory allocation handle types.
- Note
- These values are exact copies from cudaMemAllocationHandleType. We need a placeholder that can be used consistently in the constructor of cuda_async_memory_resource with all supported versions of CUDA. See the cudaMemAllocationHandleType docs at https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html and ensure the enum values are kept in sync with the CUDA documentation.
-
cudaMemHandleTypeFabric can be used instead of 0x8 once we require CUDA 12.4+.
| Enumerator |
|---|
| none | Does not allow any export mechanism.
|
| posix_file_descriptor | Allows a file descriptor to be used for exporting. Permitted only on POSIX systems.
|
| win32 | Allows a Win32 NT handle to be used for exporting. (HANDLE).
|
| win32_kmt | Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE)
|
| fabric | Allows a fabric handle to be used for exporting. (cudaMemFabricHandle_t).
|
◆ cuda_async_memory_resource()
| rmm::mr::cuda_async_memory_resource::cuda_async_memory_resource |
( |
std::optional< std::size_t > | initial_pool_size = {}, |
|
|
std::optional< std::size_t > | release_threshold = {}, |
|
|
std::optional< allocation_handle_type > | export_handle_type = {} ) |
Constructs a cuda_async_memory_resource with the optionally specified initial pool size and release threshold.
If the pool size grows beyond the release threshold, unused memory held by the pool will be released at the next synchronization event.
- Exceptions
-
- Parameters
-
| initial_pool_size | Optional initial size in bytes of the pool. If provided, the pool will be primed by allocating and immediately deallocating this amount of memory on the default CUDA stream. |
| release_threshold | Optional release threshold size in bytes of the pool. If no value is provided, the release threshold is set to the maximum value of std::uint64_t, so that the pool retains memory across synchronization events unless the caller specifies otherwise. |
| export_handle_type | Optional cudaMemAllocationHandleType that allocations from this resource should support interprocess communication (IPC). Default is cudaMemHandleTypeNone for no IPC support. |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pool_handle()
| cudaMemPool_t rmm::mr::cuda_async_memory_resource::pool_handle |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the underlying native handle to the CUDA pool.
- Returns
- cudaMemPool_t Handle to the underlying CUDA pool
The documentation for this class was generated from the following file: