Class CommandQueue

All Implemented Interfaces:
OpenCLObject
Direct Known Subclasses:
LwjglCommandQueue

public abstract class CommandQueue extends AbstractOpenCLObject
Wrapper for an OpenCL command queue. The command queue serializes every GPU function call: By passing the same queue to OpenCL function (buffer, image operations, kernel calls), it is ensured that they are executed in the order in which they are passed.
Each command queue is associated with exactly one device: that device is specified on creation (Context.createQueue(com.jme3.opencl.Device)) and all commands are sent to this device.
  • Field Details

    • device

      protected Device device
  • Constructor Details

  • Method Details

    • register

      public CommandQueue register()
      Description copied from interface: OpenCLObject
      Registers this object for automatic releasing on garbage collection. By default, OpenCLObjects are not registered in the OpenCLObjectManager, you have to release it manually by calling OpenCLObject.release(). Without registering or releasing, a memory leak might occur.
      Returns this to allow calls like Buffer buffer = clContext.createBuffer(1024).register();.
      Specified by:
      register in interface OpenCLObject
      Overrides:
      register in class AbstractOpenCLObject
      Returns:
      this
    • getDevice

      public Device getDevice()
      Returns the device associated with this command queue. It can be used to query properties of the device that is used to execute the commands issued to this command queue.
      Returns:
      the associated device
    • flush

      public abstract void flush()
      Issues all previously queued OpenCL commands in command_queue to the device associated with command queue. Flush only guarantees that all queued commands to command_queue will eventually be submitted to the appropriate device. There is no guarantee that they will be complete after flush returns.
    • finish

      public abstract void finish()
      Blocks until all previously queued OpenCL commands in command queue are issued to the associated device and have completed. Finish does not return until all previously queued commands in command queue have been processed and completed. Finish is also a synchronization point.