Hello,
I needed to define some things to make previous OpenCL code work.
#define __constant __const
#define true 1
#define false 0
Also, indexing in float4s does not work, i.e.
float4 f; // not working float a = f[3] ;
Originally posted by: lust Hello,
I needed to define some things to make previous OpenCL code work.
#define __constant __const
#define true 1
#define false 0
__const, true, false etc are not keywords as per OpenCL specification, which means they will have to be defined explicitly, in case you need to use them.
Also, indexing in float4s does not work, i.e.
This is due to incorrect way of indexing, you can access the 3rd element of a float4 variable by either f.z or f.s2
Well, about true or false it is ok, but nVidia's OpenCL SDK supports indexing in float4s. This is crucial for our application, since it is too frequently used and if we replace it by a swith/case construct this may yield a lot of divergence.
Support for array like indexing for float4 is not a requirement as per OpenCL Specification
Well, it would be nice, and comfortable, for us, poor developers More than the spec is always better