Package ai.rapids.cudf
Class CuFileBuffer
java.lang.Object
ai.rapids.cudf.MemoryBuffer
ai.rapids.cudf.BaseDeviceMemoryBuffer
ai.rapids.cudf.CuFileBuffer
- All Implemented Interfaces:
AutoCloseable
Represents a cuFile buffer.
-
Nested Class Summary
Nested classes/interfaces inherited from class ai.rapids.cudf.MemoryBuffer
MemoryBuffer.EventHandler, MemoryBuffer.MemoryBufferCleaner
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CuFileBuffer
allocate
(long bytes, boolean registerBuffer) Allocate memory for use with cuFile on the GPU.void
close()
Close this buffer and free memoryslice
(long offset, long len) Slice off a part of the buffer.Methods inherited from class ai.rapids.cudf.BaseDeviceMemoryBuffer
copyFromDeviceBufferAsync, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBuffer, copyFromHostBufferAsync, copyFromHostBufferAsync, sliceWithCopy
Methods inherited from class ai.rapids.cudf.MemoryBuffer
addressOutOfBoundsCheck, copyFromMemoryBuffer, copyFromMemoryBufferAsync, getAddress, getEventHandler, getLength, getRefCount, incRefCount, noWarnLeakExpected, setEventHandler, toString
-
Method Details
-
allocate
Allocate memory for use with cuFile on the GPU. You must close it when done.- Parameters:
bytes
- size in bytes to allocateregisterBuffer
- If true, register the cuFile buffer.- Returns:
- the buffer
-
slice
Description copied from class:MemoryBuffer
Slice off a part of the buffer. Note that this is a zero copy operation and all slices must be closed along with the original buffer before the memory is released. So use this with some caution. Note that [[DeviceMemoryBuffer]] and [[HostMemoryBuffer]] support slicing, and override this function.- Specified by:
slice
in classMemoryBuffer
- Parameters:
offset
- where to start the slice at.len
- how many bytes to slice- Returns:
- a slice of the original buffer that will need to be closed independently
-
close
public void close()Description copied from class:MemoryBuffer
Close this buffer and free memory- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classMemoryBuffer
-