Login  Register

Re: Kernel with argumrnt of type structures

Posted by Michael Bien on Sep 14, 2011; 2:33pm
URL: https://forum.jogamp.org/Kernel-with-argumrnt-of-type-structures-tp3335853p3335999.html


On 09/14/2011 03:51 PM, suleman [via jogamp] wrote:
> Hi,
>
> I am converting a OpenCL application to a Java-based version (using JOCL).
> The kernel of this application has a structure type argument too,
> My question is that how can we pass structure to the kernel from Java/JOCL
> application, or do we need to change the kernel ?
>
> Many thanks
>
you can pass them as ByteBuffers or generate a struct accessor with
gluegen (which is just a facade for the ByteBuffer).

julia3d uses structs in its kernels
https://github.com/mbien/jocl-demos/blob/master/src/com/jogamp/opencl/demos/julia3d/Julia3d.java#L203

https://github.com/mbien/jocl-demos/blob/master/src/com/jogamp/opencl/demos/julia3d/config.h

regards,
michael

--
http://michael-bien.com/