Class GPU

java.lang.Object
civitas.celestis.gpu.GPU

public final class GPU extends Object
An interface which handles the back-end operations of OpenCL. This API is dependent on JOCL. Unlike other classes of the Plains API, this class does not statically initialize itself. Thus, initialize() must be called before any other method is to be invoked.
See Also:
  • Method Details

    • initialize

      public static void initialize()
      Initializes this interface. This must be called before any other method.
    • dispose

      public static void dispose()
      Releases all resources this interface is holding. This disposes every object reference, resetting the state of this interface. Re-initialization is required in order to use the interface again.
      Throws:
      GraphicsException - When the GPU interface has not been initialized
    • createKernel

      @Nonnull public static KernelReference createKernel(@Nonnull String source, @Nonnull String name, int paramCount)
      Creates a new kernel, then returns a reference to the created kernel.
      Parameters:
      source - The source code of the kernel program
      name - The qualified name of the kernel's method
      paramCount - The number of parameters the kernel takes (including output)
      Returns:
      A reference object to the created kernel
      Throws:
      GraphicsException - When the GPU interface has not been initialized
      See Also:
    • createKernel

      @Nonnull public static KernelReference createKernel(@Nonnull KernelSource source)
      Creates a new kernel, then returns a reference to the created kernel.
      Parameters:
      source - The source of the kernel
      Returns:
      A reference object to the created kernel
      Throws:
      GraphicsException - When the GPU interface has not been initialized
      See Also: