[cfe-dev] constructor notation for vector types

Jochen Wilhelmy j.wilhelmy at arcor.de
Thu Oct 15 00:33:47 PDT 2009


Hi Chris!

>
> In a language like opencl, the "opencl compiler" typically implicitly 
> #includes a header that sets up a bunch of #defines, typedefs, builtin 
> function declarations etc.  I think that int4 should just be a class 
> defined in the header, and then everything would just work.

I'm not a language expert but I think opencl does not support int4(1,2,3,4).
And how can I define int4 (or float4) as a class while at the same time it
is a built in vector type?
I would start my implicit header file with
typedef __attribute__(( ext_vector_type(4) )) float float4;

Jochen




More information about the cfe-dev mailing list