summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-01-15 16:08:32 +0100
committerMichael Bien <[email protected]>2010-01-15 16:08:32 +0100
commit8eec5909a7f480497846f62729a47820aa55e188 (patch)
treef51cf420e21c11be0de39629ad1b298e5f5a87e8 /src/com/mbien/opencl
parent9e650242da44a939e6a4c1e3c06d77c2e668a3e0 (diff)
fixed bug in number of kernel arguments query.
Diffstat (limited to 'src/com/mbien/opencl')
-rw-r--r--src/com/mbien/opencl/CLKernel.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/mbien/opencl/CLKernel.java b/src/com/mbien/opencl/CLKernel.java
index 2115a9f8..30ccc202 100644
--- a/src/com/mbien/opencl/CLKernel.java
+++ b/src/com/mbien/opencl/CLKernel.java
@@ -11,10 +11,11 @@ import static com.mbien.opencl.CL.*;
/**
* High level abstraction for an OpenCL Kernel.
- * "A kernel is a function declared in a program. A kernel is identified by the __kernel qualifier
- * applied to any function in a program. A kernel object encapsulates the specific __kernel
+ * CLKernel is not threadsafe.
+ * "A kernel is a function declared in a program. A kernel is identified by the <code>kernel</code> qualifier
+ * applied to any function in a program. A kernel object encapsulates the specific <code>kernel</code>
* function declared in a program and the argument values to be used when executing this
- * __kernel function."
+ * <code>kernel</code> function."
* @author Michael Bien
*/
public class CLKernel implements CLResource {
@@ -50,10 +51,10 @@ public class CLKernel implements CLResource {
this.name = CLUtils.clString2JavaString(bb.array(), bb.capacity());
// get number of arguments
- ret = cl.clGetKernelInfo(ID, CL_KERNEL_NUM_ARGS, 0, null, longArray, 0);
+ ret = cl.clGetKernelInfo(ID, CL_KERNEL_NUM_ARGS, bb.capacity(), bb, null, 0);
checkForError(ret, "error while asking for number of function arguments.");
- numArgs = (int)longArray[0];
+ numArgs = bb.getInt(0);
}