Interface OpenCLObject

All Known Implementing Classes:
AbstractOpenCLObject, Buffer, CommandQueue, Context, Event, Image, Kernel, LwjglBuffer, LwjglCommandQueue, LwjglContext, LwjglEvent, LwjglImage, LwjglKernel, LwjglProgram, Program

public interface OpenCLObject
Base interface of all native OpenCL objects. This interface provides the functionality to safely release the object.
  • Method Details

    • getReleaser

      Returns the releaser object. Multiple calls should return the same object. The ObjectReleaser is used to release the OpenCLObject when it is garbage collected. Therefore, the returned object must not hold a reference to the OpenCLObject.
      Returns:
      the object releaser
    • release

      void release()
      Releases this native object. Should delegate to getReleaser().release().
    • register

      OpenCLObject register()
      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 release(). Without registering or releasing, a memory leak might occur.
      Returns this to allow calls like Buffer buffer = clContext.createBuffer(1024).register();.
      Returns:
      this