LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Dr.Haribo on August 22, 2011, 19:50:17

Title: How to pass uint2 argument to OpenCL kernel?
Post by: Dr.Haribo on August 22, 2011, 19:50:17
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.
Title: Re: How to pass uint2 argument to OpenCL kernel?
Post by: spasi on August 22, 2011, 20:29:35
You need to use an IntBuffer. See CL10.clSetKernelArg(CLKernel kernel, int arg_index, IntBuffer arg_value).
Title: Re: How to pass uint2 argument to OpenCL kernel?
Post by: Dr.Haribo on August 22, 2011, 20:37:05
Ah, I was looking at the CLKernel interface. Thanks!