Package cz.fidentis.analyst.opencl.impl
Class CLProgramsManager
java.lang.Object
cz.fidentis.analyst.opencl.impl.CLProgramsManager
This object deals with programs of a single OpenCL context.
The compilation of programs is lazy (only after the first request).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.jogamp.opencl.CLContext
Returns the OpenCL contextgetOrCompile
(CLProgramDef programSpec, Map<com.jogamp.opencl.CLDevice, byte[]> binaries) Lazy compilation and re-used of CL programs.void
release
(CLProgramDef programDef) Removes the program and its shaders from this manager and from GPU memory.void
Removes all programs, asks for releasing GPU memory.
-
Constructor Details
-
CLProgramsManager
public CLProgramsManager(com.jogamp.opencl.CLContext clContext) Constructor.- Parameters:
clContext
- OpenCL context. Must not benull
.
-
-
Method Details
-
getOrCompile
public CompiledCLProgram getOrCompile(CLProgramDef programSpec, Map<com.jogamp.opencl.CLDevice, byte[]> binaries) throws com.jogamp.opencl.CLExceptionLazy compilation and re-used of CL programs.- Parameters:
programSpec
- Which CL program to compile/return- Returns:
- The reference object to the compiled CL program
- Throws:
com.jogamp.opencl.CLException
- if the compilation fails
-
release
Removes the program and its shaders from this manager and from GPU memory.- Parameters:
programDef
- Which CL program to release
-
releaseAll
public void releaseAll()Removes all programs, asks for releasing GPU memory. -
getClContext
public com.jogamp.opencl.CLContext getClContext()Returns the OpenCL context- Returns:
- the OpenCL context
-