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