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