public class OpenCompute extends Object
Constructor and Description |
---|
OpenCompute() |
Modifier and Type | Method and Description |
---|---|
static com.jogamp.opencl.CLContext |
getContext() |
static com.jogamp.opencl.CLDevice |
getDevice() |
static int |
getGlobalSize(int size)
Calculates the number of work groups.
|
static int |
getGlobalSize(int size,
int localWorkSize)
Calculates the number of work groups.
|
static com.jogamp.opencl.CLKernel |
getKernel(com.jogamp.opencl.CLProgram program,
String name) |
static com.jogamp.opencl.CLKernel |
getKernel(com.jogamp.opencl.CLProgram program,
String name,
boolean threaded)
Returns a
CLKernel that is part of the given CLProgram . |
static int |
getLocalSize()
Calculates the number of local work units per work group.
|
static int |
getLocalSize(int max)
Calculates the number of local work units per work group, applying a specified maximum.
|
static com.jogamp.opencl.CLPlatform |
getPlatform() |
static com.jogamp.opencl.CLProgram |
getProgram(String name)
Returns an OpenCL program, loading it synchronously if it's not in cache.
|
static com.jogamp.opencl.CLCommandQueue |
getQueue() |
static void |
initContext(com.jogamp.opencl.CLPlatform platform)
Initializes the
CLContext , CLDevice and CLCommandQueue for the given
CLPlatform . |
static void |
release()
Static de-initializer.
|
public static com.jogamp.opencl.CLProgram getProgram(String name)
name
- the program filenamepublic static com.jogamp.opencl.CLKernel getKernel(com.jogamp.opencl.CLProgram program, String name)
public static com.jogamp.opencl.CLKernel getKernel(com.jogamp.opencl.CLProgram program, String name, boolean threaded)
CLKernel
that is part of the given CLProgram
.program
- the CLProgram
that contains the kernelname
- the name of the kernelthreaded
- if true, always create a new CLKernel
instanceCLKernel
public static void initContext(com.jogamp.opencl.CLPlatform platform)
CLContext
, CLDevice
and CLCommandQueue
for the given
CLPlatform
.platform
- the CLPlatform
to usepublic static int getGlobalSize(int size)
size
- the total number of local work unitspublic static int getGlobalSize(int size, int localWorkSize)
size
- the total number of local work unitslocalWorkSize
- the number of local work units per work grouppublic static int getLocalSize()
public static int getLocalSize(int max)
max
- the maximum size allowedpublic static void release()
CLProgram
, CLKernel
and
CLContext
instances.public static com.jogamp.opencl.CLPlatform getPlatform()
public static com.jogamp.opencl.CLContext getContext()
public static com.jogamp.opencl.CLDevice getDevice()
public static com.jogamp.opencl.CLCommandQueue getQueue()
Copyright © 2021. All rights reserved.