Hi,
When adding a local memory region as a kernel argument using:
clSetKernelArg( kernel, argnum, len, NULL );
Error -51 (CL_INVALID_ARG_SIZE) is return if len==0.
Don't know if this conforms to the spec, but it is different behaviour to the Nvidia conformance release.
what is the behaviour under Nvidia.
I feel returning error is acceptable and good.
The current Nvidia release accepts a zero-length __local argument.
By the looks of things the spec is silent on this particular corner case, so I'm content to accept this as implementation-specific behaviour.
It actually is covered in the OpenCL specification:
clSetKernelArg returns CL_SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
- CL_INVALID_ARG_SIZE if arg_size does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object and arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler).
Fair enough. Looks like I should report this to the Other Place.
Matt