How to pass uint2 argument to OpenCL kernel?

Started by Dr.Haribo, August 22, 2011, 19:50:17

Previous topic - Next topic

Dr.Haribo

With the C interface you can pass an array of ints as a kernel argument, and set the appropriate size of the data passed. Such arguments are vectors on the OpenCL side.

Is it possible to do this through LWJGL?

Perhaps I can pass 2 ints as a long and use that as an int2 on the OpenCL side. But what about an int4 argument? Methods taking array arguments would be nice.

spasi

You need to use an IntBuffer. See CL10.clSetKernelArg(CLKernel kernel, int arg_index, IntBuffer arg_value).

Dr.Haribo

Ah, I was looking at the CLKernel interface. Thanks!