Class CL
java.lang.Object
javaforce.cl.CL
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclose(long ctx) Release an OpenCL context.longCreate OpenGL Context (type = TYPE_DEFAULT).longCreate OpenGL Context with source code.longcreateBuffer(long ctx, int size, int type) longcreateReadBuffer(long ctx, int size) Create a read-only buffer.longcreateReadWriteBuffer(long ctx, int size) Create a read-write buffer.longcreateWriteBuffer(long ctx, int size) Create a write-only buffer.booleanexecute(long ctx, long kernel, int count) Execute a kernel with one counter.booleanexecute2(long ctx, long kernel, int count1, int count2) Execute a kernel with two counters.booleanexecute3(long ctx, long kernel, int count1, int count2, int count3) Execute a kernel with three counters.booleanexecute4(long ctx, long kernel, int count1, int count2, int count3, int count4) Execute a kernel with four counters.booleanfreeBuffer(long ctx, long buffer) Release a buffer.booleanfreeKernel(long ctx, long kernel) Release a kernel.static CLlongCreate OpenGL Kernel.booleanreadBuffer(long ctx, long buffer, byte[] data) Read from a buffer.booleanreadBuffer(long ctx, long buffer, float[] data) Read from a buffer.booleansetArg(long ctx, long kernel, int idx, byte[] value) Set a kernel parameter.booleansetArg(long ctx, long kernel, int idx, int value) Set a kernel parameter.booleansetArg(long ctx, long kernel, int idx, long value) Set a kernel parameter.booleanwriteBuffer(long ctx, long buffer, byte[] data) Write to a buffer.booleanwriteBuffer(long ctx, long buffer, float[] data) Write to a buffer.booleanwriteBufferf32(long ctx, long buffer, float[] value) booleanwriteBufferi8(long ctx, long buffer, byte[] value)
-
Field Details
-
TYPE_DEFAULT
public static final int TYPE_DEFAULT- See Also:
-
TYPE_CPU
public static final int TYPE_CPU- See Also:
-
TYPE_GPU
public static final int TYPE_GPU- See Also:
-
TYPE_ACCELERATOR
public static final int TYPE_ACCELERATOR- See Also:
-
MEM_READ_WRITE
public static final int MEM_READ_WRITE- See Also:
-
MEM_WRITE
public static final int MEM_WRITE- See Also:
-
MEM_READ
public static final int MEM_READ- See Also:
-
-
Constructor Details
-
CL
public CL()
-
-
Method Details
-
getInstance
-
create
Create OpenGL Context with source code. close() context to release it.- Parameters:
src- = OpenCL source codetype- = TYPE_...
-
create
Create OpenGL Context (type = TYPE_DEFAULT). close() context to release it.- Parameters:
src- = OpenCL source code
-
kernel
Create OpenGL Kernel. freeKernel() to release it.- Parameters:
ctx- = OpenCL Contextfunc- = function name
-
createBuffer
public long createBuffer(long ctx, int size, int type) -
createReadBuffer
public long createReadBuffer(long ctx, int size) Create a read-only buffer. -
createWriteBuffer
public long createWriteBuffer(long ctx, int size) Create a write-only buffer. -
createReadWriteBuffer
public long createReadWriteBuffer(long ctx, int size) Create a read-write buffer. -
setArg
public boolean setArg(long ctx, long kernel, int idx, byte[] value) Set a kernel parameter. -
setArg
public boolean setArg(long ctx, long kernel, int idx, int value) Set a kernel parameter. -
setArg
public boolean setArg(long ctx, long kernel, int idx, long value) Set a kernel parameter. -
writeBufferi8
public boolean writeBufferi8(long ctx, long buffer, byte[] value) -
writeBufferf32
public boolean writeBufferf32(long ctx, long buffer, float[] value) -
writeBuffer
public boolean writeBuffer(long ctx, long buffer, byte[] data) Write to a buffer. -
writeBuffer
public boolean writeBuffer(long ctx, long buffer, float[] data) Write to a buffer. -
execute
public boolean execute(long ctx, long kernel, int count) Execute a kernel with one counter. -
execute2
public boolean execute2(long ctx, long kernel, int count1, int count2) Execute a kernel with two counters. -
execute3
public boolean execute3(long ctx, long kernel, int count1, int count2, int count3) Execute a kernel with three counters. -
execute4
public boolean execute4(long ctx, long kernel, int count1, int count2, int count3, int count4) Execute a kernel with four counters. -
readBuffer
public boolean readBuffer(long ctx, long buffer, byte[] data) Read from a buffer. -
readBuffer
public boolean readBuffer(long ctx, long buffer, float[] data) Read from a buffer. -
freeKernel
public boolean freeKernel(long ctx, long kernel) Release a kernel. -
freeBuffer
public boolean freeBuffer(long ctx, long buffer) Release a buffer. -
close
public boolean close(long ctx) Release an OpenCL context.
-