Package cz.fidentis.analyst.opencl
Interface OpenCLServices
public interface OpenCLServices
Stateless services for compiling OpenCL programs.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic com.jogamp.opencl.CLContext
Creates OpenCL Context using most powerful available device The decision of the device relies on inner calculations of JogAmp's implementation, which can mistake number of processing units on cards RTX 4xxx as of version 2.5.0static boolean
Checks if any present device supports OpenCL or returns false straight away, if initialization is impossible Also enforces minimal supported work group size to 256 as this value needs to be present as constant in .c source filesstatic void
release
(com.jogamp.opencl.CLContext clContext) Should be called before the OpenCL context is erased.static CLProgram
useProgram
(com.jogamp.opencl.CLContext clContext, CLProgramDef programDef) Compiles the OpenCL program, re-uses already compiled programs.
-
Method Details
-
isOpenCLAvailable
static boolean isOpenCLAvailable()Checks if any present device supports OpenCL or returns false straight away, if initialization is impossible Also enforces minimal supported work group size to 256 as this value needs to be present as constant in .c source files- Returns:
- true, if OpenCL is available, false otherwise
-
createContext
static com.jogamp.opencl.CLContext createContext()Creates OpenCL Context using most powerful available device The decision of the device relies on inner calculations of JogAmp's implementation, which can mistake number of processing units on cards RTX 4xxx as of version 2.5.0- Returns:
- OpenCL context
-
useProgram
Compiles the OpenCL program, re-uses already compiled programs.- Parameters:
clContext
- OpenCL context. Must not benull
.programDef
- OpenCL program definition- Returns:
- The reference object to the compiled OpenCL program
-
release
static void release(com.jogamp.opencl.CLContext clContext) Should be called before the OpenCL context is erased.- Parameters:
clContext
- OpenCL context. Must not benull
.
-