PDA

View Full Version : Using a single integer value(not a pointer as parameter for?



o4kareg2
08-29-2012, 10:36 AM
Hello GPGPU hackers!

How to use the normal integer values not a pionter as kernel arguments?
can someone give here a short example?

Dithermaster
09-01-2012, 09:21 AM
Most of the OpenCL examples from any of the vendors include an example of this. It's similar to passing pointers as kernel args, but instead of passing the pointer value, you pass the address of the scalar value.

clSetKernelArg(kernel, 0, sizeof(int), &someInt);