Interface CyCLBuffer


public interface CyCLBuffer
Provides functionality associated with an OpenCL memory object.
Author:
Dimitry Tegunov
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of bytes associated with the CyCLBuffer's element type.
    void
    Frees all device memory associated with the buffer.
    Gets the underlying buffer.
    void
    getFromDevice(byte[] data)
    Copies data from device to host memory.
    void
    getFromDevice(byte[] data, int length, int offset)
    Copies data from device to host memory.
    void
    getFromDevice(double[] data)
    Copies data from device to host memory.
    void
    getFromDevice(double[] data, int length, int offset)
    Copies data from device to host memory.
    void
    getFromDevice(float[] data)
    Copies data from device to host memory.
    void
    getFromDevice(float[] data, int length, int offset)
    Copies data from device to host memory.
    void
    getFromDevice(int[] data)
    Copies data from device to host memory.
    void
    getFromDevice(int[] data, int length, int offset)
    Copies data from device to host memory.
    void
    getFromDevice(long offset)
     
    void
    getFromDevice(long[] data)
    Copies data from device to host memory.
    void
    getFromDevice(long[] data, int length, int offset)
    Copies data from device to host memory.
    void
    getFromDevice(short[] data)
    Copies data from device to host memory.
    void
    getFromDevice(short[] data, int length, int offset)
    Copies data from device to host memory.
    long
    Gets the underlying memory object.
    void
    Copies data from another device buffer to this one.
    void
    setFromDevice(CyCLBuffer src, long bytes, long offsetSrc, long offsetDst)
    Copies data from another device buffer to this one.
    void
    setFromHost(byte[] data)
    Copies data from host to device memory.
    void
    setFromHost(byte[] data, int length, int offset)
    Copies data from host to device memory.
    void
    setFromHost(double[] data)
    Copies data from host to device memory.
    void
    setFromHost(double[] data, int length, int offset)
    Copies data from host to device memory.
    void
    setFromHost(float[] data)
    Copies data from host to device memory.
    void
    setFromHost(float[] data, int length, int offset)
    Copies data from host to device memory.
    void
    setFromHost(int[] data)
    Copies data from host to device memory.
    void
    setFromHost(int[] data, int length, int offset)
    Copies data from host to device memory.
    void
    setFromHost(long[] data)
    Copies data from host to device memory.
    void
    setFromHost(long[] data, int length, int offset)
    Copies data from host to device memory.
    void
    setFromHost(short[] data)
    Copies data from host to device memory.
    void
    setFromHost(short[] data, int length, int offset)
    Copies data from host to device memory.
    int
    Returns the overall buffer size in bytes.
     
  • Method Details

    • elementSize

      int elementSize()
      Returns the number of bytes associated with the CyCLBuffer's element type.
      Returns:
      sizeof(type)
    • sizeInBytes

      int sizeInBytes()
      Returns the overall buffer size in bytes.
      Returns:
      sizeof(type) * elements
    • setFromHost

      void setFromHost(byte[] data, int length, int offset)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
      length - Number of elements to be copied
      offset - Offset in bytes from the device memory's start
    • setFromHost

      void setFromHost(short[] data, int length, int offset)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
      length - Number of elements to be copied
      offset - Offset in bytes from the device memory's start
    • setFromHost

      void setFromHost(int[] data, int length, int offset)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
      length - Number of elements to be copied
      offset - Offset in bytes from the device memory's start
    • setFromHost

      void setFromHost(long[] data, int length, int offset)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
      length - Number of elements to be copied
      offset - Offset in bytes from the device memory's start
    • setFromHost

      void setFromHost(float[] data, int length, int offset)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
      length - Number of elements to be copied
      offset - Offset in bytes from the device memory's start
    • setFromHost

      void setFromHost(double[] data, int length, int offset)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
      length - Number of elements to be copied
      offset - Offset in bytes from the device memory's start
    • setFromHost

      void setFromHost(byte[] data)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
    • setFromHost

      void setFromHost(short[] data)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
    • setFromHost

      void setFromHost(int[] data)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
    • setFromHost

      void setFromHost(long[] data)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
    • setFromHost

      void setFromHost(float[] data)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
    • setFromHost

      void setFromHost(double[] data)
      Copies data from host to device memory.
      Parameters:
      data - Data to be copied
    • setFromDevice

      void setFromDevice(CyCLBuffer src, long bytes, long offsetSrc, long offsetDst)
      Copies data from another device buffer to this one.
      Parameters:
      src - Device buffer with the source data
      bytes - Amount of bytes to be copied
      offsetSrc - Offset in bytes from the start of the source buffer
      offsetDst - Offset in bytes from the start of the destination buffer
    • setFromDevice

      void setFromDevice(CyCLBuffer src)
      Copies data from another device buffer to this one.
      Parameters:
      src - Device buffer with the source data
    • getFromDevice

      void getFromDevice(long offset)
    • getFromDevice

      void getFromDevice(byte[] data, int length, int offset)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
      length - Number of elements
      offset - Offset in bytes from the start of the device buffer
    • getFromDevice

      void getFromDevice(short[] data, int length, int offset)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
      length - Number of elements
      offset - Offset in bytes from the start of the device buffer
    • getFromDevice

      void getFromDevice(int[] data, int length, int offset)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
      length - Number of elements
      offset - Offset in bytes from the start of the device buffer
    • getFromDevice

      void getFromDevice(long[] data, int length, int offset)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
      length - Number of elements
      offset - Offset in bytes from the start of the device buffer
    • getFromDevice

      void getFromDevice(float[] data, int length, int offset)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
      length - Number of elements
      offset - Offset in bytes from the start of the device buffer
    • getFromDevice

      void getFromDevice(double[] data, int length, int offset)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
      length - Number of elements
      offset - Offset in bytes from the start of the device buffer
    • getFromDevice

      void getFromDevice(byte[] data)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
    • getFromDevice

      void getFromDevice(short[] data)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
    • getFromDevice

      void getFromDevice(int[] data)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
    • getFromDevice

      void getFromDevice(long[] data)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
    • getFromDevice

      void getFromDevice(float[] data)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
    • getFromDevice

      void getFromDevice(double[] data)
      Copies data from device to host memory.
      Parameters:
      data - Array that the data will be copied to
    • getMemObject

      long getMemObject()
      Gets the underlying memory object.
      Returns:
      LWJGL memory object
    • getBuffer

      ByteBuffer getBuffer()
      Gets the underlying buffer.
      Returns:
      ByteBuffer
    • free

      void free()
      Frees all device memory associated with the buffer. CyCLBuffer cannot be used anymore once this method has been executed.
    • toString

      String toString()
      Overrides:
      toString in class Object