PDA

View Full Version : What should arg_size be when passing NULL to clSetKernelArg?



coleb
04-21-2010, 10:31 AM
The standard allows NULL to be passed as the arg_value parameter to clSetKernelArg when you want a global pointer argument of a kernel to be NULL. However, it doesn't specify what value should be passed as arg_size, does it matter? Should it be 0 or sizeof(void *) or sizeof(cl_mem)? They all seem like reasonable things to pass.

Thanks,
Brian

ibbles
04-21-2010, 11:16 AM
I would guess sizeof(cl_mem), as this is the value passed for all other, i.e. non-NULL, global pointers. See no reason to change it.