Class CuFileBuffer

All Implemented Interfaces:
AutoCloseable

public final class CuFileBuffer extends BaseDeviceMemoryBuffer
Represents a cuFile buffer.
  • Method Details

    • allocate

      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
    • slice

      public MemoryBuffer slice(long offset, long len)
      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 class MemoryBuffer
      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 interface AutoCloseable
      Overrides:
      close in class MemoryBuffer