typedef uint sampler_t;
typedef size_t event_t;
/////////////////////////////////////////////////////////////////////////////
+// OpenCL conversions & type casting
+/////////////////////////////////////////////////////////////////////////////
+#define DEF(type, n, type2) type##n INLINE_OVERLOADABLE convert_##type##n(type2##n d) { \
+ return (type##n)((type)(d.s0), (type)(d.s1), (type)(d.s2), (type)(d.s3)); \
+ }
+#define DEF2(type) DEF(type, 4, char); \
+ DEF(type, 4, uchar); \
+ DEF(type, 4, short); \
+ DEF(type, 4, ushort); \
+ DEF(type, 4, int); \
+ DEF(type, 4, uint); \
+ DEF(type, 4, long); \
+ DEF(type, 4, ulong); \
+ DEF(type, 4, float);
+DEF2(char);
+DEF2(uchar);
+DEF2(short);
+DEF2(ushort);
+DEF2(int);
+DEF2(uint);
+DEF2(long);
+DEF2(ulong);
+DEF2(float);
+#undef DEF2
+#undef DEF
+/////////////////////////////////////////////////////////////////////////////
// OpenCL preprocessor directives & macros
/////////////////////////////////////////////////////////////////////////////
#define __OPENCL_VERSION__ 110
"typedef uint sampler_t;\n"
"typedef size_t event_t;\n"
"/////////////////////////////////////////////////////////////////////////////\n"
+"// OpenCL conversions & type casting\n"
+"/////////////////////////////////////////////////////////////////////////////\n"
+"#define DEF(type, n, type2) type##n INLINE_OVERLOADABLE convert_##type##n(type2##n d) {\\\n"
+" return (type##n)((type)(d.s0), (type)(d.s1), (type)(d.s2), (type)(d.s3));\\\n"
+"}\n"
+"#define DEF2(type) DEF(type, 4, char); \\\n"
+" DEF(type, 4, uchar); \\\n"
+" DEF(type, 4, short); \\\n"
+" DEF(type, 4, ushort); \\\n"
+" DEF(type, 4, int); \\\n"
+" DEF(type, 4, uint); \\\n"
+" DEF(type, 4, long); \\\n"
+" DEF(type, 4, ulong); \\\n"
+" DEF(type, 4, float);\n"
+"DEF2(char);\n"
+"DEF2(uchar);\n"
+"DEF2(short);\n"
+"DEF2(ushort);\n"
+"DEF2(int);\n"
+"DEF2(uint);\n"
+"DEF2(long);\n"
+"DEF2(ulong);\n"
+"DEF2(float);\n"
+"#undef DEF2\n"
+"#undef DEF\n"
+"/////////////////////////////////////////////////////////////////////////////\n"
"// OpenCL preprocessor directives & macros\n"
"/////////////////////////////////////////////////////////////////////////////\n"
"#define __OPENCL_VERSION__ 110\n"