Package civitas.celestis.gpu
Class GPU
java.lang.Object
civitas.celestis.gpu.GPU
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 Summary
Modifier and TypeMethodDescriptionstatic KernelReferencecreateKernel(KernelSource source) Creates a new kernel, then returns a reference to the created kernel.static KernelReferencecreateKernel(String source, String name, int paramCount) Creates a new kernel, then returns a reference to the created kernel.static voiddispose()Releases all resources this interface is holding.static voidInitializes this interface.
-
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 theGPUinterface 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 programname- The qualified name of the kernel's methodparamCount- The number of parameters the kernel takes (including output)- Returns:
- A reference object to the created kernel
- Throws:
GraphicsException- When theGPUinterface has not been initialized- See Also:
-
createKernel
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 theGPUinterface has not been initialized- See Also:
-