xref: /aosp_15_r20/external/ComputeLibrary/include/CL/cl_platform.h (revision c217d954acce2dbc11938adb493fc0abd69584f3)
1*c217d954SCole Faust /*******************************************************************************
2*c217d954SCole Faust  * Copyright (c) 2008-2020 The Khronos Group Inc.
3*c217d954SCole Faust  *
4*c217d954SCole Faust  * Licensed under the Apache License, Version 2.0 (the "License");
5*c217d954SCole Faust  * you may not use this file except in compliance with the License.
6*c217d954SCole Faust  * You may obtain a copy of the License at
7*c217d954SCole Faust  *
8*c217d954SCole Faust  *    http://www.apache.org/licenses/LICENSE-2.0
9*c217d954SCole Faust  *
10*c217d954SCole Faust  * Unless required by applicable law or agreed to in writing, software
11*c217d954SCole Faust  * distributed under the License is distributed on an "AS IS" BASIS,
12*c217d954SCole Faust  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*c217d954SCole Faust  * See the License for the specific language governing permissions and
14*c217d954SCole Faust  * limitations under the License.
15*c217d954SCole Faust  ******************************************************************************/
16*c217d954SCole Faust 
17*c217d954SCole Faust #ifndef __CL_PLATFORM_H
18*c217d954SCole Faust #define __CL_PLATFORM_H
19*c217d954SCole Faust 
20*c217d954SCole Faust #include <CL/cl_version.h>
21*c217d954SCole Faust 
22*c217d954SCole Faust #ifdef __cplusplus
23*c217d954SCole Faust extern "C" {
24*c217d954SCole Faust #endif
25*c217d954SCole Faust 
26*c217d954SCole Faust #if defined(_WIN32)
27*c217d954SCole Faust     #if !defined(CL_API_ENTRY)
28*c217d954SCole Faust         #define CL_API_ENTRY
29*c217d954SCole Faust     #endif
30*c217d954SCole Faust     #if !defined(CL_API_CALL)
31*c217d954SCole Faust         #define CL_API_CALL     __stdcall
32*c217d954SCole Faust     #endif
33*c217d954SCole Faust     #if !defined(CL_CALLBACK)
34*c217d954SCole Faust         #define CL_CALLBACK     __stdcall
35*c217d954SCole Faust     #endif
36*c217d954SCole Faust #else
37*c217d954SCole Faust     #if !defined(CL_API_ENTRY)
38*c217d954SCole Faust         #define CL_API_ENTRY
39*c217d954SCole Faust     #endif
40*c217d954SCole Faust     #if !defined(CL_API_CALL)
41*c217d954SCole Faust         #define CL_API_CALL
42*c217d954SCole Faust     #endif
43*c217d954SCole Faust     #if !defined(CL_CALLBACK)
44*c217d954SCole Faust         #define CL_CALLBACK
45*c217d954SCole Faust     #endif
46*c217d954SCole Faust #endif
47*c217d954SCole Faust 
48*c217d954SCole Faust /*
49*c217d954SCole Faust  * Deprecation flags refer to the last version of the header in which the
50*c217d954SCole Faust  * feature was not deprecated.
51*c217d954SCole Faust  *
52*c217d954SCole Faust  * E.g. VERSION_1_1_DEPRECATED means the feature is present in 1.1 without
53*c217d954SCole Faust  * deprecation but is deprecated in versions later than 1.1.
54*c217d954SCole Faust  */
55*c217d954SCole Faust 
56*c217d954SCole Faust #ifndef CL_API_SUFFIX_USER
57*c217d954SCole Faust #define CL_API_SUFFIX_USER
58*c217d954SCole Faust #endif
59*c217d954SCole Faust 
60*c217d954SCole Faust #ifndef CL_API_PREFIX_USER
61*c217d954SCole Faust #define CL_API_PREFIX_USER
62*c217d954SCole Faust #endif
63*c217d954SCole Faust 
64*c217d954SCole Faust #define CL_API_SUFFIX_COMMON CL_API_SUFFIX_USER
65*c217d954SCole Faust #define CL_API_PREFIX_COMMON CL_API_PREFIX_USER
66*c217d954SCole Faust 
67*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_1_0 CL_API_SUFFIX_COMMON
68*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_1_1 CL_API_SUFFIX_COMMON
69*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_1_2 CL_API_SUFFIX_COMMON
70*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_2_0 CL_API_SUFFIX_COMMON
71*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_2_1 CL_API_SUFFIX_COMMON
72*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_2_2 CL_API_SUFFIX_COMMON
73*c217d954SCole Faust #define CL_API_SUFFIX__VERSION_3_0 CL_API_SUFFIX_COMMON
74*c217d954SCole Faust #define CL_API_SUFFIX__EXPERIMENTAL CL_API_SUFFIX_COMMON
75*c217d954SCole Faust 
76*c217d954SCole Faust 
77*c217d954SCole Faust #ifdef __GNUC__
78*c217d954SCole Faust   #define CL_API_SUFFIX_DEPRECATED __attribute__((deprecated))
79*c217d954SCole Faust   #define CL_API_PREFIX_DEPRECATED
80*c217d954SCole Faust #elif defined(_WIN32)
81*c217d954SCole Faust   #define CL_API_SUFFIX_DEPRECATED
82*c217d954SCole Faust   #define CL_API_PREFIX_DEPRECATED __declspec(deprecated)
83*c217d954SCole Faust #else
84*c217d954SCole Faust   #define CL_API_SUFFIX_DEPRECATED
85*c217d954SCole Faust   #define CL_API_PREFIX_DEPRECATED
86*c217d954SCole Faust #endif
87*c217d954SCole Faust 
88*c217d954SCole Faust #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
89*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_1_0_DEPRECATED CL_API_SUFFIX_COMMON
90*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_1_0_DEPRECATED CL_API_PREFIX_COMMON
91*c217d954SCole Faust #else
92*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_1_0_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED
93*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_1_0_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED
94*c217d954SCole Faust #endif
95*c217d954SCole Faust 
96*c217d954SCole Faust #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
97*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_1_1_DEPRECATED CL_API_SUFFIX_COMMON
98*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_1_1_DEPRECATED CL_API_PREFIX_COMMON
99*c217d954SCole Faust #else
100*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_1_1_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED
101*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_1_1_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED
102*c217d954SCole Faust #endif
103*c217d954SCole Faust 
104*c217d954SCole Faust #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS
105*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_1_2_DEPRECATED CL_API_SUFFIX_COMMON
106*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_1_2_DEPRECATED CL_API_PREFIX_COMMON
107*c217d954SCole Faust #else
108*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_1_2_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED
109*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_1_2_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED
110*c217d954SCole Faust  #endif
111*c217d954SCole Faust 
112*c217d954SCole Faust #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS
113*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_2_0_DEPRECATED CL_API_SUFFIX_COMMON
114*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_2_0_DEPRECATED CL_API_PREFIX_COMMON
115*c217d954SCole Faust #else
116*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_2_0_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED
117*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_2_0_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED
118*c217d954SCole Faust #endif
119*c217d954SCole Faust 
120*c217d954SCole Faust #ifdef CL_USE_DEPRECATED_OPENCL_2_1_APIS
121*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_2_1_DEPRECATED CL_API_SUFFIX_COMMON
122*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_2_1_DEPRECATED CL_API_PREFIX_COMMON
123*c217d954SCole Faust #else
124*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_2_1_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED
125*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_2_1_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED
126*c217d954SCole Faust #endif
127*c217d954SCole Faust 
128*c217d954SCole Faust #ifdef CL_USE_DEPRECATED_OPENCL_2_2_APIS
129*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_2_2_DEPRECATED CL_API_SUFFIX_COMMON
130*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_2_2_DEPRECATED CL_API_PREFIX_COMMON
131*c217d954SCole Faust #else
132*c217d954SCole Faust     #define CL_API_SUFFIX__VERSION_2_2_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED
133*c217d954SCole Faust     #define CL_API_PREFIX__VERSION_2_2_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED
134*c217d954SCole Faust #endif
135*c217d954SCole Faust 
136*c217d954SCole Faust #if (defined (_WIN32) && defined(_MSC_VER))
137*c217d954SCole Faust 
138*c217d954SCole Faust /* intptr_t is used in cl.h and provided by stddef.h in Visual C++, but not in clang */
139*c217d954SCole Faust /* stdint.h was missing before Visual Studio 2010, include it for later versions and for clang */
140*c217d954SCole Faust #if defined(__clang__) || _MSC_VER >= 1600
141*c217d954SCole Faust     #include <stdint.h>
142*c217d954SCole Faust #endif
143*c217d954SCole Faust 
144*c217d954SCole Faust /* scalar types  */
145*c217d954SCole Faust typedef signed   __int8         cl_char;
146*c217d954SCole Faust typedef unsigned __int8         cl_uchar;
147*c217d954SCole Faust typedef signed   __int16        cl_short;
148*c217d954SCole Faust typedef unsigned __int16        cl_ushort;
149*c217d954SCole Faust typedef signed   __int32        cl_int;
150*c217d954SCole Faust typedef unsigned __int32        cl_uint;
151*c217d954SCole Faust typedef signed   __int64        cl_long;
152*c217d954SCole Faust typedef unsigned __int64        cl_ulong;
153*c217d954SCole Faust 
154*c217d954SCole Faust typedef unsigned __int16        cl_half;
155*c217d954SCole Faust typedef float                   cl_float;
156*c217d954SCole Faust typedef double                  cl_double;
157*c217d954SCole Faust 
158*c217d954SCole Faust /* Macro names and corresponding values defined by OpenCL */
159*c217d954SCole Faust #define CL_CHAR_BIT         8
160*c217d954SCole Faust #define CL_SCHAR_MAX        127
161*c217d954SCole Faust #define CL_SCHAR_MIN        (-127-1)
162*c217d954SCole Faust #define CL_CHAR_MAX         CL_SCHAR_MAX
163*c217d954SCole Faust #define CL_CHAR_MIN         CL_SCHAR_MIN
164*c217d954SCole Faust #define CL_UCHAR_MAX        255
165*c217d954SCole Faust #define CL_SHRT_MAX         32767
166*c217d954SCole Faust #define CL_SHRT_MIN         (-32767-1)
167*c217d954SCole Faust #define CL_USHRT_MAX        65535
168*c217d954SCole Faust #define CL_INT_MAX          2147483647
169*c217d954SCole Faust #define CL_INT_MIN          (-2147483647-1)
170*c217d954SCole Faust #define CL_UINT_MAX         0xffffffffU
171*c217d954SCole Faust #define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
172*c217d954SCole Faust #define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
173*c217d954SCole Faust #define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
174*c217d954SCole Faust 
175*c217d954SCole Faust #define CL_FLT_DIG          6
176*c217d954SCole Faust #define CL_FLT_MANT_DIG     24
177*c217d954SCole Faust #define CL_FLT_MAX_10_EXP   +38
178*c217d954SCole Faust #define CL_FLT_MAX_EXP      +128
179*c217d954SCole Faust #define CL_FLT_MIN_10_EXP   -37
180*c217d954SCole Faust #define CL_FLT_MIN_EXP      -125
181*c217d954SCole Faust #define CL_FLT_RADIX        2
182*c217d954SCole Faust #define CL_FLT_MAX          340282346638528859811704183484516925440.0f
183*c217d954SCole Faust #define CL_FLT_MIN          1.175494350822287507969e-38f
184*c217d954SCole Faust #define CL_FLT_EPSILON      1.1920928955078125e-7f
185*c217d954SCole Faust 
186*c217d954SCole Faust #define CL_HALF_DIG          3
187*c217d954SCole Faust #define CL_HALF_MANT_DIG     11
188*c217d954SCole Faust #define CL_HALF_MAX_10_EXP   +4
189*c217d954SCole Faust #define CL_HALF_MAX_EXP      +16
190*c217d954SCole Faust #define CL_HALF_MIN_10_EXP   -4
191*c217d954SCole Faust #define CL_HALF_MIN_EXP      -13
192*c217d954SCole Faust #define CL_HALF_RADIX        2
193*c217d954SCole Faust #define CL_HALF_MAX          65504.0f
194*c217d954SCole Faust #define CL_HALF_MIN          6.103515625e-05f
195*c217d954SCole Faust #define CL_HALF_EPSILON      9.765625e-04f
196*c217d954SCole Faust 
197*c217d954SCole Faust #define CL_DBL_DIG          15
198*c217d954SCole Faust #define CL_DBL_MANT_DIG     53
199*c217d954SCole Faust #define CL_DBL_MAX_10_EXP   +308
200*c217d954SCole Faust #define CL_DBL_MAX_EXP      +1024
201*c217d954SCole Faust #define CL_DBL_MIN_10_EXP   -307
202*c217d954SCole Faust #define CL_DBL_MIN_EXP      -1021
203*c217d954SCole Faust #define CL_DBL_RADIX        2
204*c217d954SCole Faust #define CL_DBL_MAX          1.7976931348623158e+308
205*c217d954SCole Faust #define CL_DBL_MIN          2.225073858507201383090e-308
206*c217d954SCole Faust #define CL_DBL_EPSILON      2.220446049250313080847e-16
207*c217d954SCole Faust 
208*c217d954SCole Faust #define CL_M_E              2.7182818284590452354
209*c217d954SCole Faust #define CL_M_LOG2E          1.4426950408889634074
210*c217d954SCole Faust #define CL_M_LOG10E         0.43429448190325182765
211*c217d954SCole Faust #define CL_M_LN2            0.69314718055994530942
212*c217d954SCole Faust #define CL_M_LN10           2.30258509299404568402
213*c217d954SCole Faust #define CL_M_PI             3.14159265358979323846
214*c217d954SCole Faust #define CL_M_PI_2           1.57079632679489661923
215*c217d954SCole Faust #define CL_M_PI_4           0.78539816339744830962
216*c217d954SCole Faust #define CL_M_1_PI           0.31830988618379067154
217*c217d954SCole Faust #define CL_M_2_PI           0.63661977236758134308
218*c217d954SCole Faust #define CL_M_2_SQRTPI       1.12837916709551257390
219*c217d954SCole Faust #define CL_M_SQRT2          1.41421356237309504880
220*c217d954SCole Faust #define CL_M_SQRT1_2        0.70710678118654752440
221*c217d954SCole Faust 
222*c217d954SCole Faust #define CL_M_E_F            2.718281828f
223*c217d954SCole Faust #define CL_M_LOG2E_F        1.442695041f
224*c217d954SCole Faust #define CL_M_LOG10E_F       0.434294482f
225*c217d954SCole Faust #define CL_M_LN2_F          0.693147181f
226*c217d954SCole Faust #define CL_M_LN10_F         2.302585093f
227*c217d954SCole Faust #define CL_M_PI_F           3.141592654f
228*c217d954SCole Faust #define CL_M_PI_2_F         1.570796327f
229*c217d954SCole Faust #define CL_M_PI_4_F         0.785398163f
230*c217d954SCole Faust #define CL_M_1_PI_F         0.318309886f
231*c217d954SCole Faust #define CL_M_2_PI_F         0.636619772f
232*c217d954SCole Faust #define CL_M_2_SQRTPI_F     1.128379167f
233*c217d954SCole Faust #define CL_M_SQRT2_F        1.414213562f
234*c217d954SCole Faust #define CL_M_SQRT1_2_F      0.707106781f
235*c217d954SCole Faust 
236*c217d954SCole Faust #define CL_NAN              (CL_INFINITY - CL_INFINITY)
237*c217d954SCole Faust #define CL_HUGE_VALF        ((cl_float) 1e50)
238*c217d954SCole Faust #define CL_HUGE_VAL         ((cl_double) 1e500)
239*c217d954SCole Faust #define CL_MAXFLOAT         CL_FLT_MAX
240*c217d954SCole Faust #define CL_INFINITY         CL_HUGE_VALF
241*c217d954SCole Faust 
242*c217d954SCole Faust #else
243*c217d954SCole Faust 
244*c217d954SCole Faust #include <stdint.h>
245*c217d954SCole Faust 
246*c217d954SCole Faust /* scalar types  */
247*c217d954SCole Faust typedef int8_t          cl_char;
248*c217d954SCole Faust typedef uint8_t         cl_uchar;
249*c217d954SCole Faust typedef int16_t         cl_short;
250*c217d954SCole Faust typedef uint16_t        cl_ushort;
251*c217d954SCole Faust typedef int32_t         cl_int;
252*c217d954SCole Faust typedef uint32_t        cl_uint;
253*c217d954SCole Faust typedef int64_t         cl_long;
254*c217d954SCole Faust typedef uint64_t        cl_ulong;
255*c217d954SCole Faust 
256*c217d954SCole Faust typedef uint16_t        cl_half;
257*c217d954SCole Faust typedef float           cl_float;
258*c217d954SCole Faust typedef double          cl_double;
259*c217d954SCole Faust 
260*c217d954SCole Faust /* Macro names and corresponding values defined by OpenCL */
261*c217d954SCole Faust #define CL_CHAR_BIT         8
262*c217d954SCole Faust #define CL_SCHAR_MAX        127
263*c217d954SCole Faust #define CL_SCHAR_MIN        (-127-1)
264*c217d954SCole Faust #define CL_CHAR_MAX         CL_SCHAR_MAX
265*c217d954SCole Faust #define CL_CHAR_MIN         CL_SCHAR_MIN
266*c217d954SCole Faust #define CL_UCHAR_MAX        255
267*c217d954SCole Faust #define CL_SHRT_MAX         32767
268*c217d954SCole Faust #define CL_SHRT_MIN         (-32767-1)
269*c217d954SCole Faust #define CL_USHRT_MAX        65535
270*c217d954SCole Faust #define CL_INT_MAX          2147483647
271*c217d954SCole Faust #define CL_INT_MIN          (-2147483647-1)
272*c217d954SCole Faust #define CL_UINT_MAX         0xffffffffU
273*c217d954SCole Faust #define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
274*c217d954SCole Faust #define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
275*c217d954SCole Faust #define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
276*c217d954SCole Faust 
277*c217d954SCole Faust #define CL_FLT_DIG          6
278*c217d954SCole Faust #define CL_FLT_MANT_DIG     24
279*c217d954SCole Faust #define CL_FLT_MAX_10_EXP   +38
280*c217d954SCole Faust #define CL_FLT_MAX_EXP      +128
281*c217d954SCole Faust #define CL_FLT_MIN_10_EXP   -37
282*c217d954SCole Faust #define CL_FLT_MIN_EXP      -125
283*c217d954SCole Faust #define CL_FLT_RADIX        2
284*c217d954SCole Faust #define CL_FLT_MAX          340282346638528859811704183484516925440.0f
285*c217d954SCole Faust #define CL_FLT_MIN          1.175494350822287507969e-38f
286*c217d954SCole Faust #define CL_FLT_EPSILON      1.1920928955078125e-7f
287*c217d954SCole Faust 
288*c217d954SCole Faust #define CL_HALF_DIG          3
289*c217d954SCole Faust #define CL_HALF_MANT_DIG     11
290*c217d954SCole Faust #define CL_HALF_MAX_10_EXP   +4
291*c217d954SCole Faust #define CL_HALF_MAX_EXP      +16
292*c217d954SCole Faust #define CL_HALF_MIN_10_EXP   -4
293*c217d954SCole Faust #define CL_HALF_MIN_EXP      -13
294*c217d954SCole Faust #define CL_HALF_RADIX        2
295*c217d954SCole Faust #define CL_HALF_MAX          65504.0f
296*c217d954SCole Faust #define CL_HALF_MIN          6.103515625e-05f
297*c217d954SCole Faust #define CL_HALF_EPSILON      9.765625e-04f
298*c217d954SCole Faust 
299*c217d954SCole Faust #define CL_DBL_DIG          15
300*c217d954SCole Faust #define CL_DBL_MANT_DIG     53
301*c217d954SCole Faust #define CL_DBL_MAX_10_EXP   +308
302*c217d954SCole Faust #define CL_DBL_MAX_EXP      +1024
303*c217d954SCole Faust #define CL_DBL_MIN_10_EXP   -307
304*c217d954SCole Faust #define CL_DBL_MIN_EXP      -1021
305*c217d954SCole Faust #define CL_DBL_RADIX        2
306*c217d954SCole Faust #define CL_DBL_MAX          179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
307*c217d954SCole Faust #define CL_DBL_MIN          2.225073858507201383090e-308
308*c217d954SCole Faust #define CL_DBL_EPSILON      2.220446049250313080847e-16
309*c217d954SCole Faust 
310*c217d954SCole Faust #define CL_M_E              2.7182818284590452354
311*c217d954SCole Faust #define CL_M_LOG2E          1.4426950408889634074
312*c217d954SCole Faust #define CL_M_LOG10E         0.43429448190325182765
313*c217d954SCole Faust #define CL_M_LN2            0.69314718055994530942
314*c217d954SCole Faust #define CL_M_LN10           2.30258509299404568402
315*c217d954SCole Faust #define CL_M_PI             3.14159265358979323846
316*c217d954SCole Faust #define CL_M_PI_2           1.57079632679489661923
317*c217d954SCole Faust #define CL_M_PI_4           0.78539816339744830962
318*c217d954SCole Faust #define CL_M_1_PI           0.31830988618379067154
319*c217d954SCole Faust #define CL_M_2_PI           0.63661977236758134308
320*c217d954SCole Faust #define CL_M_2_SQRTPI       1.12837916709551257390
321*c217d954SCole Faust #define CL_M_SQRT2          1.41421356237309504880
322*c217d954SCole Faust #define CL_M_SQRT1_2        0.70710678118654752440
323*c217d954SCole Faust 
324*c217d954SCole Faust #define CL_M_E_F            2.718281828f
325*c217d954SCole Faust #define CL_M_LOG2E_F        1.442695041f
326*c217d954SCole Faust #define CL_M_LOG10E_F       0.434294482f
327*c217d954SCole Faust #define CL_M_LN2_F          0.693147181f
328*c217d954SCole Faust #define CL_M_LN10_F         2.302585093f
329*c217d954SCole Faust #define CL_M_PI_F           3.141592654f
330*c217d954SCole Faust #define CL_M_PI_2_F         1.570796327f
331*c217d954SCole Faust #define CL_M_PI_4_F         0.785398163f
332*c217d954SCole Faust #define CL_M_1_PI_F         0.318309886f
333*c217d954SCole Faust #define CL_M_2_PI_F         0.636619772f
334*c217d954SCole Faust #define CL_M_2_SQRTPI_F     1.128379167f
335*c217d954SCole Faust #define CL_M_SQRT2_F        1.414213562f
336*c217d954SCole Faust #define CL_M_SQRT1_2_F      0.707106781f
337*c217d954SCole Faust 
338*c217d954SCole Faust #if defined( __GNUC__ )
339*c217d954SCole Faust    #define CL_HUGE_VALF     __builtin_huge_valf()
340*c217d954SCole Faust    #define CL_HUGE_VAL      __builtin_huge_val()
341*c217d954SCole Faust    #define CL_NAN           __builtin_nanf( "" )
342*c217d954SCole Faust #else
343*c217d954SCole Faust    #define CL_HUGE_VALF     ((cl_float) 1e50)
344*c217d954SCole Faust    #define CL_HUGE_VAL      ((cl_double) 1e500)
345*c217d954SCole Faust    float nanf( const char * );
346*c217d954SCole Faust    #define CL_NAN           nanf( "" )
347*c217d954SCole Faust #endif
348*c217d954SCole Faust #define CL_MAXFLOAT         CL_FLT_MAX
349*c217d954SCole Faust #define CL_INFINITY         CL_HUGE_VALF
350*c217d954SCole Faust 
351*c217d954SCole Faust #endif
352*c217d954SCole Faust 
353*c217d954SCole Faust #include <stddef.h>
354*c217d954SCole Faust 
355*c217d954SCole Faust /* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */
356*c217d954SCole Faust typedef unsigned int cl_GLuint;
357*c217d954SCole Faust typedef int          cl_GLint;
358*c217d954SCole Faust typedef unsigned int cl_GLenum;
359*c217d954SCole Faust 
360*c217d954SCole Faust /*
361*c217d954SCole Faust  * Vector types
362*c217d954SCole Faust  *
363*c217d954SCole Faust  *  Note:   OpenCL requires that all types be naturally aligned.
364*c217d954SCole Faust  *          This means that vector types must be naturally aligned.
365*c217d954SCole Faust  *          For example, a vector of four floats must be aligned to
366*c217d954SCole Faust  *          a 16 byte boundary (calculated as 4 * the natural 4-byte
367*c217d954SCole Faust  *          alignment of the float).  The alignment qualifiers here
368*c217d954SCole Faust  *          will only function properly if your compiler supports them
369*c217d954SCole Faust  *          and if you don't actively work to defeat them.  For example,
370*c217d954SCole Faust  *          in order for a cl_float4 to be 16 byte aligned in a struct,
371*c217d954SCole Faust  *          the start of the struct must itself be 16-byte aligned.
372*c217d954SCole Faust  *
373*c217d954SCole Faust  *          Maintaining proper alignment is the user's responsibility.
374*c217d954SCole Faust  */
375*c217d954SCole Faust 
376*c217d954SCole Faust /* Define basic vector types */
377*c217d954SCole Faust #if defined( __VEC__ )
378*c217d954SCole Faust   #if !defined(__clang__)
379*c217d954SCole Faust      #include <altivec.h>   /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
380*c217d954SCole Faust   #endif
381*c217d954SCole Faust    typedef __vector unsigned char     __cl_uchar16;
382*c217d954SCole Faust    typedef __vector signed char       __cl_char16;
383*c217d954SCole Faust    typedef __vector unsigned short    __cl_ushort8;
384*c217d954SCole Faust    typedef __vector signed short      __cl_short8;
385*c217d954SCole Faust    typedef __vector unsigned int      __cl_uint4;
386*c217d954SCole Faust    typedef __vector signed int        __cl_int4;
387*c217d954SCole Faust    typedef __vector float             __cl_float4;
388*c217d954SCole Faust    #define  __CL_UCHAR16__  1
389*c217d954SCole Faust    #define  __CL_CHAR16__   1
390*c217d954SCole Faust    #define  __CL_USHORT8__  1
391*c217d954SCole Faust    #define  __CL_SHORT8__   1
392*c217d954SCole Faust    #define  __CL_UINT4__    1
393*c217d954SCole Faust    #define  __CL_INT4__     1
394*c217d954SCole Faust    #define  __CL_FLOAT4__   1
395*c217d954SCole Faust #endif
396*c217d954SCole Faust 
397*c217d954SCole Faust #if defined( __SSE__ )
398*c217d954SCole Faust     #if defined( __MINGW64__ )
399*c217d954SCole Faust         #include <intrin.h>
400*c217d954SCole Faust     #else
401*c217d954SCole Faust         #include <xmmintrin.h>
402*c217d954SCole Faust     #endif
403*c217d954SCole Faust     #if defined( __GNUC__ )
404*c217d954SCole Faust         typedef float __cl_float4   __attribute__((vector_size(16)));
405*c217d954SCole Faust     #else
406*c217d954SCole Faust         typedef __m128 __cl_float4;
407*c217d954SCole Faust     #endif
408*c217d954SCole Faust     #define __CL_FLOAT4__   1
409*c217d954SCole Faust #endif
410*c217d954SCole Faust 
411*c217d954SCole Faust #if defined( __SSE2__ )
412*c217d954SCole Faust     #if defined( __MINGW64__ )
413*c217d954SCole Faust         #include <intrin.h>
414*c217d954SCole Faust     #else
415*c217d954SCole Faust         #include <emmintrin.h>
416*c217d954SCole Faust     #endif
417*c217d954SCole Faust     #if defined( __GNUC__ )
418*c217d954SCole Faust         typedef cl_uchar    __cl_uchar16    __attribute__((vector_size(16)));
419*c217d954SCole Faust         typedef cl_char     __cl_char16     __attribute__((vector_size(16)));
420*c217d954SCole Faust         typedef cl_ushort   __cl_ushort8    __attribute__((vector_size(16)));
421*c217d954SCole Faust         typedef cl_short    __cl_short8     __attribute__((vector_size(16)));
422*c217d954SCole Faust         typedef cl_uint     __cl_uint4      __attribute__((vector_size(16)));
423*c217d954SCole Faust         typedef cl_int      __cl_int4       __attribute__((vector_size(16)));
424*c217d954SCole Faust         typedef cl_ulong    __cl_ulong2     __attribute__((vector_size(16)));
425*c217d954SCole Faust         typedef cl_long     __cl_long2      __attribute__((vector_size(16)));
426*c217d954SCole Faust         typedef cl_double   __cl_double2    __attribute__((vector_size(16)));
427*c217d954SCole Faust     #else
428*c217d954SCole Faust         typedef __m128i __cl_uchar16;
429*c217d954SCole Faust         typedef __m128i __cl_char16;
430*c217d954SCole Faust         typedef __m128i __cl_ushort8;
431*c217d954SCole Faust         typedef __m128i __cl_short8;
432*c217d954SCole Faust         typedef __m128i __cl_uint4;
433*c217d954SCole Faust         typedef __m128i __cl_int4;
434*c217d954SCole Faust         typedef __m128i __cl_ulong2;
435*c217d954SCole Faust         typedef __m128i __cl_long2;
436*c217d954SCole Faust         typedef __m128d __cl_double2;
437*c217d954SCole Faust     #endif
438*c217d954SCole Faust     #define __CL_UCHAR16__  1
439*c217d954SCole Faust     #define __CL_CHAR16__   1
440*c217d954SCole Faust     #define __CL_USHORT8__  1
441*c217d954SCole Faust     #define __CL_SHORT8__   1
442*c217d954SCole Faust     #define __CL_INT4__     1
443*c217d954SCole Faust     #define __CL_UINT4__    1
444*c217d954SCole Faust     #define __CL_ULONG2__   1
445*c217d954SCole Faust     #define __CL_LONG2__    1
446*c217d954SCole Faust     #define __CL_DOUBLE2__  1
447*c217d954SCole Faust #endif
448*c217d954SCole Faust 
449*c217d954SCole Faust #if defined( __MMX__ )
450*c217d954SCole Faust     #include <mmintrin.h>
451*c217d954SCole Faust     #if defined( __GNUC__ )
452*c217d954SCole Faust         typedef cl_uchar    __cl_uchar8     __attribute__((vector_size(8)));
453*c217d954SCole Faust         typedef cl_char     __cl_char8      __attribute__((vector_size(8)));
454*c217d954SCole Faust         typedef cl_ushort   __cl_ushort4    __attribute__((vector_size(8)));
455*c217d954SCole Faust         typedef cl_short    __cl_short4     __attribute__((vector_size(8)));
456*c217d954SCole Faust         typedef cl_uint     __cl_uint2      __attribute__((vector_size(8)));
457*c217d954SCole Faust         typedef cl_int      __cl_int2       __attribute__((vector_size(8)));
458*c217d954SCole Faust         typedef cl_ulong    __cl_ulong1     __attribute__((vector_size(8)));
459*c217d954SCole Faust         typedef cl_long     __cl_long1      __attribute__((vector_size(8)));
460*c217d954SCole Faust         typedef cl_float    __cl_float2     __attribute__((vector_size(8)));
461*c217d954SCole Faust     #else
462*c217d954SCole Faust         typedef __m64       __cl_uchar8;
463*c217d954SCole Faust         typedef __m64       __cl_char8;
464*c217d954SCole Faust         typedef __m64       __cl_ushort4;
465*c217d954SCole Faust         typedef __m64       __cl_short4;
466*c217d954SCole Faust         typedef __m64       __cl_uint2;
467*c217d954SCole Faust         typedef __m64       __cl_int2;
468*c217d954SCole Faust         typedef __m64       __cl_ulong1;
469*c217d954SCole Faust         typedef __m64       __cl_long1;
470*c217d954SCole Faust         typedef __m64       __cl_float2;
471*c217d954SCole Faust     #endif
472*c217d954SCole Faust     #define __CL_UCHAR8__   1
473*c217d954SCole Faust     #define __CL_CHAR8__    1
474*c217d954SCole Faust     #define __CL_USHORT4__  1
475*c217d954SCole Faust     #define __CL_SHORT4__   1
476*c217d954SCole Faust     #define __CL_INT2__     1
477*c217d954SCole Faust     #define __CL_UINT2__    1
478*c217d954SCole Faust     #define __CL_ULONG1__   1
479*c217d954SCole Faust     #define __CL_LONG1__    1
480*c217d954SCole Faust     #define __CL_FLOAT2__   1
481*c217d954SCole Faust #endif
482*c217d954SCole Faust 
483*c217d954SCole Faust #if defined( __AVX__ )
484*c217d954SCole Faust     #if defined( __MINGW64__ )
485*c217d954SCole Faust         #include <intrin.h>
486*c217d954SCole Faust     #else
487*c217d954SCole Faust         #include <immintrin.h>
488*c217d954SCole Faust     #endif
489*c217d954SCole Faust     #if defined( __GNUC__ )
490*c217d954SCole Faust         typedef cl_float    __cl_float8     __attribute__((vector_size(32)));
491*c217d954SCole Faust         typedef cl_double   __cl_double4    __attribute__((vector_size(32)));
492*c217d954SCole Faust     #else
493*c217d954SCole Faust         typedef __m256      __cl_float8;
494*c217d954SCole Faust         typedef __m256d     __cl_double4;
495*c217d954SCole Faust     #endif
496*c217d954SCole Faust     #define __CL_FLOAT8__   1
497*c217d954SCole Faust     #define __CL_DOUBLE4__  1
498*c217d954SCole Faust #endif
499*c217d954SCole Faust 
500*c217d954SCole Faust /* Define capabilities for anonymous struct members. */
501*c217d954SCole Faust #if !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
502*c217d954SCole Faust #define  __CL_HAS_ANON_STRUCT__ 1
503*c217d954SCole Faust #define  __CL_ANON_STRUCT__
504*c217d954SCole Faust #elif defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
505*c217d954SCole Faust #define  __CL_HAS_ANON_STRUCT__ 1
506*c217d954SCole Faust #define  __CL_ANON_STRUCT__ __extension__
507*c217d954SCole Faust #elif defined( _WIN32) && defined(_MSC_VER) && ! defined(__STDC__)
508*c217d954SCole Faust     #if _MSC_VER >= 1500
509*c217d954SCole Faust    /* Microsoft Developer Studio 2008 supports anonymous structs, but
510*c217d954SCole Faust     * complains by default. */
511*c217d954SCole Faust     #define  __CL_HAS_ANON_STRUCT__ 1
512*c217d954SCole Faust     #define  __CL_ANON_STRUCT__
513*c217d954SCole Faust    /* Disable warning C4201: nonstandard extension used : nameless
514*c217d954SCole Faust     * struct/union */
515*c217d954SCole Faust     #pragma warning( push )
516*c217d954SCole Faust     #pragma warning( disable : 4201 )
517*c217d954SCole Faust     #endif
518*c217d954SCole Faust #else
519*c217d954SCole Faust #define  __CL_HAS_ANON_STRUCT__ 0
520*c217d954SCole Faust #define  __CL_ANON_STRUCT__
521*c217d954SCole Faust #endif
522*c217d954SCole Faust 
523*c217d954SCole Faust /* Define alignment keys */
524*c217d954SCole Faust #if defined( __GNUC__ ) || defined(__INTEGRITY)
525*c217d954SCole Faust     #define CL_ALIGNED(_x)          __attribute__ ((aligned(_x)))
526*c217d954SCole Faust #elif defined( _WIN32) && (_MSC_VER)
527*c217d954SCole Faust     /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements     */
528*c217d954SCole Faust     /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx                                                 */
529*c217d954SCole Faust     /* #include <crtdefs.h>                                                                                             */
530*c217d954SCole Faust     /* #define CL_ALIGNED(_x)          _CRT_ALIGN(_x)                                                                   */
531*c217d954SCole Faust     #define CL_ALIGNED(_x)
532*c217d954SCole Faust #else
533*c217d954SCole Faust    #warning  Need to implement some method to align data here
534*c217d954SCole Faust    #define  CL_ALIGNED(_x)
535*c217d954SCole Faust #endif
536*c217d954SCole Faust 
537*c217d954SCole Faust /* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
538*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
539*c217d954SCole Faust     /* .xyzw and .s0123...{f|F} are supported */
540*c217d954SCole Faust     #define CL_HAS_NAMED_VECTOR_FIELDS 1
541*c217d954SCole Faust     /* .hi and .lo are supported */
542*c217d954SCole Faust     #define CL_HAS_HI_LO_VECTOR_FIELDS 1
543*c217d954SCole Faust #endif
544*c217d954SCole Faust 
545*c217d954SCole Faust /* Define cl_vector types */
546*c217d954SCole Faust 
547*c217d954SCole Faust /* ---- cl_charn ---- */
548*c217d954SCole Faust typedef union
549*c217d954SCole Faust {
550*c217d954SCole Faust     cl_char  CL_ALIGNED(2) s[2];
551*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
552*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  x, y; };
553*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  s0, s1; };
554*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  lo, hi; };
555*c217d954SCole Faust #endif
556*c217d954SCole Faust #if defined( __CL_CHAR2__)
557*c217d954SCole Faust     __cl_char2     v2;
558*c217d954SCole Faust #endif
559*c217d954SCole Faust }cl_char2;
560*c217d954SCole Faust 
561*c217d954SCole Faust typedef union
562*c217d954SCole Faust {
563*c217d954SCole Faust     cl_char  CL_ALIGNED(4) s[4];
564*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
565*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  x, y, z, w; };
566*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  s0, s1, s2, s3; };
567*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; };
568*c217d954SCole Faust #endif
569*c217d954SCole Faust #if defined( __CL_CHAR2__)
570*c217d954SCole Faust     __cl_char2     v2[2];
571*c217d954SCole Faust #endif
572*c217d954SCole Faust #if defined( __CL_CHAR4__)
573*c217d954SCole Faust     __cl_char4     v4;
574*c217d954SCole Faust #endif
575*c217d954SCole Faust }cl_char4;
576*c217d954SCole Faust 
577*c217d954SCole Faust /* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */
578*c217d954SCole Faust typedef  cl_char4  cl_char3;
579*c217d954SCole Faust 
580*c217d954SCole Faust typedef union
581*c217d954SCole Faust {
582*c217d954SCole Faust     cl_char   CL_ALIGNED(8) s[8];
583*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
584*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  x, y, z, w; };
585*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  s0, s1, s2, s3, s4, s5, s6, s7; };
586*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; };
587*c217d954SCole Faust #endif
588*c217d954SCole Faust #if defined( __CL_CHAR2__)
589*c217d954SCole Faust     __cl_char2     v2[4];
590*c217d954SCole Faust #endif
591*c217d954SCole Faust #if defined( __CL_CHAR4__)
592*c217d954SCole Faust     __cl_char4     v4[2];
593*c217d954SCole Faust #endif
594*c217d954SCole Faust #if defined( __CL_CHAR8__ )
595*c217d954SCole Faust     __cl_char8     v8;
596*c217d954SCole Faust #endif
597*c217d954SCole Faust }cl_char8;
598*c217d954SCole Faust 
599*c217d954SCole Faust typedef union
600*c217d954SCole Faust {
601*c217d954SCole Faust     cl_char  CL_ALIGNED(16) s[16];
602*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
603*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
604*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
605*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; };
606*c217d954SCole Faust #endif
607*c217d954SCole Faust #if defined( __CL_CHAR2__)
608*c217d954SCole Faust     __cl_char2     v2[8];
609*c217d954SCole Faust #endif
610*c217d954SCole Faust #if defined( __CL_CHAR4__)
611*c217d954SCole Faust     __cl_char4     v4[4];
612*c217d954SCole Faust #endif
613*c217d954SCole Faust #if defined( __CL_CHAR8__ )
614*c217d954SCole Faust     __cl_char8     v8[2];
615*c217d954SCole Faust #endif
616*c217d954SCole Faust #if defined( __CL_CHAR16__ )
617*c217d954SCole Faust     __cl_char16    v16;
618*c217d954SCole Faust #endif
619*c217d954SCole Faust }cl_char16;
620*c217d954SCole Faust 
621*c217d954SCole Faust 
622*c217d954SCole Faust /* ---- cl_ucharn ---- */
623*c217d954SCole Faust typedef union
624*c217d954SCole Faust {
625*c217d954SCole Faust     cl_uchar  CL_ALIGNED(2) s[2];
626*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
627*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  x, y; };
628*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  s0, s1; };
629*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  lo, hi; };
630*c217d954SCole Faust #endif
631*c217d954SCole Faust #if defined( __cl_uchar2__)
632*c217d954SCole Faust     __cl_uchar2     v2;
633*c217d954SCole Faust #endif
634*c217d954SCole Faust }cl_uchar2;
635*c217d954SCole Faust 
636*c217d954SCole Faust typedef union
637*c217d954SCole Faust {
638*c217d954SCole Faust     cl_uchar  CL_ALIGNED(4) s[4];
639*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
640*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  x, y, z, w; };
641*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  s0, s1, s2, s3; };
642*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; };
643*c217d954SCole Faust #endif
644*c217d954SCole Faust #if defined( __CL_UCHAR2__)
645*c217d954SCole Faust     __cl_uchar2     v2[2];
646*c217d954SCole Faust #endif
647*c217d954SCole Faust #if defined( __CL_UCHAR4__)
648*c217d954SCole Faust     __cl_uchar4     v4;
649*c217d954SCole Faust #endif
650*c217d954SCole Faust }cl_uchar4;
651*c217d954SCole Faust 
652*c217d954SCole Faust /* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */
653*c217d954SCole Faust typedef  cl_uchar4  cl_uchar3;
654*c217d954SCole Faust 
655*c217d954SCole Faust typedef union
656*c217d954SCole Faust {
657*c217d954SCole Faust     cl_uchar   CL_ALIGNED(8) s[8];
658*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
659*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  x, y, z, w; };
660*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  s0, s1, s2, s3, s4, s5, s6, s7; };
661*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; };
662*c217d954SCole Faust #endif
663*c217d954SCole Faust #if defined( __CL_UCHAR2__)
664*c217d954SCole Faust     __cl_uchar2     v2[4];
665*c217d954SCole Faust #endif
666*c217d954SCole Faust #if defined( __CL_UCHAR4__)
667*c217d954SCole Faust     __cl_uchar4     v4[2];
668*c217d954SCole Faust #endif
669*c217d954SCole Faust #if defined( __CL_UCHAR8__ )
670*c217d954SCole Faust     __cl_uchar8     v8;
671*c217d954SCole Faust #endif
672*c217d954SCole Faust }cl_uchar8;
673*c217d954SCole Faust 
674*c217d954SCole Faust typedef union
675*c217d954SCole Faust {
676*c217d954SCole Faust     cl_uchar  CL_ALIGNED(16) s[16];
677*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
678*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
679*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
680*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; };
681*c217d954SCole Faust #endif
682*c217d954SCole Faust #if defined( __CL_UCHAR2__)
683*c217d954SCole Faust     __cl_uchar2     v2[8];
684*c217d954SCole Faust #endif
685*c217d954SCole Faust #if defined( __CL_UCHAR4__)
686*c217d954SCole Faust     __cl_uchar4     v4[4];
687*c217d954SCole Faust #endif
688*c217d954SCole Faust #if defined( __CL_UCHAR8__ )
689*c217d954SCole Faust     __cl_uchar8     v8[2];
690*c217d954SCole Faust #endif
691*c217d954SCole Faust #if defined( __CL_UCHAR16__ )
692*c217d954SCole Faust     __cl_uchar16    v16;
693*c217d954SCole Faust #endif
694*c217d954SCole Faust }cl_uchar16;
695*c217d954SCole Faust 
696*c217d954SCole Faust 
697*c217d954SCole Faust /* ---- cl_shortn ---- */
698*c217d954SCole Faust typedef union
699*c217d954SCole Faust {
700*c217d954SCole Faust     cl_short  CL_ALIGNED(4) s[2];
701*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
702*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  x, y; };
703*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  s0, s1; };
704*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  lo, hi; };
705*c217d954SCole Faust #endif
706*c217d954SCole Faust #if defined( __CL_SHORT2__)
707*c217d954SCole Faust     __cl_short2     v2;
708*c217d954SCole Faust #endif
709*c217d954SCole Faust }cl_short2;
710*c217d954SCole Faust 
711*c217d954SCole Faust typedef union
712*c217d954SCole Faust {
713*c217d954SCole Faust     cl_short  CL_ALIGNED(8) s[4];
714*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
715*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  x, y, z, w; };
716*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  s0, s1, s2, s3; };
717*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; };
718*c217d954SCole Faust #endif
719*c217d954SCole Faust #if defined( __CL_SHORT2__)
720*c217d954SCole Faust     __cl_short2     v2[2];
721*c217d954SCole Faust #endif
722*c217d954SCole Faust #if defined( __CL_SHORT4__)
723*c217d954SCole Faust     __cl_short4     v4;
724*c217d954SCole Faust #endif
725*c217d954SCole Faust }cl_short4;
726*c217d954SCole Faust 
727*c217d954SCole Faust /* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */
728*c217d954SCole Faust typedef  cl_short4  cl_short3;
729*c217d954SCole Faust 
730*c217d954SCole Faust typedef union
731*c217d954SCole Faust {
732*c217d954SCole Faust     cl_short   CL_ALIGNED(16) s[8];
733*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
734*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  x, y, z, w; };
735*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  s0, s1, s2, s3, s4, s5, s6, s7; };
736*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; };
737*c217d954SCole Faust #endif
738*c217d954SCole Faust #if defined( __CL_SHORT2__)
739*c217d954SCole Faust     __cl_short2     v2[4];
740*c217d954SCole Faust #endif
741*c217d954SCole Faust #if defined( __CL_SHORT4__)
742*c217d954SCole Faust     __cl_short4     v4[2];
743*c217d954SCole Faust #endif
744*c217d954SCole Faust #if defined( __CL_SHORT8__ )
745*c217d954SCole Faust     __cl_short8     v8;
746*c217d954SCole Faust #endif
747*c217d954SCole Faust }cl_short8;
748*c217d954SCole Faust 
749*c217d954SCole Faust typedef union
750*c217d954SCole Faust {
751*c217d954SCole Faust     cl_short  CL_ALIGNED(32) s[16];
752*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
753*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
754*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
755*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; };
756*c217d954SCole Faust #endif
757*c217d954SCole Faust #if defined( __CL_SHORT2__)
758*c217d954SCole Faust     __cl_short2     v2[8];
759*c217d954SCole Faust #endif
760*c217d954SCole Faust #if defined( __CL_SHORT4__)
761*c217d954SCole Faust     __cl_short4     v4[4];
762*c217d954SCole Faust #endif
763*c217d954SCole Faust #if defined( __CL_SHORT8__ )
764*c217d954SCole Faust     __cl_short8     v8[2];
765*c217d954SCole Faust #endif
766*c217d954SCole Faust #if defined( __CL_SHORT16__ )
767*c217d954SCole Faust     __cl_short16    v16;
768*c217d954SCole Faust #endif
769*c217d954SCole Faust }cl_short16;
770*c217d954SCole Faust 
771*c217d954SCole Faust 
772*c217d954SCole Faust /* ---- cl_ushortn ---- */
773*c217d954SCole Faust typedef union
774*c217d954SCole Faust {
775*c217d954SCole Faust     cl_ushort  CL_ALIGNED(4) s[2];
776*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
777*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  x, y; };
778*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  s0, s1; };
779*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  lo, hi; };
780*c217d954SCole Faust #endif
781*c217d954SCole Faust #if defined( __CL_USHORT2__)
782*c217d954SCole Faust     __cl_ushort2     v2;
783*c217d954SCole Faust #endif
784*c217d954SCole Faust }cl_ushort2;
785*c217d954SCole Faust 
786*c217d954SCole Faust typedef union
787*c217d954SCole Faust {
788*c217d954SCole Faust     cl_ushort  CL_ALIGNED(8) s[4];
789*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
790*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  x, y, z, w; };
791*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  s0, s1, s2, s3; };
792*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; };
793*c217d954SCole Faust #endif
794*c217d954SCole Faust #if defined( __CL_USHORT2__)
795*c217d954SCole Faust     __cl_ushort2     v2[2];
796*c217d954SCole Faust #endif
797*c217d954SCole Faust #if defined( __CL_USHORT4__)
798*c217d954SCole Faust     __cl_ushort4     v4;
799*c217d954SCole Faust #endif
800*c217d954SCole Faust }cl_ushort4;
801*c217d954SCole Faust 
802*c217d954SCole Faust /* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */
803*c217d954SCole Faust typedef  cl_ushort4  cl_ushort3;
804*c217d954SCole Faust 
805*c217d954SCole Faust typedef union
806*c217d954SCole Faust {
807*c217d954SCole Faust     cl_ushort   CL_ALIGNED(16) s[8];
808*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
809*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  x, y, z, w; };
810*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  s0, s1, s2, s3, s4, s5, s6, s7; };
811*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; };
812*c217d954SCole Faust #endif
813*c217d954SCole Faust #if defined( __CL_USHORT2__)
814*c217d954SCole Faust     __cl_ushort2     v2[4];
815*c217d954SCole Faust #endif
816*c217d954SCole Faust #if defined( __CL_USHORT4__)
817*c217d954SCole Faust     __cl_ushort4     v4[2];
818*c217d954SCole Faust #endif
819*c217d954SCole Faust #if defined( __CL_USHORT8__ )
820*c217d954SCole Faust     __cl_ushort8     v8;
821*c217d954SCole Faust #endif
822*c217d954SCole Faust }cl_ushort8;
823*c217d954SCole Faust 
824*c217d954SCole Faust typedef union
825*c217d954SCole Faust {
826*c217d954SCole Faust     cl_ushort  CL_ALIGNED(32) s[16];
827*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
828*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
829*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
830*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; };
831*c217d954SCole Faust #endif
832*c217d954SCole Faust #if defined( __CL_USHORT2__)
833*c217d954SCole Faust     __cl_ushort2     v2[8];
834*c217d954SCole Faust #endif
835*c217d954SCole Faust #if defined( __CL_USHORT4__)
836*c217d954SCole Faust     __cl_ushort4     v4[4];
837*c217d954SCole Faust #endif
838*c217d954SCole Faust #if defined( __CL_USHORT8__ )
839*c217d954SCole Faust     __cl_ushort8     v8[2];
840*c217d954SCole Faust #endif
841*c217d954SCole Faust #if defined( __CL_USHORT16__ )
842*c217d954SCole Faust     __cl_ushort16    v16;
843*c217d954SCole Faust #endif
844*c217d954SCole Faust }cl_ushort16;
845*c217d954SCole Faust 
846*c217d954SCole Faust 
847*c217d954SCole Faust /* ---- cl_halfn ---- */
848*c217d954SCole Faust typedef union
849*c217d954SCole Faust {
850*c217d954SCole Faust     cl_half  CL_ALIGNED(4) s[2];
851*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
852*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  x, y; };
853*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  s0, s1; };
854*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  lo, hi; };
855*c217d954SCole Faust #endif
856*c217d954SCole Faust #if defined( __CL_HALF2__)
857*c217d954SCole Faust     __cl_half2     v2;
858*c217d954SCole Faust #endif
859*c217d954SCole Faust }cl_half2;
860*c217d954SCole Faust 
861*c217d954SCole Faust typedef union
862*c217d954SCole Faust {
863*c217d954SCole Faust     cl_half  CL_ALIGNED(8) s[4];
864*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
865*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  x, y, z, w; };
866*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  s0, s1, s2, s3; };
867*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half2 lo, hi; };
868*c217d954SCole Faust #endif
869*c217d954SCole Faust #if defined( __CL_HALF2__)
870*c217d954SCole Faust     __cl_half2     v2[2];
871*c217d954SCole Faust #endif
872*c217d954SCole Faust #if defined( __CL_HALF4__)
873*c217d954SCole Faust     __cl_half4     v4;
874*c217d954SCole Faust #endif
875*c217d954SCole Faust }cl_half4;
876*c217d954SCole Faust 
877*c217d954SCole Faust /* cl_half3 is identical in size, alignment and behavior to cl_half4. See section 6.1.5. */
878*c217d954SCole Faust typedef  cl_half4  cl_half3;
879*c217d954SCole Faust 
880*c217d954SCole Faust typedef union
881*c217d954SCole Faust {
882*c217d954SCole Faust     cl_half   CL_ALIGNED(16) s[8];
883*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
884*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  x, y, z, w; };
885*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  s0, s1, s2, s3, s4, s5, s6, s7; };
886*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half4 lo, hi; };
887*c217d954SCole Faust #endif
888*c217d954SCole Faust #if defined( __CL_HALF2__)
889*c217d954SCole Faust     __cl_half2     v2[4];
890*c217d954SCole Faust #endif
891*c217d954SCole Faust #if defined( __CL_HALF4__)
892*c217d954SCole Faust     __cl_half4     v4[2];
893*c217d954SCole Faust #endif
894*c217d954SCole Faust #if defined( __CL_HALF8__ )
895*c217d954SCole Faust     __cl_half8     v8;
896*c217d954SCole Faust #endif
897*c217d954SCole Faust }cl_half8;
898*c217d954SCole Faust 
899*c217d954SCole Faust typedef union
900*c217d954SCole Faust {
901*c217d954SCole Faust     cl_half  CL_ALIGNED(32) s[16];
902*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
903*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
904*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
905*c217d954SCole Faust     __CL_ANON_STRUCT__ struct{ cl_half8 lo, hi; };
906*c217d954SCole Faust #endif
907*c217d954SCole Faust #if defined( __CL_HALF2__)
908*c217d954SCole Faust     __cl_half2     v2[8];
909*c217d954SCole Faust #endif
910*c217d954SCole Faust #if defined( __CL_HALF4__)
911*c217d954SCole Faust     __cl_half4     v4[4];
912*c217d954SCole Faust #endif
913*c217d954SCole Faust #if defined( __CL_HALF8__ )
914*c217d954SCole Faust     __cl_half8     v8[2];
915*c217d954SCole Faust #endif
916*c217d954SCole Faust #if defined( __CL_HALF16__ )
917*c217d954SCole Faust     __cl_half16    v16;
918*c217d954SCole Faust #endif
919*c217d954SCole Faust }cl_half16;
920*c217d954SCole Faust 
921*c217d954SCole Faust /* ---- cl_intn ---- */
922*c217d954SCole Faust typedef union
923*c217d954SCole Faust {
924*c217d954SCole Faust     cl_int  CL_ALIGNED(8) s[2];
925*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
926*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  x, y; };
927*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  s0, s1; };
928*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  lo, hi; };
929*c217d954SCole Faust #endif
930*c217d954SCole Faust #if defined( __CL_INT2__)
931*c217d954SCole Faust     __cl_int2     v2;
932*c217d954SCole Faust #endif
933*c217d954SCole Faust }cl_int2;
934*c217d954SCole Faust 
935*c217d954SCole Faust typedef union
936*c217d954SCole Faust {
937*c217d954SCole Faust     cl_int  CL_ALIGNED(16) s[4];
938*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
939*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  x, y, z, w; };
940*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  s0, s1, s2, s3; };
941*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; };
942*c217d954SCole Faust #endif
943*c217d954SCole Faust #if defined( __CL_INT2__)
944*c217d954SCole Faust     __cl_int2     v2[2];
945*c217d954SCole Faust #endif
946*c217d954SCole Faust #if defined( __CL_INT4__)
947*c217d954SCole Faust     __cl_int4     v4;
948*c217d954SCole Faust #endif
949*c217d954SCole Faust }cl_int4;
950*c217d954SCole Faust 
951*c217d954SCole Faust /* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */
952*c217d954SCole Faust typedef  cl_int4  cl_int3;
953*c217d954SCole Faust 
954*c217d954SCole Faust typedef union
955*c217d954SCole Faust {
956*c217d954SCole Faust     cl_int   CL_ALIGNED(32) s[8];
957*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
958*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  x, y, z, w; };
959*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  s0, s1, s2, s3, s4, s5, s6, s7; };
960*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; };
961*c217d954SCole Faust #endif
962*c217d954SCole Faust #if defined( __CL_INT2__)
963*c217d954SCole Faust     __cl_int2     v2[4];
964*c217d954SCole Faust #endif
965*c217d954SCole Faust #if defined( __CL_INT4__)
966*c217d954SCole Faust     __cl_int4     v4[2];
967*c217d954SCole Faust #endif
968*c217d954SCole Faust #if defined( __CL_INT8__ )
969*c217d954SCole Faust     __cl_int8     v8;
970*c217d954SCole Faust #endif
971*c217d954SCole Faust }cl_int8;
972*c217d954SCole Faust 
973*c217d954SCole Faust typedef union
974*c217d954SCole Faust {
975*c217d954SCole Faust     cl_int  CL_ALIGNED(64) s[16];
976*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
977*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
978*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
979*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; };
980*c217d954SCole Faust #endif
981*c217d954SCole Faust #if defined( __CL_INT2__)
982*c217d954SCole Faust     __cl_int2     v2[8];
983*c217d954SCole Faust #endif
984*c217d954SCole Faust #if defined( __CL_INT4__)
985*c217d954SCole Faust     __cl_int4     v4[4];
986*c217d954SCole Faust #endif
987*c217d954SCole Faust #if defined( __CL_INT8__ )
988*c217d954SCole Faust     __cl_int8     v8[2];
989*c217d954SCole Faust #endif
990*c217d954SCole Faust #if defined( __CL_INT16__ )
991*c217d954SCole Faust     __cl_int16    v16;
992*c217d954SCole Faust #endif
993*c217d954SCole Faust }cl_int16;
994*c217d954SCole Faust 
995*c217d954SCole Faust 
996*c217d954SCole Faust /* ---- cl_uintn ---- */
997*c217d954SCole Faust typedef union
998*c217d954SCole Faust {
999*c217d954SCole Faust     cl_uint  CL_ALIGNED(8) s[2];
1000*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1001*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  x, y; };
1002*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  s0, s1; };
1003*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  lo, hi; };
1004*c217d954SCole Faust #endif
1005*c217d954SCole Faust #if defined( __CL_UINT2__)
1006*c217d954SCole Faust     __cl_uint2     v2;
1007*c217d954SCole Faust #endif
1008*c217d954SCole Faust }cl_uint2;
1009*c217d954SCole Faust 
1010*c217d954SCole Faust typedef union
1011*c217d954SCole Faust {
1012*c217d954SCole Faust     cl_uint  CL_ALIGNED(16) s[4];
1013*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1014*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  x, y, z, w; };
1015*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  s0, s1, s2, s3; };
1016*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; };
1017*c217d954SCole Faust #endif
1018*c217d954SCole Faust #if defined( __CL_UINT2__)
1019*c217d954SCole Faust     __cl_uint2     v2[2];
1020*c217d954SCole Faust #endif
1021*c217d954SCole Faust #if defined( __CL_UINT4__)
1022*c217d954SCole Faust     __cl_uint4     v4;
1023*c217d954SCole Faust #endif
1024*c217d954SCole Faust }cl_uint4;
1025*c217d954SCole Faust 
1026*c217d954SCole Faust /* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */
1027*c217d954SCole Faust typedef  cl_uint4  cl_uint3;
1028*c217d954SCole Faust 
1029*c217d954SCole Faust typedef union
1030*c217d954SCole Faust {
1031*c217d954SCole Faust     cl_uint   CL_ALIGNED(32) s[8];
1032*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1033*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  x, y, z, w; };
1034*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  s0, s1, s2, s3, s4, s5, s6, s7; };
1035*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; };
1036*c217d954SCole Faust #endif
1037*c217d954SCole Faust #if defined( __CL_UINT2__)
1038*c217d954SCole Faust     __cl_uint2     v2[4];
1039*c217d954SCole Faust #endif
1040*c217d954SCole Faust #if defined( __CL_UINT4__)
1041*c217d954SCole Faust     __cl_uint4     v4[2];
1042*c217d954SCole Faust #endif
1043*c217d954SCole Faust #if defined( __CL_UINT8__ )
1044*c217d954SCole Faust     __cl_uint8     v8;
1045*c217d954SCole Faust #endif
1046*c217d954SCole Faust }cl_uint8;
1047*c217d954SCole Faust 
1048*c217d954SCole Faust typedef union
1049*c217d954SCole Faust {
1050*c217d954SCole Faust     cl_uint  CL_ALIGNED(64) s[16];
1051*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1052*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1053*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1054*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; };
1055*c217d954SCole Faust #endif
1056*c217d954SCole Faust #if defined( __CL_UINT2__)
1057*c217d954SCole Faust     __cl_uint2     v2[8];
1058*c217d954SCole Faust #endif
1059*c217d954SCole Faust #if defined( __CL_UINT4__)
1060*c217d954SCole Faust     __cl_uint4     v4[4];
1061*c217d954SCole Faust #endif
1062*c217d954SCole Faust #if defined( __CL_UINT8__ )
1063*c217d954SCole Faust     __cl_uint8     v8[2];
1064*c217d954SCole Faust #endif
1065*c217d954SCole Faust #if defined( __CL_UINT16__ )
1066*c217d954SCole Faust     __cl_uint16    v16;
1067*c217d954SCole Faust #endif
1068*c217d954SCole Faust }cl_uint16;
1069*c217d954SCole Faust 
1070*c217d954SCole Faust /* ---- cl_longn ---- */
1071*c217d954SCole Faust typedef union
1072*c217d954SCole Faust {
1073*c217d954SCole Faust     cl_long  CL_ALIGNED(16) s[2];
1074*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1075*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  x, y; };
1076*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  s0, s1; };
1077*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  lo, hi; };
1078*c217d954SCole Faust #endif
1079*c217d954SCole Faust #if defined( __CL_LONG2__)
1080*c217d954SCole Faust     __cl_long2     v2;
1081*c217d954SCole Faust #endif
1082*c217d954SCole Faust }cl_long2;
1083*c217d954SCole Faust 
1084*c217d954SCole Faust typedef union
1085*c217d954SCole Faust {
1086*c217d954SCole Faust     cl_long  CL_ALIGNED(32) s[4];
1087*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1088*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  x, y, z, w; };
1089*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  s0, s1, s2, s3; };
1090*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; };
1091*c217d954SCole Faust #endif
1092*c217d954SCole Faust #if defined( __CL_LONG2__)
1093*c217d954SCole Faust     __cl_long2     v2[2];
1094*c217d954SCole Faust #endif
1095*c217d954SCole Faust #if defined( __CL_LONG4__)
1096*c217d954SCole Faust     __cl_long4     v4;
1097*c217d954SCole Faust #endif
1098*c217d954SCole Faust }cl_long4;
1099*c217d954SCole Faust 
1100*c217d954SCole Faust /* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */
1101*c217d954SCole Faust typedef  cl_long4  cl_long3;
1102*c217d954SCole Faust 
1103*c217d954SCole Faust typedef union
1104*c217d954SCole Faust {
1105*c217d954SCole Faust     cl_long   CL_ALIGNED(64) s[8];
1106*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1107*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  x, y, z, w; };
1108*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  s0, s1, s2, s3, s4, s5, s6, s7; };
1109*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; };
1110*c217d954SCole Faust #endif
1111*c217d954SCole Faust #if defined( __CL_LONG2__)
1112*c217d954SCole Faust     __cl_long2     v2[4];
1113*c217d954SCole Faust #endif
1114*c217d954SCole Faust #if defined( __CL_LONG4__)
1115*c217d954SCole Faust     __cl_long4     v4[2];
1116*c217d954SCole Faust #endif
1117*c217d954SCole Faust #if defined( __CL_LONG8__ )
1118*c217d954SCole Faust     __cl_long8     v8;
1119*c217d954SCole Faust #endif
1120*c217d954SCole Faust }cl_long8;
1121*c217d954SCole Faust 
1122*c217d954SCole Faust typedef union
1123*c217d954SCole Faust {
1124*c217d954SCole Faust     cl_long  CL_ALIGNED(128) s[16];
1125*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1126*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1127*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1128*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; };
1129*c217d954SCole Faust #endif
1130*c217d954SCole Faust #if defined( __CL_LONG2__)
1131*c217d954SCole Faust     __cl_long2     v2[8];
1132*c217d954SCole Faust #endif
1133*c217d954SCole Faust #if defined( __CL_LONG4__)
1134*c217d954SCole Faust     __cl_long4     v4[4];
1135*c217d954SCole Faust #endif
1136*c217d954SCole Faust #if defined( __CL_LONG8__ )
1137*c217d954SCole Faust     __cl_long8     v8[2];
1138*c217d954SCole Faust #endif
1139*c217d954SCole Faust #if defined( __CL_LONG16__ )
1140*c217d954SCole Faust     __cl_long16    v16;
1141*c217d954SCole Faust #endif
1142*c217d954SCole Faust }cl_long16;
1143*c217d954SCole Faust 
1144*c217d954SCole Faust 
1145*c217d954SCole Faust /* ---- cl_ulongn ---- */
1146*c217d954SCole Faust typedef union
1147*c217d954SCole Faust {
1148*c217d954SCole Faust     cl_ulong  CL_ALIGNED(16) s[2];
1149*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1150*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  x, y; };
1151*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  s0, s1; };
1152*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  lo, hi; };
1153*c217d954SCole Faust #endif
1154*c217d954SCole Faust #if defined( __CL_ULONG2__)
1155*c217d954SCole Faust     __cl_ulong2     v2;
1156*c217d954SCole Faust #endif
1157*c217d954SCole Faust }cl_ulong2;
1158*c217d954SCole Faust 
1159*c217d954SCole Faust typedef union
1160*c217d954SCole Faust {
1161*c217d954SCole Faust     cl_ulong  CL_ALIGNED(32) s[4];
1162*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1163*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  x, y, z, w; };
1164*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  s0, s1, s2, s3; };
1165*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; };
1166*c217d954SCole Faust #endif
1167*c217d954SCole Faust #if defined( __CL_ULONG2__)
1168*c217d954SCole Faust     __cl_ulong2     v2[2];
1169*c217d954SCole Faust #endif
1170*c217d954SCole Faust #if defined( __CL_ULONG4__)
1171*c217d954SCole Faust     __cl_ulong4     v4;
1172*c217d954SCole Faust #endif
1173*c217d954SCole Faust }cl_ulong4;
1174*c217d954SCole Faust 
1175*c217d954SCole Faust /* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */
1176*c217d954SCole Faust typedef  cl_ulong4  cl_ulong3;
1177*c217d954SCole Faust 
1178*c217d954SCole Faust typedef union
1179*c217d954SCole Faust {
1180*c217d954SCole Faust     cl_ulong   CL_ALIGNED(64) s[8];
1181*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1182*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  x, y, z, w; };
1183*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  s0, s1, s2, s3, s4, s5, s6, s7; };
1184*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; };
1185*c217d954SCole Faust #endif
1186*c217d954SCole Faust #if defined( __CL_ULONG2__)
1187*c217d954SCole Faust     __cl_ulong2     v2[4];
1188*c217d954SCole Faust #endif
1189*c217d954SCole Faust #if defined( __CL_ULONG4__)
1190*c217d954SCole Faust     __cl_ulong4     v4[2];
1191*c217d954SCole Faust #endif
1192*c217d954SCole Faust #if defined( __CL_ULONG8__ )
1193*c217d954SCole Faust     __cl_ulong8     v8;
1194*c217d954SCole Faust #endif
1195*c217d954SCole Faust }cl_ulong8;
1196*c217d954SCole Faust 
1197*c217d954SCole Faust typedef union
1198*c217d954SCole Faust {
1199*c217d954SCole Faust     cl_ulong  CL_ALIGNED(128) s[16];
1200*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1201*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1202*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1203*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; };
1204*c217d954SCole Faust #endif
1205*c217d954SCole Faust #if defined( __CL_ULONG2__)
1206*c217d954SCole Faust     __cl_ulong2     v2[8];
1207*c217d954SCole Faust #endif
1208*c217d954SCole Faust #if defined( __CL_ULONG4__)
1209*c217d954SCole Faust     __cl_ulong4     v4[4];
1210*c217d954SCole Faust #endif
1211*c217d954SCole Faust #if defined( __CL_ULONG8__ )
1212*c217d954SCole Faust     __cl_ulong8     v8[2];
1213*c217d954SCole Faust #endif
1214*c217d954SCole Faust #if defined( __CL_ULONG16__ )
1215*c217d954SCole Faust     __cl_ulong16    v16;
1216*c217d954SCole Faust #endif
1217*c217d954SCole Faust }cl_ulong16;
1218*c217d954SCole Faust 
1219*c217d954SCole Faust 
1220*c217d954SCole Faust /* --- cl_floatn ---- */
1221*c217d954SCole Faust 
1222*c217d954SCole Faust typedef union
1223*c217d954SCole Faust {
1224*c217d954SCole Faust     cl_float  CL_ALIGNED(8) s[2];
1225*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1226*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float  x, y; };
1227*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float  s0, s1; };
1228*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float  lo, hi; };
1229*c217d954SCole Faust #endif
1230*c217d954SCole Faust #if defined( __CL_FLOAT2__)
1231*c217d954SCole Faust     __cl_float2     v2;
1232*c217d954SCole Faust #endif
1233*c217d954SCole Faust }cl_float2;
1234*c217d954SCole Faust 
1235*c217d954SCole Faust typedef union
1236*c217d954SCole Faust {
1237*c217d954SCole Faust     cl_float  CL_ALIGNED(16) s[4];
1238*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1239*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float   x, y, z, w; };
1240*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float   s0, s1, s2, s3; };
1241*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float2  lo, hi; };
1242*c217d954SCole Faust #endif
1243*c217d954SCole Faust #if defined( __CL_FLOAT2__)
1244*c217d954SCole Faust     __cl_float2     v2[2];
1245*c217d954SCole Faust #endif
1246*c217d954SCole Faust #if defined( __CL_FLOAT4__)
1247*c217d954SCole Faust     __cl_float4     v4;
1248*c217d954SCole Faust #endif
1249*c217d954SCole Faust }cl_float4;
1250*c217d954SCole Faust 
1251*c217d954SCole Faust /* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */
1252*c217d954SCole Faust typedef  cl_float4  cl_float3;
1253*c217d954SCole Faust 
1254*c217d954SCole Faust typedef union
1255*c217d954SCole Faust {
1256*c217d954SCole Faust     cl_float   CL_ALIGNED(32) s[8];
1257*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1258*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float   x, y, z, w; };
1259*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float   s0, s1, s2, s3, s4, s5, s6, s7; };
1260*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float4  lo, hi; };
1261*c217d954SCole Faust #endif
1262*c217d954SCole Faust #if defined( __CL_FLOAT2__)
1263*c217d954SCole Faust     __cl_float2     v2[4];
1264*c217d954SCole Faust #endif
1265*c217d954SCole Faust #if defined( __CL_FLOAT4__)
1266*c217d954SCole Faust     __cl_float4     v4[2];
1267*c217d954SCole Faust #endif
1268*c217d954SCole Faust #if defined( __CL_FLOAT8__ )
1269*c217d954SCole Faust     __cl_float8     v8;
1270*c217d954SCole Faust #endif
1271*c217d954SCole Faust }cl_float8;
1272*c217d954SCole Faust 
1273*c217d954SCole Faust typedef union
1274*c217d954SCole Faust {
1275*c217d954SCole Faust     cl_float  CL_ALIGNED(64) s[16];
1276*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1277*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1278*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1279*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; };
1280*c217d954SCole Faust #endif
1281*c217d954SCole Faust #if defined( __CL_FLOAT2__)
1282*c217d954SCole Faust     __cl_float2     v2[8];
1283*c217d954SCole Faust #endif
1284*c217d954SCole Faust #if defined( __CL_FLOAT4__)
1285*c217d954SCole Faust     __cl_float4     v4[4];
1286*c217d954SCole Faust #endif
1287*c217d954SCole Faust #if defined( __CL_FLOAT8__ )
1288*c217d954SCole Faust     __cl_float8     v8[2];
1289*c217d954SCole Faust #endif
1290*c217d954SCole Faust #if defined( __CL_FLOAT16__ )
1291*c217d954SCole Faust     __cl_float16    v16;
1292*c217d954SCole Faust #endif
1293*c217d954SCole Faust }cl_float16;
1294*c217d954SCole Faust 
1295*c217d954SCole Faust /* --- cl_doublen ---- */
1296*c217d954SCole Faust 
1297*c217d954SCole Faust typedef union
1298*c217d954SCole Faust {
1299*c217d954SCole Faust     cl_double  CL_ALIGNED(16) s[2];
1300*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1301*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  x, y; };
1302*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double s0, s1; };
1303*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double lo, hi; };
1304*c217d954SCole Faust #endif
1305*c217d954SCole Faust #if defined( __CL_DOUBLE2__)
1306*c217d954SCole Faust     __cl_double2     v2;
1307*c217d954SCole Faust #endif
1308*c217d954SCole Faust }cl_double2;
1309*c217d954SCole Faust 
1310*c217d954SCole Faust typedef union
1311*c217d954SCole Faust {
1312*c217d954SCole Faust     cl_double  CL_ALIGNED(32) s[4];
1313*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1314*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  x, y, z, w; };
1315*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  s0, s1, s2, s3; };
1316*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; };
1317*c217d954SCole Faust #endif
1318*c217d954SCole Faust #if defined( __CL_DOUBLE2__)
1319*c217d954SCole Faust     __cl_double2     v2[2];
1320*c217d954SCole Faust #endif
1321*c217d954SCole Faust #if defined( __CL_DOUBLE4__)
1322*c217d954SCole Faust     __cl_double4     v4;
1323*c217d954SCole Faust #endif
1324*c217d954SCole Faust }cl_double4;
1325*c217d954SCole Faust 
1326*c217d954SCole Faust /* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */
1327*c217d954SCole Faust typedef  cl_double4  cl_double3;
1328*c217d954SCole Faust 
1329*c217d954SCole Faust typedef union
1330*c217d954SCole Faust {
1331*c217d954SCole Faust     cl_double   CL_ALIGNED(64) s[8];
1332*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1333*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  x, y, z, w; };
1334*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  s0, s1, s2, s3, s4, s5, s6, s7; };
1335*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; };
1336*c217d954SCole Faust #endif
1337*c217d954SCole Faust #if defined( __CL_DOUBLE2__)
1338*c217d954SCole Faust     __cl_double2     v2[4];
1339*c217d954SCole Faust #endif
1340*c217d954SCole Faust #if defined( __CL_DOUBLE4__)
1341*c217d954SCole Faust     __cl_double4     v4[2];
1342*c217d954SCole Faust #endif
1343*c217d954SCole Faust #if defined( __CL_DOUBLE8__ )
1344*c217d954SCole Faust     __cl_double8     v8;
1345*c217d954SCole Faust #endif
1346*c217d954SCole Faust }cl_double8;
1347*c217d954SCole Faust 
1348*c217d954SCole Faust typedef union
1349*c217d954SCole Faust {
1350*c217d954SCole Faust     cl_double  CL_ALIGNED(128) s[16];
1351*c217d954SCole Faust #if __CL_HAS_ANON_STRUCT__
1352*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1353*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1354*c217d954SCole Faust    __CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; };
1355*c217d954SCole Faust #endif
1356*c217d954SCole Faust #if defined( __CL_DOUBLE2__)
1357*c217d954SCole Faust     __cl_double2     v2[8];
1358*c217d954SCole Faust #endif
1359*c217d954SCole Faust #if defined( __CL_DOUBLE4__)
1360*c217d954SCole Faust     __cl_double4     v4[4];
1361*c217d954SCole Faust #endif
1362*c217d954SCole Faust #if defined( __CL_DOUBLE8__ )
1363*c217d954SCole Faust     __cl_double8     v8[2];
1364*c217d954SCole Faust #endif
1365*c217d954SCole Faust #if defined( __CL_DOUBLE16__ )
1366*c217d954SCole Faust     __cl_double16    v16;
1367*c217d954SCole Faust #endif
1368*c217d954SCole Faust }cl_double16;
1369*c217d954SCole Faust 
1370*c217d954SCole Faust /* Macro to facilitate debugging
1371*c217d954SCole Faust  * Usage:
1372*c217d954SCole Faust  *   Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source.
1373*c217d954SCole Faust  *   The first line ends with:   CL_PROGRAM_STRING_DEBUG_INFO \"
1374*c217d954SCole Faust  *   Each line thereafter of OpenCL C source must end with: \n\
1375*c217d954SCole Faust  *   The last line ends in ";
1376*c217d954SCole Faust  *
1377*c217d954SCole Faust  *   Example:
1378*c217d954SCole Faust  *
1379*c217d954SCole Faust  *   const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
1380*c217d954SCole Faust  *   kernel void foo( int a, float * b )             \n\
1381*c217d954SCole Faust  *   {                                               \n\
1382*c217d954SCole Faust  *      // my comment                                \n\
1383*c217d954SCole Faust  *      *b[ get_global_id(0)] = a;                   \n\
1384*c217d954SCole Faust  *   }                                               \n\
1385*c217d954SCole Faust  *   ";
1386*c217d954SCole Faust  *
1387*c217d954SCole Faust  * This should correctly set up the line, (column) and file information for your source
1388*c217d954SCole Faust  * string so you can do source level debugging.
1389*c217d954SCole Faust  */
1390*c217d954SCole Faust #define  __CL_STRINGIFY( _x )               # _x
1391*c217d954SCole Faust #define  _CL_STRINGIFY( _x )                __CL_STRINGIFY( _x )
1392*c217d954SCole Faust #define  CL_PROGRAM_STRING_DEBUG_INFO       "#line "  _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n"
1393*c217d954SCole Faust 
1394*c217d954SCole Faust #ifdef __cplusplus
1395*c217d954SCole Faust }
1396*c217d954SCole Faust #endif
1397*c217d954SCole Faust 
1398*c217d954SCole Faust #if defined( _WIN32) && defined(_MSC_VER) && ! defined(__STDC__)
1399*c217d954SCole Faust     #if _MSC_VER >=1500
1400*c217d954SCole Faust     #pragma warning( pop )
1401*c217d954SCole Faust     #endif
1402*c217d954SCole Faust #endif
1403*c217d954SCole Faust 
1404*c217d954SCole Faust #endif  /* __CL_PLATFORM_H  */
1405