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