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