[OpenCL] size_t Not Allowed in Kernels Arguments
The current available version (1.8.4) of GPU Caps Viewer displays a nice error message when you try to run the Surface Deformer OpenCL demo with the latest NVIDIA drivers.
Recently (I can’t tell you when), NVIDIA has updated its OpenCL drivers and now the OpenCL compiler respects one of the OpenCL language restrictions:
Arguments to __kernel functions in a program cannot be declared with the built-in scalar types bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t. The size in bytes of these types except half are implementation-defined and in addition can also be different for the OpenCL device and the host processor making it difficult to allocate buffer objects to be passed as arguments to a kernel declared as pointer to these types. half is not supported as half can be used as a storage format only and is not a data type on which floating-point arithmetic can be performed.
In the surface deformer demo of GPU Caps 1.8.4 (and previous versions as well), the OpenCL kernel is declared with two size_t arguments. I never saw this problem until now. Actually this is not a problem: it’s just a better respect of OpenCL specifications…
size_t can be a 32-bit or a 64-bit unsigned integer, and the OpenCL compiler does not accept variable types that are implementation-dependent.
The error will be fixed (size_t replaced by unsigned int) for the next version of GPU Caps that should be available soon.