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 on the AMD SDK, and I think that NVidia doesn’ support it as well.
In my case, sometimes I have nothing to pass to the kernel… how should I do ?