Class Event

All Implemented Interfaces:
OpenCLObject
Direct Known Subclasses:
LwjglEvent

public abstract class Event extends AbstractOpenCLObject
Wrapper for an OpenCL Event object. Events are returned from kernel launches and all asynchronous operations. They allow us to test whether an action has completed and block until the operation is done.
  • Constructor Details

  • Method Details

    • register

      public Event 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
    • waitForFinished

      public abstract void waitForFinished()
      Waits until the action has finished (blocking). This automatically releases the event.
    • isCompleted

      public abstract boolean isCompleted()
      Tests if the action is completed. If the action is completed, the event is released.
      Returns:
      true if the action is completed