public abstract class KernelRunnerJNI
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static int |
ARG_APARAPI_BUFFER
TODO:
|
protected static int |
ARG_ARRAY
This 'bit' indicates that a particular
KernelArg represents an array.So ARG_ARRAY|ARG_INT tells us this arg is an array of int . |
protected static int |
ARG_ARRAYLENGTH
This 'bit' indicates that a particular
KernelArg has it's length reference, in which case a synthetic arg is passed (name mangled) to the OpenCL kernel. |
protected static int |
ARG_BOOLEAN
This 'bit' indicates that a particular
KernelArg represents a boolean type (array or primitive). |
protected static int |
ARG_BYTE
This 'bit' indicates that a particular
KernelArg represents a byte type (array or primitive). |
protected static int |
ARG_CHAR
This 'bit' indicates that a particular
KernelArg represents a char type (array or primitive). |
protected static int |
ARG_CONSTANT
This 'bit' indicates that a particular
KernelArg resides in constant memory in the generated OpenCL code. |
protected static int |
ARG_DOUBLE
This 'bit' indicates that a particular
KernelArg represents a double type (array or primitive). |
protected static int |
ARG_EXPLICIT
This 'bit' indicates that the arg has been explicitly marked for reading
|
protected static int |
ARG_EXPLICIT_WRITE
This 'bit' indicates that the arg has been explicitly marked for writing
|
protected static int |
ARG_FLOAT
This 'bit' indicates that a particular
KernelArg represents a float type (array or primitive). |
protected static int |
ARG_GLOBAL
This 'bit' indicates that a particular
KernelArg resides in global memory in the generated OpenCL code. |
protected static int |
ARG_INT
This 'bit' indicates that a particular
KernelArg represents a int type (array or primitive). |
protected static int |
ARG_LOCAL
This 'bit' indicates that a particular
KernelArg resides in local memory in the generated OpenCL code. |
protected static int |
ARG_LONG
This 'bit' indicates that a particular
KernelArg represents a long type (array or primitive). |
protected static int |
ARG_OBJ_ARRAY_STRUCT
TODO:
|
protected static int |
ARG_PRIMITIVE
This 'bit' indicates that a particular
KernelArg represents a primitive (non array).So ARG_PRIMITIVE|ARG_INT tells us this arg is a primitive int . |
protected static int |
ARG_READ
This 'bit' indicates that a particular
KernelArg is read by the Kernel (note from the Kernel's point of view).So ARG_ARRAY|ARG_INT|ARG_READ tells us this arg is an array of int's that are read by the kernel. |
protected static int |
ARG_SHORT
TODO:
|
protected static int |
ARG_STATIC
This 'bit' indicates that a particular
KernelArg represents a static field (array or primitive). |
protected static int |
ARG_WRITE
This 'bit' indicates that a particular
KernelArg is mutated by the Kernel (note from the Kernel's point of view).So ARG_ARRAY|ARG_INT|ARG_WRITE tells us this arg is an array of int's that we expect the kernel to mutate. |
protected static int |
JNI_FLAG_USE_ACC
This 'bit' indicates that we want to execute on the Acceleratr.
|
protected static int |
JNI_FLAG_USE_GPU
This 'bit' indicates that we want to execute on the GPU.
|
Constructor and Description |
---|
KernelRunnerJNI() |
Modifier and Type | Method and Description |
---|---|
protected long |
buildProgramJNI(long _jniContextHandle,
java.lang.String _source,
java.lang.String _binaryKey) |
protected int |
disposeJNI(long _jniContextHandle) |
protected java.lang.String |
getExtensionsJNI(long _jniContextHandle) |
protected int |
getJNI(long _jniContextHandle,
java.lang.Object _array) |
protected int[] |
getKernelCompileWorkGroupSizeJNI(long _jniContextHandle) |
protected long |
getKernelLocalMemSizeInUseJNI(long _jniContextHandle) |
protected int |
getKernelMaxWorkGroupSizeJNI(long _jniContextHandle) |
protected long |
getKernelMinimumPrivateMemSizeInUsePerWorkItemJNI(long _jniContextHandle) |
protected int |
getKernelPreferredWorkGroupSizeMultipleJNI(long _jniContextHandle) |
protected java.util.List<ProfileInfo> |
getProfileInfoJNI(long _jniContextHandle) |
protected long |
initJNI(Kernel _kernel,
OpenCLDevice _device,
int _flags)
TODO:
synchronized to avoid race in clGetPlatformIDs() in OpenCL lib problem should fixed in some future OpenCL version
|
protected int |
runKernelJNI(long _jniContextHandle,
Range _range,
boolean _needSync,
int _passes,
java.nio.ByteBuffer _inBuffer,
java.nio.ByteBuffer _outBuffer) |
protected int |
setArgsJNI(long _jniContextHandle,
KernelArgJNI[] _args,
int argc) |
protected static final int ARG_BOOLEAN
KernelArg
represents a boolean
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_BYTE
KernelArg
represents a byte
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_FLOAT
KernelArg
represents a float
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_INT
KernelArg
represents a int
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_DOUBLE
KernelArg
represents a double
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_LONG
KernelArg
represents a long
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_SHORT
UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_ARRAY
KernelArg
represents an array.ARG_ARRAY|ARG_INT
tells us this arg is an array of int
.UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_PRIMITIVE
KernelArg
represents a primitive (non array).ARG_PRIMITIVE|ARG_INT
tells us this arg is a primitive int
.UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_READ
KernelArg
is read by the Kernel (note from the Kernel's point of view).ARG_ARRAY|ARG_INT|ARG_READ
tells us this arg is an array of int's that are read by the kernel.UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_WRITE
KernelArg
is mutated by the Kernel (note from the Kernel's point of view).ARG_ARRAY|ARG_INT|ARG_WRITE
tells us this arg is an array of int's that we expect the kernel to mutate.UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_LOCAL
KernelArg
resides in local memory in the generated OpenCL code.UsedByJNICode
,
Experimental
,
Constant Field Valuesprotected static final int ARG_GLOBAL
KernelArg
resides in global memory in the generated OpenCL code.UsedByJNICode
,
Experimental
,
Constant Field Valuesprotected static final int ARG_CONSTANT
KernelArg
resides in constant memory in the generated OpenCL code.UsedByJNICode
,
Experimental
,
Constant Field Valuesprotected static final int ARG_ARRAYLENGTH
KernelArg
has it's length reference, in which case a synthetic arg is passed (name mangled) to the OpenCL kernel.UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_APARAPI_BUFFER
UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_EXPLICIT
UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_EXPLICIT_WRITE
UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_OBJ_ARRAY_STRUCT
UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_CHAR
KernelArg
represents a char
type (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int ARG_STATIC
KernelArg
represents a static
field (array or primitive).UsedByJNICode
,
Constant Field Valuesprotected static final int JNI_FLAG_USE_GPU
UsedByJNICode
,
Constant Field Valuesprotected static final int JNI_FLAG_USE_ACC
UsedByJNICode
,
Constant Field Valuesprotected long initJNI(Kernel _kernel, OpenCLDevice _device, int _flags)
_kernel
- _device
- _flags
- protected int getJNI(long _jniContextHandle, java.lang.Object _array)
protected long buildProgramJNI(long _jniContextHandle, java.lang.String _source, java.lang.String _binaryKey)
_source
- The OpenCL source code to compile, which may be sent empty if the binary for that source code is known to be cached on the JNI side
under the key _binaryKey
._binaryKey
- A key which embodies a Kernel class and a Device, under which the JNI side will cache the compiled binary corresponding to that Kernel/Device
pair. Once a certain _binaryKey has been passed to this method once, further calls to this method with that key will ignore the _source (which
can be passed empty) andused the cached binary.
By passing an empty String as the _binaryKey, the entire JNI-side binary caching apparatus can be disabled.
protected int setArgsJNI(long _jniContextHandle, KernelArgJNI[] _args, int argc)
protected int runKernelJNI(long _jniContextHandle, Range _range, boolean _needSync, int _passes, java.nio.ByteBuffer _inBuffer, java.nio.ByteBuffer _outBuffer)
protected int disposeJNI(long _jniContextHandle)
protected java.lang.String getExtensionsJNI(long _jniContextHandle)
protected java.util.List<ProfileInfo> getProfileInfoJNI(long _jniContextHandle)
protected long getKernelMinimumPrivateMemSizeInUsePerWorkItemJNI(long _jniContextHandle)
protected long getKernelLocalMemSizeInUseJNI(long _jniContextHandle)
protected int getKernelPreferredWorkGroupSizeMultipleJNI(long _jniContextHandle)
protected int getKernelMaxWorkGroupSizeJNI(long _jniContextHandle)
protected int[] getKernelCompileWorkGroupSizeJNI(long _jniContextHandle)