Re: Passing array of arrays to OpenCL via JOCL?
Posted by
Michael Bien on
May 10, 2011; 6:41pm
URL: https://forum.jogamp.org/Passing-array-of-arrays-to-OpenCL-via-JOCL-tp2922911p2924235.html
sub buffers are behaving just like normal buffers and are used in the
kernel like normal global memory.
They are views of certain buffer regions and may even overlap with other
subbuffers.
CLBuffer<FloatBuffer> buffer = context.createFloatBuffer(64);
CLSubBuffer<FloatBuffer> subBuffer = buffer.createSubBuffer(start,
lenght);
CLSubBuffer extends CLBuffer. OpenCL 1.1 does only support creating
subbuffers from buffers, deeper hierarchies are not supported.
(very similar as the java.nio.Buffer.slice() API but you can slice() as
deep as you wish)
best regards,
michael
On 05/10/2011 05:38 PM, John_Idol [via jogamp] wrote:
> Thanks a lot for this Michael,
>
> I think I will pass every buffer as a kernel argument as I need to pass down
> only a few variable, so I won't bother calculating offsets.
>
> As a matter of interest though, would you be able to point me to an usage
> example of CLSubBuffers and how they are declared in the __kernel functions?
>
> Best Regards,
>
> Giovanni
>