Module notzed.zcl
Package au.notzed.zcl

Class CLCommandQueue

java.lang.Object

public class CLCommandQueue
extends CLExtendable
Interface for cl_command_queue.

All of the offer calls will take two CLEventList arguments, a waitlist and an event list. These equate directly to the the num_events_in_wait_list, event_wait_list, and event arguments for the native OpenCL library calls.

  • For the waitlist list, all events it currently contains is used as the event_wait_list in the OpenCL call.
  • For the event list a local event is created for the OpenCL call. If the call was successful then the event created by the call is added to the event list.

For the offer operations which take arrays all offsets and sizes are in primitive element units and not bytes.

  • Field Details

    • WORKSIZE_64x1x1

      public static final long[] WORKSIZE_64x1x1
      A convenience variable for the very common local work-size of 64,1,1
    • WORKSIZE_1x1x64

      public static final long[] WORKSIZE_1x1x64
      A convenience variable for the common local work-size of 1,1,64
    • WORKSIZE_8x8x1

      public static final long[] WORKSIZE_8x8x1
      A convenience variable for the very common local work-size of 8,8,1
    • WORKSIZE_16x16x1

      public static final long[] WORKSIZE_16x16x1
    • OFFSET_0x0x0

      public static final long[] OFFSET_0x0x0
      A convenience variable for the very common global offset of 0,0,0
  • Constructor Details

    • CLCommandQueue

      public CLCommandQueue​(jdk.incubator.foreign.MemoryAddress p)
  • Method Details

    • PROPERTIES

      public static CLQueueProperty PROPERTIES​(long flags)
    • flush

      public void flush() throws CLException
      Calls clFlush.
      Throws:
      CLException
    • finish

      public void finish() throws CLException
      Calls clFinish.
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, long size, jdk.incubator.foreign.MemorySegment buffer, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueReadBuffer for a MemorySegment.
      Parameters:
      mem -
      blocking -
      mem_offset - source memory offset in bytes.
      size - memory transfer size in bytes.
      buffer - destination buffer. It must be a native segment.
      wait -
      event -
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, long size, java.nio.ByteBuffer buffer, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, byte[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueReadBuffer for a byte array. panama note: the buffer must always be copied.
      Parameters:
      mem -
      blocking - ignored, array reads are always blocking.
      mem_offset - source memory offset in bytes.
      size - memory transfer size in bytes.
      buffer - destination array.
      buf_offset - destination buffer offset in bytes.
      wait -
      event -
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, short[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueReadBuffer for a short array. Note that mem_offset and size are in terms of the buffer element size.
      Parameters:
      mem -
      blocking - ignored, array reads are always blocking.
      mem_offset - source memory offset in shorts.
      size - memory transfer size in shorts.
      buffer - destination array.
      buf_offset - destination buffer offset in shorts.
      wait -
      event -
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, int[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, long[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, float[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueReadBuffer

      public void enqueueReadBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, double[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, jdk.incubator.foreign.MemorySegment buffer, CLEventList wait, CLEventList event) throws CLException, java.lang.UnsupportedOperationException
      Parameters:
      mem -
      blocking -
      buffer_origin -
      host_origin -
      region -
      buffer_row_pitch -
      buffer_slice_pitch -
      host_row_pitch -
      host_slice_pitch -
      buffer -
      wait -
      event -
      Throws:
      CLException
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.1
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, java.nio.ByteBuffer buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, byte[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, short[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, int[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, long[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, float[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueReadBufferRect

      public void enqueueReadBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, double[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, long size, jdk.incubator.foreign.MemorySegment buffer, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, long size, java.nio.ByteBuffer buffer, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, byte[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, short[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, int[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, long[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, float[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBuffer

      public void enqueueWriteBuffer​(CLBuffer mem, boolean blocking, long mem_offset, int size, double[] buffer, int buf_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, jdk.incubator.foreign.MemorySegment buffer, CLEventList wait, CLEventList event) throws CLException, java.lang.UnsupportedOperationException
      Parameters:
      mem -
      blocking -
      buffer_origin -
      host_origin -
      region -
      buffer_row_pitch -
      buffer_slice_pitch -
      host_row_pitch -
      host_slice_pitch -
      buffer -
      wait -
      event -
      Throws:
      CLException
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.1
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, java.nio.ByteBuffer buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, byte[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, short[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, int[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, long[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, float[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueWriteBufferRect

      public void enqueueWriteBufferRect​(CLBuffer mem, boolean blocking, long[] buffer_origin, long[] host_origin, long[] region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, double[] buffer, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Throws:
      CLException
      java.lang.UnsupportedOperationException
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, jdk.incubator.foreign.MemorySegment pattern, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueFillBuffer. This fills the buffer with a pattern. The offset and size is in multiples of the pattern size.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size.
      size - number of elements in multiples of the pattern size.
      wait -
      event -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, java.nio.ByteBuffer pattern, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, byte[] pattern, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueFillBuffer for byte types.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size.
      size - number of elements in multiples of the pattern size.
      wait -
      event -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, short[] pattern, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueFillBuffer for short types.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size.
      size - number of elements in multiples of the pattern size.
      wait -
      event -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, int[] pattern, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueFillBuffer for integer types.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size.
      size - number of elements in multiples of the pattern size.
      wait -
      event -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, long[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Calls clEnqueueFillBuffer for long types.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size.
      size - number of elements in multiples of the pattern size.
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, float[] pattern, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Calls clEnqueueFillBuffer for float types.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size in floats.
      size - number of elements in multiples of the pattern size in floats.
      wait -
      event -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillBuffer

      public void enqueueFillBuffer​(CLBuffer buffer, double[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Calls clEnqueueFillBuffer for double types.
      Parameters:
      buffer -
      pattern - pattern to fill
      offset - offset in multiples of the pattern size.
      size - number of elements in multiples of the pattern size.
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueCopyBuffer

      public void enqueueCopyBuffer​(CLBuffer srcmem, CLBuffer dstmem, long srcoffset, long dstoffset, long size, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueCopyBufferRect

      public void enqueueCopyBufferRect​(CLBuffer srcmem, CLBuffer dstmem, long[] src_origin, long[] dst_origin, long[] region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, CLEventList waiters, CLEventList events) throws CLException, java.lang.UnsupportedOperationException
      Parameters:
      srcmem -
      dstmem -
      src_origin -
      dst_origin -
      region -
      src_row_pitch -
      src_slice_pitch -
      dst_row_pitch -
      dst_slice_pitch -
      waiters -
      events -
      Throws:
      CLException
      java.lang.UnsupportedOperationException
      Since:
      OpenCL 1.1
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, jdk.incubator.foreign.MemorySegment buffer, CLEventList wait, CLEventList event) throws CLException
      Parameters:
      image -
      blocking -
      origin -
      region -
      row_pitch -
      slice_pitch -
      buffer - the position is honoured and updated
      wait -
      event -
      Throws:
      CLException
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, java.nio.ByteBuffer buffer, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
      See Also:
      enqueueReadImage(CLImage,boolean,long[],long[],long,long,MemorySegment,CLEventList,CLEventList)
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, byte[] buffer, int buff_offset, CLEventList wait, CLEventList event) throws CLException
      Parameters:
      image -
      blocking - ignored, array reads are always blocking.
      origin -
      region -
      row_pitch - in number of array elements
      slice_pitch - in number of array elements
      buffer -
      buff_offset - in number of array elements
      wait -
      event -
      Throws:
      CLException
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, short[] buffer, int buff_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
      See Also:
      enqueueReadImage(CLImage,boolean,long[],long[],long,long,byte[],int,CLEventList,CLEventList)
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, int[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, long[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, float[] buffer, int buff_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueReadImage

      public void enqueueReadImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, double[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, jdk.incubator.foreign.MemorySegment buffer, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, java.nio.ByteBuffer buffer, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, byte[] buffer, int buff_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, short[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, int[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, long[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, float[] buffer, int buff_offset, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueWriteImage

      public void enqueueWriteImage​(CLImage image, boolean blocking, long[] origin, long[] region, long row_pitch, long slice_pitch, double[] buffer, long buff_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueFillImage

      public void enqueueFillImage​(CLImage image, int[] colour, long[] origin, long[] region, CLEventList waiters, CLEventList events) throws CLException
      Calls clEnqueueFillImage for images whose channel data type is unormalised signed or unsigned integral type.
      Parameters:
      image -
      colour - 4-element RGBA components.
      origin - 3-element origin.
      region - 3-element region.
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueFillImage

      public void enqueueFillImage​(CLImage image, float[] colour, long[] origin, long[] region, CLEventList waiters, CLEventList events) throws CLException
      Calls clEnqueueFillImage for images whose channel data type is not an unormalised signed or unsigned integral type.
      Parameters:
      image -
      colour - 4-element RGBA components.
      origin - 3-element origin.
      region - 3-element region.
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueCopyImage

      public void enqueueCopyImage​(CLImage src, CLImage dst, long[] src_origin, long[] dst_origin, long[] region, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueCopyImageToBuffer

      public void enqueueCopyImageToBuffer​(CLImage src, CLBuffer dst, long[] src_origin, long[] region, long dst_offset, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueCopyBufferToImage

      public void enqueueCopyBufferToImage​(CLBuffer src, CLImage dst, long src_offset, long[] dst_origin, long[] region, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueMapBuffer

      public java.nio.ByteBuffer enqueueMapBuffer​(CLBuffer buffer, boolean blocking, long flags, long offset, long size, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueMapImage

      public java.nio.ByteBuffer enqueueMapImage​(CLImage image, boolean blocking, long flags, long[] origin, long[] region, long[] image_row_pitch, long[] image_slice_pitch, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueUnmapMemObject

      public void enqueueUnmapMemObject​(CLMemory mem, java.nio.ByteBuffer mapped, CLEventList wait, CLEventList event) throws CLException
      Throws:
      CLException
    • enqueueMigrateMemObjects

      public void enqueueMigrateMemObjects​(CLMemory[] mems, long flags, CLEventList waiters, CLEventList events) throws CLException
      Parameters:
      mems -
      flags -
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 1.2
    • enqueueNDRangeKernel

      public void enqueueNDRangeKernel​(CLKernel kernel, int work_dim, long[] global_offset, long[] global_size, long[] local_size, CLEventList waiters, CLEventList events) throws CLException
      Call clEnqueueNDRangeKernel.
      Parameters:
      kernel -
      work_dim -
      global_offset - global offset values, must be work_dim elements long or null.
      global_size - global size values, must be work_dim elements long and each element an even multiple of the corresponding local_size.
      local_size - must be work_dim elements long or null.
      waiters -
      events -
      Throws:
      CLException
    • enqueueTask

      public void enqueueTask​(CLKernel kernel, CLEventList waiters, CLEventList events) throws CLException
      Parameters:
      kernel -
      waiters -
      events -
      Throws:
      CLException - x-deprecated as of OpenCL 2.0
    • enqueueNativeKernel

      public void enqueueNativeKernel​(CLNativeKernel kernel, CLEventList waiters, CLEventList events, java.lang.Object... args) throws CLException
      Invoke a native kernel.
      Parameters:
      kernel - Kernel to invoke.
      waiters -
      events -
      args - the kernel arguments. Any CLBuffer or CLImage parameters will be replaced by a ByteBuffer in the kernel.
      Throws:
      CLException
    • enqueueMarkerWithWaitList

      public void enqueueMarkerWithWaitList​(CLEventList waiters, CLEventList events) throws CLException
      Enqueues a marker point.

      On OpenCL 1.1 this is emulated as clEnqueueWaitForEvents followed by clEnqueueMarker.

      Parameters:
      waiters -
      events -
      Throws:
      CLException
    • enqueueBarrierWithWaitList

      public void enqueueBarrierWithWaitList​(CLEventList waiters, CLEventList events) throws CLException
      Enqueues a barrier.

      On OpenCL 1.1 this is emulated as clEnqueueWaitForEvents followed by clEnqueueBarrier then clEnqueueMarker.

      Parameters:
      waiters -
      events -
      Throws:
      CLException
    • enqueueSVMFree

      public void enqueueSVMFree​(java.nio.ByteBuffer[] svms, CLEventList waiters, CLEventList events) throws CLException
      Call clEnqueueSVMFree().

      All ByteBuffer's must have been explicitly allocated using CLContext.clSVMAlloc().

      Parameters:
      svms -
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 2.0
    • enqueueSVMMemcpy

      public void enqueueSVMMemcpy​(boolean blocking, java.nio.ByteBuffer dst, long dstOffset, java.nio.ByteBuffer src, long srcOffset, long size, CLEventList waiters, CLEventList events) throws CLException
      Call clEnqueueSVMMemcopy().

      TODO: is the buffer+offset api ideal here?

      Parameters:
      blocking -
      dst - destination buffer. The bytebuffer position is ignored.
      dstOffset - offset into destination buffer.
      src - source buffer. The bytebuffer position is ignored.
      srcOffset - offset into source buffer.
      size - number of bytes to copy
      waiters -
      events -
      Throws:
      CLException
      Since:
      OpenCL 2.0
    • enqueueSVMMemFill

      public void enqueueSVMMemFill​(java.nio.ByteBuffer dst, byte[] pattern, long offset, long patterns, CLEventList waiters, CLEventList events) throws CLException
      Fill target with pattern.
      Parameters:
      dst -
      pattern - pattern.
      offset - offset into dst in terms of numbers of patterns, not bytes.
      patterns - Number of patterns to fill, not bytes.
      waiters -
      events -
      Throws:
      CLException
    • enqueueSVMMemFill

      public void enqueueSVMMemFill​(java.nio.ByteBuffer dst, short[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueSVMMemFill

      public void enqueueSVMMemFill​(java.nio.ByteBuffer dst, int[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueSVMMemFill

      public void enqueueSVMMemFill​(java.nio.ByteBuffer dst, long[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueSVMMemFill

      public void enqueueSVMMemFill​(java.nio.ByteBuffer dst, float[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueSVMMemFill

      public void enqueueSVMMemFill​(java.nio.ByteBuffer dst, double[] pattern, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Throws:
      CLException
    • enqueueSVMMap

      public void enqueueSVMMap​(boolean blocking, long flags, java.nio.ByteBuffer svm, long offset, long size, CLEventList waiters, CLEventList events) throws CLException
      Calls clEnqueueSVNMap().

      CHECKME: I don't know if an offset != 0 is allowed.

      Parameters:
      blocking -
      flags -
      svm -
      offset -
      size -
      waiters -
      events -
      Throws:
      CLException
    • enqueueSVMUnmap

      public void enqueueSVMUnmap​(java.nio.ByteBuffer svm, long offset, CLEventList waiters, CLEventList events) throws CLException
      Must match a corresponding call to enqueueSVMMap (svm and offset).
      Parameters:
      svm -
      offset -
      waiters -
      events -
      Throws:
      CLException
    • enqueueSVMMigrateMem

      public void enqueueSVMMigrateMem​(java.nio.ByteBuffer[] svms, long[] offsets, long[] sizes, long flags, CLEventList waiters, CLEventList events) throws CLException
      Parameters:
      svms - svm base mappings
      offsets - optional offsets for buffers, same length as svms if supplied
      sizes - optional sizes, otherwise length must match svms.
      flags -
      waiters -
      events -
      Throws:
      CLException
    • enqueue1DKernel

      public void enqueue1DKernel​(CLKernel kernel, long offsetx, long global_sizex, long local_sizex, CLEventList waiters, CLEventList events) throws CLException
      Calls enqueueNDRangeKernel for 1 dimensional work.
      Parameters:
      kernel -
      offsetx -
      global_sizex -
      local_sizex -
      waiters -
      events -
      Throws:
      CLException
    • enqueue2DKernel

      public void enqueue2DKernel​(CLKernel kernel, long offsetx, long offsety, long global_sizex, long global_sizey, long local_sizex, long local_sizey, CLEventList waiters, CLEventList events) throws CLException
      Calls enqueueNDRangeKernel for 2 dimensional work.
      Parameters:
      kernel -
      offsetx -
      offsety -
      global_sizex -
      global_sizey -
      local_sizex -
      local_sizey -
      waiters -
      events -
      Throws:
      CLException
    • getContext

      public CLContext getContext()
    • getDevice

      public CLDevice getDevice()
    • getProperties

      public long getProperties()
    • getSize

      public int getSize()
      Returns:
      Since:
      OpenCL 2.0
    • initPlatform

      protected CLPlatform initPlatform()
      Description copied from class: CLExtendable
      Retrieve the platform. This should not cache the lookup. It cannot return null by definition. This should not be called by any implementing class.
      Specified by:
      initPlatform in class CLExtendable
      Returns:
    • offer

      public CLCommandQueue offer​(CLTask task) throws CLException
      Invoke task.queue for this queue with no event lists.
      Parameters:
      task -
      Returns:
      this
      Throws:
      CLException
    • offer

      public CLCommandQueue offer​(CLTask task, CLEventList event) throws CLException
      Invoke task.queue for this queue with only an output event lists.
      Parameters:
      task -
      event -
      Returns:
      this
      Throws:
      CLException
    • offer

      public CLCommandQueue offer​(CLTask task, CLEventList wait, CLEventList event) throws CLException
      Invoke task.queue for this queue with an input and output event lists.
      Parameters:
      task -
      event -
      wait -
      Returns:
      this
      Throws:
      CLException
    • ofNOP

      @Deprecated public static CLTask ofNOP()
      Deprecated.
      use CLTask.ofNOP() instead
      Create a null task.

      This enqueues a marker.

      Returns: