spectral

Passing NULL pointer to the kernel ?

Discussion created by spectral on Jul 26, 2010
Latest reply on Jul 29, 2010 by rick.weber

The OpenCL specification (1.0.43) seems to indicate that it's legal to pass a NULL pointer to an OpenCL kernel:

"A NULL value can also be specified if the argument is a buffer object in which case a NULL value will be used as the value for the argument declared as a pointer to __global or __constant memory in the kernel." and "The memory object specified as argument value must be a buffer object (or NULL) if the argument is declared to be a pointer of a built-in or user defined type with the __global or __constant qualifier."

But I got a crash when I do this !

 

ERROR: clSetKernelArg(-38)

 

In my case, sometimes I have nothing to pass to the kernel... how should I do ?

Outcomes