Package com.jme3.opencl
Class Program
java.lang.Object
com.jme3.opencl.AbstractOpenCLObject
com.jme3.opencl.Program
- All Implemented Interfaces:
- OpenCLObject
- Direct Known Subclasses:
- LwjglProgram
A wrapper for an OpenCL program. A program is created from kernel source code,
 manages the build process and creates the kernels.
 
 Warning: Creating the same kernel more than one leads to undefined behaviour,
 this is especially important for createAllKernels()
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.jme3.opencl.OpenCLObjectOpenCLObject.ObjectReleaser
- 
Field SummaryFields inherited from class com.jme3.opencl.AbstractOpenCLObjectreleaser
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbuild()Builds this program without additional argumentsabstract voidBuilds this program with the specified argument string on the specified devices.abstract Kernel[]Creates all available kernels in this program.abstract KernelcreateKernel(String name) Creates the kernel with the specified name.abstract ByteBufferQueries a compiled binary representation of this program for a particular device.register()Registers this object for automatic releasing on garbage collection.Methods inherited from class com.jme3.opencl.AbstractOpenCLObjectfinalize, getReleaser, release
- 
Constructor Details- 
Program
 
- 
- 
Method Details- 
registerDescription copied from interface:OpenCLObjectRegisters this object for automatic releasing on garbage collection. By default, OpenCLObjects are not registered in theOpenCLObjectManager, you have to release it manually by callingOpenCLObject.release(). Without registering or releasing, a memory leak might occur.
 Returnsthisto allow calls likeBuffer buffer = clContext.createBuffer(1024).register();.- Specified by:
- registerin interface- OpenCLObject
- Overrides:
- registerin class- AbstractOpenCLObject
- Returns:
- this
 
- 
buildBuilds this program with the specified argument string on the specified devices. Please see the official OpenCL specification for a definition of all supported arguments. The list of devices specify on which device the compiled program can then be executed. It must be a subset ofContext.getDevices(). Ifnullis passed, the program is built on all available devices.- Parameters:
- args- the compilation arguments
- devices- a list of devices on which the program is build.
- Throws:
- KernelCompilationException- if the compilation fails
- See Also:
 
- 
buildBuilds this program without additional arguments- Throws:
- KernelCompilationException- if the compilation fails
 
- 
createKernelCreates the kernel with the specified name.- Parameters:
- name- the name of the kernel as defined in the source code
- Returns:
- the kernel object
- Throws:
- OpenCLException- if the kernel was not found or some other error occurred
 
- 
createAllKernelsCreates all available kernels in this program. The names of the kernels can then be queried byKernel.getName().- Returns:
- an array of all kernels
 
- 
getBinaryQueries a compiled binary representation of this program for a particular device. This binary can then be used e.g. in the next application launch to create the program from the binaries and not from the sources. This saves time.- Parameters:
- device- the device from which the binaries are taken
- Returns:
- the binaries
- See Also:
 
 
-