cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

mjharvey
Adept I

beta4 problem: clSetKernelArg and zero-length __local argument

beta4 problem

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.

0 Likes
4 Replies
genaganna
Journeyman III

what is the behaviour under Nvidia.

 

I feel returning error is acceptable and good.

0 Likes

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.

 

0 Likes

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).

0 Likes

Fair enough. Looks like I should report this to the Other Place.

Matt

0 Likes