CuFileBuffer#

public final class CuFileBuffer extends BaseDeviceMemoryBuffer#

Represents a cuFile buffer.

Method Summary

allocate(long bytes, boolean registerBuffer)

Allocate memory for use with cuFile on the GPU.

close()

Close this buffer and free memory.

slice(long offset, long len)

Slice off a part of the buffer.

Fields inherited from class ai.rapids.cudf.MemoryBuffer: address, closed, id, length, refCount

Methods inherited from class ai.rapids.cudf.MemoryBuffer: addressOutOfBoundsCheck, copyFromMemoryBuffer, copyFromMemoryBufferAsync, getAddress, getEventHandler, getLength, getRefCount, incRefCount, noWarnLeakExpected, setEventHandler, toString

Methods inherited from class ai.rapids.cudf.BaseDeviceMemoryBuffer: copyFromDeviceBufferAsync, copyFromHostBuffer, copyFromHostBufferAsync, sliceWithCopy

Methods

public MemoryBuffer slice(long offset, long len)#

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.

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

public void close()#

Close this buffer and free memory.

Static Methods

public static CuFileBuffer allocate(
long bytes,
boolean registerBuffer
)#

Allocate memory for use with cuFile on the GPU.

You must close it when done.

Parameters:
  • bytes – size in bytes to allocate

  • registerBuffer – If true, register the cuFile buffer.

Returns:

the buffer