RmmCudaAsyncMemoryResource#
- public class RmmCudaAsyncMemoryResource implements RmmDeviceMemoryResource#
A device memory resource that uses
cudaMallocAsyncandcudaFreeAsyncfor allocation and deallocation.Constructor Summary
RmmCudaAsyncMemoryResource(long size, long releaseThreshold)Create a new async memory resource.
RmmCudaAsyncMemoryResource(long size, long releaseThreshold, HandleType handleType)Create a new async memory resource whose CUDA memory pool supports the given export handle type.
RmmCudaAsyncMemoryResource(long size, long releaseThreshold, boolean fabric)Create a new async memory resource.
Method Summary
Returns a pointer to the underlying C++ class that implements an RMM device memory resource.
The export handle type the underlying CUDA memory pool was created with.
Get the underlying cudaMemPool_t.
Constructors
- public RmmCudaAsyncMemoryResource(long size, long releaseThreshold)#
Create a new async memory resource.
- Parameters:
size – the initial size of the pool
releaseThreshold – size in bytes for when memory is released back to cuda
- public RmmCudaAsyncMemoryResource(
- long size,
- long releaseThreshold,
- boolean fabric
Create a new async memory resource.
- Parameters:
size – the initial size of the pool
releaseThreshold – size in bytes for when memory is released back to cuda
fabric – if true request peer read+write accessible fabric handles when creating the pool
- public RmmCudaAsyncMemoryResource(
- long size,
- long releaseThreshold,
- HandleType handleType
Create a new async memory resource whose CUDA memory pool supports the given export handle type.
- Parameters:
size – the initial size of the pool
releaseThreshold – size in bytes for when memory is released back to cuda
handleType – the export handle type of the pool
Methods
- public long getHandle()#
Returns a pointer to the underlying C++ class that implements an RMM device memory resource.
- public long getSize()#
- public HandleType getHandleType()#
The export handle type the underlying CUDA memory pool was created with.
- public long getPoolHandle()#
Get the underlying
cudaMemPool_t.It can be exported with
Cuda.memPoolExportToPosixFd(long)only if the resource was created withHandleType.POSIX_FILE_DESCRIPTOR.
- public void close()#
- public enum HandleType#
The export handle type of the CUDA memory pool.
nativeIdmatchesrmm::mr::cuda_async_memory_resource::allocation_handle_type, whose values are the CUDAcudaMemAllocationHandleTypevalues. Like RMM, FABRIC is the literal 0x8 becausecudaMemHandleTypeFabricis not defined in CUDA versions before 12.4.Enum Constant Summary
The pool supports exporting fabric handles (cudaMemHandleTypeFabric).
The pool does not support exporting (cudaMemHandleTypeNone).
The pool supports exporting POSIX file descriptors (cudaMemHandleTypePosixFileDescriptor).