public final class PinnedMemoryPool extends Object implements AutoCloseable
Modifier and Type | Method and Description |
---|---|
static HostMemoryBuffer |
allocate(long bytes)
Factory method to create a host buffer but preferably pointing to pinned memory.
|
static HostMemoryBuffer |
allocate(long bytes,
HostMemoryAllocator hostMemoryAllocator)
Factory method to create a host buffer but preferably pointing to pinned memory.
|
void |
close() |
static boolean |
configureDefaultCudfPinnedPoolSize(long size)
Sets the size of the cuDF default pinned pool.
|
static long |
getTotalPoolSizeBytes()
Get the number of bytes that the pinned memory pool was allocated with.
|
static void |
initialize(long poolSize)
Initialize the pool.
|
static void |
initialize(long poolSize,
int gpuId)
Initialize the pool.
|
static void |
initialize(long poolSize,
int gpuId,
boolean setCudfPinnedPoolMemoryResource)
Initialize the pool.
|
static boolean |
isInitialized()
Check if the pool has been initialized or not.
|
static void |
shutdown()
Shut down the RMM pool_memory_resource, nulling out our reference.
|
static HostMemoryBuffer |
tryAllocate(long bytes)
Factory method to create a pinned host memory buffer.
|
public static void initialize(long poolSize)
poolSize
- size of the pool to initialize.public static void initialize(long poolSize, int gpuId)
poolSize
- size of the pool to initialize.gpuId
- gpu id to set to get memory pool from, -1 means to use defaultpublic static void initialize(long poolSize, int gpuId, boolean setCudfPinnedPoolMemoryResource)
poolSize
- size of the pool to initialize.gpuId
- gpu id to set to get memory pool from, -1 means to use defaultsetCudfPinnedPoolMemoryResource
- true if this pinned pool should be used by cuDF for pinned memorypublic static boolean isInitialized()
public static void shutdown()
public static HostMemoryBuffer tryAllocate(long bytes)
bytes
- size in bytes to allocatepublic static HostMemoryBuffer allocate(long bytes, HostMemoryAllocator hostMemoryAllocator)
bytes
- size in bytes to allocatepublic static HostMemoryBuffer allocate(long bytes)
bytes
- size in bytes to allocatepublic static long getTotalPoolSizeBytes()
public void close()
close
in interface AutoCloseable
public static boolean configureDefaultCudfPinnedPoolSize(long size)
size
- initial and maximum size for the cuDF default pinned pool.
Pass size=0 to disable the default pool.Copyright © 2024. All rights reserved.