Package ai.rapids.cudf
Class DefaultHostMemoryAllocator
java.lang.Object
ai.rapids.cudf.DefaultHostMemoryAllocator
- All Implemented Interfaces:
HostMemoryAllocator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocate
(long bytes) Allocate memory, but be sure to close the returned buffer to avoid memory leaks.allocate
(long bytes, boolean preferPinned) Allocate memory, but be sure to close the returned buffer to avoid memory leaks.static HostMemoryAllocator
get()
Retrieve current host memory allocator used by default if not passed directly to APIstatic void
set
(HostMemoryAllocator hostMemoryAllocator) Sets a new default host memory allocator implementation by default.
-
Constructor Details
-
DefaultHostMemoryAllocator
public DefaultHostMemoryAllocator()
-
-
Method Details
-
get
Retrieve current host memory allocator used by default if not passed directly to API- Returns:
- current default HostMemoryAllocator implementation
-
set
Sets a new default host memory allocator implementation by default.- Parameters:
hostMemoryAllocator
- the new allocator to use.
-
allocate
Description copied from interface:HostMemoryAllocator
Allocate memory, but be sure to close the returned buffer to avoid memory leaks.- Specified by:
allocate
in interfaceHostMemoryAllocator
- Parameters:
bytes
- size in bytes to allocatepreferPinned
- If set to true, the pinned memory pool will be used if possible with a fallback to off-heap memory. If set to false, the allocation will always be from off-heap memory.- Returns:
- the newly created buffer
-
allocate
Description copied from interface:HostMemoryAllocator
Allocate memory, but be sure to close the returned buffer to avoid memory leaks. Pinned memory for allocations preference is up to the implementor- Specified by:
allocate
in interfaceHostMemoryAllocator
- Parameters:
bytes
- size in bytes to allocate- Returns:
- the newly created buffer
-