Hello John,
i am afraid but i believe you can't do that with OpenCL yet.
for example a kernel declaration would have to look like:
kernel void compute(global int** array) { }
but that won't compile with current drivers.
OpenCL spec 6.8 Language Restrictions:
"Arguments to __kernel functions in a program cannot be declared as a
pointer to a
pointer(s). Variables inside a function or arguments to non __kernel
functions in a
program can be declared as a pointer to a pointer(s)."
So you will have to find a workaround. You could try to flatten out your
ND buffer in a 1D buffer and calculate the offset in the kernel.
If its rather a small array of buffers but not a ND buffer, you could
just pass every buffer as kernel argument.
a few features which might be useful:
- you can create CLSubBuffers from CLBuffers if you are using CL1.1
- (or you could just use a plain CLBuffer, calculate offsets in the
kernel and .slice() the java.util.Buffer for your convenience)
just keep your questions coming :)
best regards,
michael
On 05/10/2011 02:47 PM, John_Idol [via jogamp] wrote:
>
> Are you ready for yet another OpenCL/JOCL beginner question?
>
> Here we go: I am in need of passing down to a given kernel an array of
> arrays, frantically looking for examples but can't seem to find any.
>
> Can I do something like the following?
>
> CLBuffer<CLBuffer<FloatBuffer>> clBufferOfBuffers = new etc.
>
> Or am I better off just passing different buffers one for each the items I
> need to pass for a given index?
>
> Any help/advice appreciated.
>