by dar » Mon Sep 02, 2013 12:32 pm
Yes, you may use common vectors like float4, int2, etc. , and the operations will be serialized. Please note the restrictions on access/swizzle operations and the GCC syntax for initializing vectors. For example, for a float4, v.x, v.y, v.z, v.w, v.xy, and v.zw are supported, but other combinations are not. The OpenCL swizzle operator breaks C compliance (and is unnecessary) so there is only so much we can get mainline GCC to support right now. Also, initializing vectors must use the GCC notation {} vs the Apple notation (). For portability you should use an initializer anyway, and one is provided, e.g., __builtin_vector_float4(x,y,z,w) which will compile to GCC or Apple notation depending on what platform you are using, if you include stdcl.h in your kernels. These __builtin_vector_*() macros are trivial, you can write them yourself to create C compliant kernels.