1 /**********************************************************************************
2 * Copyright (c) 2008-2013 The Khronos Group Inc.
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:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Materials.
15 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22 **********************************************************************************/
24 /* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */
26 #ifndef __CL_PLATFORM_H
27 #define __CL_PLATFORM_H
30 /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */
31 #include <AvailabilityMacros.h>
40 #define CL_API_CALL __stdcall
41 #define CL_CALLBACK __stdcall
49 * Deprecation flags refer to the last version of the header in which the
50 * feature was not deprecated.
52 * E.g. VERSION_1_1_DEPRECATED means the feature is present in 1.1 without
53 * deprecation but is deprecated in versions later than 1.1.
57 #define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
58 #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
59 #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
60 #define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
61 #define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
62 #define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
63 #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
65 #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
66 #define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
67 #define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
68 #define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
69 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
70 #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
72 #warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
73 #define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
74 #define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
75 #define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
76 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
79 #define CL_EXTENSION_WEAK_LINK
80 #define CL_API_SUFFIX__VERSION_1_0
81 #define CL_EXT_SUFFIX__VERSION_1_0
82 #define CL_API_SUFFIX__VERSION_1_1
83 #define CL_EXT_SUFFIX__VERSION_1_1
84 #define CL_API_SUFFIX__VERSION_1_2
85 #define CL_EXT_SUFFIX__VERSION_1_2
86 #define CL_API_SUFFIX__VERSION_2_0
87 #define CL_EXT_SUFFIX__VERSION_2_0
88 #define CL_API_SUFFIX__VERSION_2_1
89 #define CL_EXT_SUFFIX__VERSION_2_1
92 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
93 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
94 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
96 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated))
97 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
100 #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
101 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
102 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
104 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
105 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
108 #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS
109 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
110 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
112 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED __attribute__((deprecated))
113 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
116 #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS
117 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
118 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
120 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED __attribute__((deprecated))
121 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
124 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
125 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
126 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
128 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
129 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated)
132 #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
133 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
134 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
136 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
137 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated)
140 #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS
141 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
142 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
144 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
145 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED __declspec(deprecated)
148 #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS
149 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
150 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
152 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
153 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED __declspec(deprecated)
156 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
157 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
159 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
160 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
162 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
163 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
165 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
166 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
170 #if (defined (_WIN32) && defined(_MSC_VER))
173 typedef signed __int8 cl_char;
174 typedef unsigned __int8 cl_uchar;
175 typedef signed __int16 cl_short;
176 typedef unsigned __int16 cl_ushort;
177 typedef signed __int32 cl_int;
178 typedef unsigned __int32 cl_uint;
179 typedef signed __int64 cl_long;
180 typedef unsigned __int64 cl_ulong;
182 typedef unsigned __int16 cl_half;
183 typedef float cl_float;
184 typedef double cl_double;
186 /* Macro names and corresponding values defined by OpenCL */
187 #define CL_CHAR_BIT 8
188 #define CL_SCHAR_MAX 127
189 #define CL_SCHAR_MIN (-127-1)
190 #define CL_CHAR_MAX CL_SCHAR_MAX
191 #define CL_CHAR_MIN CL_SCHAR_MIN
192 #define CL_UCHAR_MAX 255
193 #define CL_SHRT_MAX 32767
194 #define CL_SHRT_MIN (-32767-1)
195 #define CL_USHRT_MAX 65535
196 #define CL_INT_MAX 2147483647
197 #define CL_INT_MIN (-2147483647-1)
198 #define CL_UINT_MAX 0xffffffffU
199 #define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
200 #define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
201 #define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
204 #define CL_FLT_MANT_DIG 24
205 #define CL_FLT_MAX_10_EXP +38
206 #define CL_FLT_MAX_EXP +128
207 #define CL_FLT_MIN_10_EXP -37
208 #define CL_FLT_MIN_EXP -125
209 #define CL_FLT_RADIX 2
210 #define CL_FLT_MAX 340282346638528859811704183484516925440.0f
211 #define CL_FLT_MIN 1.175494350822287507969e-38f
212 #define CL_FLT_EPSILON 0x1.0p-23f
214 #define CL_DBL_DIG 15
215 #define CL_DBL_MANT_DIG 53
216 #define CL_DBL_MAX_10_EXP +308
217 #define CL_DBL_MAX_EXP +1024
218 #define CL_DBL_MIN_10_EXP -307
219 #define CL_DBL_MIN_EXP -1021
220 #define CL_DBL_RADIX 2
221 #define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
222 #define CL_DBL_MIN 2.225073858507201383090e-308
223 #define CL_DBL_EPSILON 2.220446049250313080847e-16
225 #define CL_M_E 2.718281828459045090796
226 #define CL_M_LOG2E 1.442695040888963387005
227 #define CL_M_LOG10E 0.434294481903251816668
228 #define CL_M_LN2 0.693147180559945286227
229 #define CL_M_LN10 2.302585092994045901094
230 #define CL_M_PI 3.141592653589793115998
231 #define CL_M_PI_2 1.570796326794896557999
232 #define CL_M_PI_4 0.785398163397448278999
233 #define CL_M_1_PI 0.318309886183790691216
234 #define CL_M_2_PI 0.636619772367581382433
235 #define CL_M_2_SQRTPI 1.128379167095512558561
236 #define CL_M_SQRT2 1.414213562373095145475
237 #define CL_M_SQRT1_2 0.707106781186547572737
239 #define CL_M_E_F 2.71828174591064f
240 #define CL_M_LOG2E_F 1.44269502162933f
241 #define CL_M_LOG10E_F 0.43429449200630f
242 #define CL_M_LN2_F 0.69314718246460f
243 #define CL_M_LN10_F 2.30258512496948f
244 #define CL_M_PI_F 3.14159274101257f
245 #define CL_M_PI_2_F 1.57079637050629f
246 #define CL_M_PI_4_F 0.78539818525314f
247 #define CL_M_1_PI_F 0.31830987334251f
248 #define CL_M_2_PI_F 0.63661974668503f
249 #define CL_M_2_SQRTPI_F 1.12837922573090f
250 #define CL_M_SQRT2_F 1.41421353816986f
251 #define CL_M_SQRT1_2_F 0.70710676908493f
253 #define CL_NAN (CL_INFINITY - CL_INFINITY)
254 #define CL_HUGE_VALF ((cl_float) 1e50)
255 #define CL_HUGE_VAL ((cl_double) 1e500)
256 #define CL_MAXFLOAT CL_FLT_MAX
257 #define CL_INFINITY CL_HUGE_VALF
264 typedef int8_t cl_char;
265 typedef uint8_t cl_uchar;
266 typedef int16_t cl_short __attribute__((aligned(2)));
267 typedef uint16_t cl_ushort __attribute__((aligned(2)));
268 typedef int32_t cl_int __attribute__((aligned(4)));
269 typedef uint32_t cl_uint __attribute__((aligned(4)));
270 typedef int64_t cl_long __attribute__((aligned(8)));
271 typedef uint64_t cl_ulong __attribute__((aligned(8)));
273 typedef uint16_t cl_half __attribute__((aligned(2)));
274 typedef float cl_float __attribute__((aligned(4)));
275 typedef double cl_double __attribute__((aligned(8)));
277 /* Macro names and corresponding values defined by OpenCL */
278 #define CL_CHAR_BIT 8
279 #define CL_SCHAR_MAX 127
280 #define CL_SCHAR_MIN (-127-1)
281 #define CL_CHAR_MAX CL_SCHAR_MAX
282 #define CL_CHAR_MIN CL_SCHAR_MIN
283 #define CL_UCHAR_MAX 255
284 #define CL_SHRT_MAX 32767
285 #define CL_SHRT_MIN (-32767-1)
286 #define CL_USHRT_MAX 65535
287 #define CL_INT_MAX 2147483647
288 #define CL_INT_MIN (-2147483647-1)
289 #define CL_UINT_MAX 0xffffffffU
290 #define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
291 #define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
292 #define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
295 #define CL_FLT_MANT_DIG 24
296 #define CL_FLT_MAX_10_EXP +38
297 #define CL_FLT_MAX_EXP +128
298 #define CL_FLT_MIN_10_EXP -37
299 #define CL_FLT_MIN_EXP -125
300 #define CL_FLT_RADIX 2
301 #define CL_FLT_MAX 0x1.fffffep127f
302 #define CL_FLT_MIN 0x1.0p-126f
303 #define CL_FLT_EPSILON 0x1.0p-23f
305 #define CL_DBL_DIG 15
306 #define CL_DBL_MANT_DIG 53
307 #define CL_DBL_MAX_10_EXP +308
308 #define CL_DBL_MAX_EXP +1024
309 #define CL_DBL_MIN_10_EXP -307
310 #define CL_DBL_MIN_EXP -1021
311 #define CL_DBL_RADIX 2
312 #define CL_DBL_MAX 0x1.fffffffffffffp1023
313 #define CL_DBL_MIN 0x1.0p-1022
314 #define CL_DBL_EPSILON 0x1.0p-52
316 #define CL_M_E 2.718281828459045090796
317 #define CL_M_LOG2E 1.442695040888963387005
318 #define CL_M_LOG10E 0.434294481903251816668
319 #define CL_M_LN2 0.693147180559945286227
320 #define CL_M_LN10 2.302585092994045901094
321 #define CL_M_PI 3.141592653589793115998
322 #define CL_M_PI_2 1.570796326794896557999
323 #define CL_M_PI_4 0.785398163397448278999
324 #define CL_M_1_PI 0.318309886183790691216
325 #define CL_M_2_PI 0.636619772367581382433
326 #define CL_M_2_SQRTPI 1.128379167095512558561
327 #define CL_M_SQRT2 1.414213562373095145475
328 #define CL_M_SQRT1_2 0.707106781186547572737
330 #define CL_M_E_F 2.71828174591064f
331 #define CL_M_LOG2E_F 1.44269502162933f
332 #define CL_M_LOG10E_F 0.43429449200630f
333 #define CL_M_LN2_F 0.69314718246460f
334 #define CL_M_LN10_F 2.30258512496948f
335 #define CL_M_PI_F 3.14159274101257f
336 #define CL_M_PI_2_F 1.57079637050629f
337 #define CL_M_PI_4_F 0.78539818525314f
338 #define CL_M_1_PI_F 0.31830987334251f
339 #define CL_M_2_PI_F 0.63661974668503f
340 #define CL_M_2_SQRTPI_F 1.12837922573090f
341 #define CL_M_SQRT2_F 1.41421353816986f
342 #define CL_M_SQRT1_2_F 0.70710676908493f
344 #if defined( __GNUC__ )
345 #define CL_HUGE_VALF __builtin_huge_valf()
346 #define CL_HUGE_VAL __builtin_huge_val()
347 #define CL_NAN __builtin_nanf( "" )
349 #define CL_HUGE_VALF ((cl_float) 1e50)
350 #define CL_HUGE_VAL ((cl_double) 1e500)
351 float nanf( const char * );
352 #define CL_NAN nanf( "" )
354 #define CL_MAXFLOAT CL_FLT_MAX
355 #define CL_INFINITY CL_HUGE_VALF
361 /* 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. */
362 typedef unsigned int cl_GLuint;
363 typedef int cl_GLint;
364 typedef unsigned int cl_GLenum;
369 * Note: OpenCL requires that all types be naturally aligned.
370 * This means that vector types must be naturally aligned.
371 * For example, a vector of four floats must be aligned to
372 * a 16 byte boundary (calculated as 4 * the natural 4-byte
373 * alignment of the float). The alignment qualifiers here
374 * will only function properly if your compiler supports them
375 * and if you don't actively work to defeat them. For example,
376 * in order for a cl_float4 to be 16 byte aligned in a struct,
377 * the start of the struct must itself be 16-byte aligned.
379 * Maintaining proper alignment is the user's responsibility.
382 /* Define basic vector types */
383 #if defined( __VEC__ )
384 #include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
385 typedef vector unsigned char __cl_uchar16;
386 typedef vector signed char __cl_char16;
387 typedef vector unsigned short __cl_ushort8;
388 typedef vector signed short __cl_short8;
389 typedef vector unsigned int __cl_uint4;
390 typedef vector signed int __cl_int4;
391 typedef vector float __cl_float4;
392 #define __CL_UCHAR16__ 1
393 #define __CL_CHAR16__ 1
394 #define __CL_USHORT8__ 1
395 #define __CL_SHORT8__ 1
396 #define __CL_UINT4__ 1
397 #define __CL_INT4__ 1
398 #define __CL_FLOAT4__ 1
401 #if defined( __SSE__ )
402 #if defined( __MINGW64__ )
405 #include <xmmintrin.h>
407 #if defined( __GNUC__ )
408 typedef float __cl_float4 __attribute__((vector_size(16)));
410 typedef __m128 __cl_float4;
412 #define __CL_FLOAT4__ 1
415 #if defined( __SSE2__ )
416 #if defined( __MINGW64__ )
419 #include <emmintrin.h>
421 #if defined( __GNUC__ )
422 typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16)));
423 typedef cl_char __cl_char16 __attribute__((vector_size(16)));
424 typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16)));
425 typedef cl_short __cl_short8 __attribute__((vector_size(16)));
426 typedef cl_uint __cl_uint4 __attribute__((vector_size(16)));
427 typedef cl_int __cl_int4 __attribute__((vector_size(16)));
428 typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16)));
429 typedef cl_long __cl_long2 __attribute__((vector_size(16)));
430 typedef cl_double __cl_double2 __attribute__((vector_size(16)));
432 typedef __m128i __cl_uchar16;
433 typedef __m128i __cl_char16;
434 typedef __m128i __cl_ushort8;
435 typedef __m128i __cl_short8;
436 typedef __m128i __cl_uint4;
437 typedef __m128i __cl_int4;
438 typedef __m128i __cl_ulong2;
439 typedef __m128i __cl_long2;
440 typedef __m128d __cl_double2;
442 #define __CL_UCHAR16__ 1
443 #define __CL_CHAR16__ 1
444 #define __CL_USHORT8__ 1
445 #define __CL_SHORT8__ 1
446 #define __CL_INT4__ 1
447 #define __CL_UINT4__ 1
448 #define __CL_ULONG2__ 1
449 #define __CL_LONG2__ 1
450 #define __CL_DOUBLE2__ 1
453 #if defined( __MMX__ )
454 #include <mmintrin.h>
455 #if defined( __GNUC__ )
456 typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8)));
457 typedef cl_char __cl_char8 __attribute__((vector_size(8)));
458 typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8)));
459 typedef cl_short __cl_short4 __attribute__((vector_size(8)));
460 typedef cl_uint __cl_uint2 __attribute__((vector_size(8)));
461 typedef cl_int __cl_int2 __attribute__((vector_size(8)));
462 typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8)));
463 typedef cl_long __cl_long1 __attribute__((vector_size(8)));
464 typedef cl_float __cl_float2 __attribute__((vector_size(8)));
466 typedef __m64 __cl_uchar8;
467 typedef __m64 __cl_char8;
468 typedef __m64 __cl_ushort4;
469 typedef __m64 __cl_short4;
470 typedef __m64 __cl_uint2;
471 typedef __m64 __cl_int2;
472 typedef __m64 __cl_ulong1;
473 typedef __m64 __cl_long1;
474 typedef __m64 __cl_float2;
476 #define __CL_UCHAR8__ 1
477 #define __CL_CHAR8__ 1
478 #define __CL_USHORT4__ 1
479 #define __CL_SHORT4__ 1
480 #define __CL_INT2__ 1
481 #define __CL_UINT2__ 1
482 #define __CL_ULONG1__ 1
483 #define __CL_LONG1__ 1
484 #define __CL_FLOAT2__ 1
487 #if defined( __AVX__ )
488 #if defined( __MINGW64__ )
491 #include <immintrin.h>
493 #if defined( __GNUC__ )
494 typedef cl_float __cl_float8 __attribute__((vector_size(32)));
495 typedef cl_double __cl_double4 __attribute__((vector_size(32)));
497 typedef __m256 __cl_float8;
498 typedef __m256d __cl_double4;
500 #define __CL_FLOAT8__ 1
501 #define __CL_DOUBLE4__ 1
504 /* Define capabilities for anonymous struct members. */
505 #if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
506 #define __CL_HAS_ANON_STRUCT__ 1
507 #define __CL_ANON_STRUCT__ __extension__
508 #elif defined( _WIN32) && (_MSC_VER >= 1500)
509 /* Microsoft Developer Studio 2008 supports anonymous structs, but
510 * complains by default. */
511 #define __CL_HAS_ANON_STRUCT__ 1
512 #define __CL_ANON_STRUCT__
513 /* Disable warning C4201: nonstandard extension used : nameless
515 #pragma warning( push )
516 #pragma warning( disable : 4201 )
518 #define __CL_HAS_ANON_STRUCT__ 0
519 #define __CL_ANON_STRUCT__
522 /* Define alignment keys */
523 #if defined( __GNUC__ )
524 #define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
525 #elif defined( _WIN32) && (_MSC_VER)
526 /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */
527 /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */
528 /* #include <crtdefs.h> */
529 /* #define CL_ALIGNED(_x) _CRT_ALIGN(_x) */
530 #define CL_ALIGNED(_x)
532 #warning Need to implement some method to align data here
533 #define CL_ALIGNED(_x)
536 /* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
537 #if __CL_HAS_ANON_STRUCT__
538 /* .xyzw and .s0123...{f|F} are supported */
539 #define CL_HAS_NAMED_VECTOR_FIELDS 1
540 /* .hi and .lo are supported */
541 #define CL_HAS_HI_LO_VECTOR_FIELDS 1
544 /* Define cl_vector types */
546 /* ---- cl_charn ---- */
549 cl_char CL_ALIGNED(2) s[2];
550 #if __CL_HAS_ANON_STRUCT__
551 __CL_ANON_STRUCT__ struct{ cl_char x, y; };
552 __CL_ANON_STRUCT__ struct{ cl_char s0, s1; };
553 __CL_ANON_STRUCT__ struct{ cl_char lo, hi; };
555 #if defined( __CL_CHAR2__)
562 cl_char CL_ALIGNED(4) s[4];
563 #if __CL_HAS_ANON_STRUCT__
564 __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
565 __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3; };
566 __CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; };
568 #if defined( __CL_CHAR2__)
571 #if defined( __CL_CHAR4__)
576 /* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */
577 typedef cl_char4 cl_char3;
581 cl_char CL_ALIGNED(8) s[8];
582 #if __CL_HAS_ANON_STRUCT__
583 __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
584 __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
585 __CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; };
587 #if defined( __CL_CHAR2__)
590 #if defined( __CL_CHAR4__)
593 #if defined( __CL_CHAR8__ )
600 cl_char CL_ALIGNED(16) s[16];
601 #if __CL_HAS_ANON_STRUCT__
602 __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
603 __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
604 __CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; };
606 #if defined( __CL_CHAR2__)
609 #if defined( __CL_CHAR4__)
612 #if defined( __CL_CHAR8__ )
615 #if defined( __CL_CHAR16__ )
621 /* ---- cl_ucharn ---- */
624 cl_uchar CL_ALIGNED(2) s[2];
625 #if __CL_HAS_ANON_STRUCT__
626 __CL_ANON_STRUCT__ struct{ cl_uchar x, y; };
627 __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1; };
628 __CL_ANON_STRUCT__ struct{ cl_uchar lo, hi; };
630 #if defined( __cl_uchar2__)
637 cl_uchar CL_ALIGNED(4) s[4];
638 #if __CL_HAS_ANON_STRUCT__
639 __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
640 __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3; };
641 __CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; };
643 #if defined( __CL_UCHAR2__)
646 #if defined( __CL_UCHAR4__)
651 /* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */
652 typedef cl_uchar4 cl_uchar3;
656 cl_uchar CL_ALIGNED(8) s[8];
657 #if __CL_HAS_ANON_STRUCT__
658 __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
659 __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
660 __CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; };
662 #if defined( __CL_UCHAR2__)
665 #if defined( __CL_UCHAR4__)
668 #if defined( __CL_UCHAR8__ )
675 cl_uchar CL_ALIGNED(16) s[16];
676 #if __CL_HAS_ANON_STRUCT__
677 __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
678 __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
679 __CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; };
681 #if defined( __CL_UCHAR2__)
684 #if defined( __CL_UCHAR4__)
687 #if defined( __CL_UCHAR8__ )
690 #if defined( __CL_UCHAR16__ )
696 /* ---- cl_shortn ---- */
699 cl_short CL_ALIGNED(4) s[2];
700 #if __CL_HAS_ANON_STRUCT__
701 __CL_ANON_STRUCT__ struct{ cl_short x, y; };
702 __CL_ANON_STRUCT__ struct{ cl_short s0, s1; };
703 __CL_ANON_STRUCT__ struct{ cl_short lo, hi; };
705 #if defined( __CL_SHORT2__)
712 cl_short CL_ALIGNED(8) s[4];
713 #if __CL_HAS_ANON_STRUCT__
714 __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
715 __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3; };
716 __CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; };
718 #if defined( __CL_SHORT2__)
721 #if defined( __CL_SHORT4__)
726 /* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */
727 typedef cl_short4 cl_short3;
731 cl_short CL_ALIGNED(16) s[8];
732 #if __CL_HAS_ANON_STRUCT__
733 __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
734 __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
735 __CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; };
737 #if defined( __CL_SHORT2__)
740 #if defined( __CL_SHORT4__)
743 #if defined( __CL_SHORT8__ )
750 cl_short CL_ALIGNED(32) s[16];
751 #if __CL_HAS_ANON_STRUCT__
752 __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
753 __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
754 __CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; };
756 #if defined( __CL_SHORT2__)
759 #if defined( __CL_SHORT4__)
762 #if defined( __CL_SHORT8__ )
765 #if defined( __CL_SHORT16__ )
771 /* ---- cl_ushortn ---- */
774 cl_ushort CL_ALIGNED(4) s[2];
775 #if __CL_HAS_ANON_STRUCT__
776 __CL_ANON_STRUCT__ struct{ cl_ushort x, y; };
777 __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1; };
778 __CL_ANON_STRUCT__ struct{ cl_ushort lo, hi; };
780 #if defined( __CL_USHORT2__)
787 cl_ushort CL_ALIGNED(8) s[4];
788 #if __CL_HAS_ANON_STRUCT__
789 __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
790 __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3; };
791 __CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; };
793 #if defined( __CL_USHORT2__)
796 #if defined( __CL_USHORT4__)
801 /* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */
802 typedef cl_ushort4 cl_ushort3;
806 cl_ushort CL_ALIGNED(16) s[8];
807 #if __CL_HAS_ANON_STRUCT__
808 __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
809 __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
810 __CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; };
812 #if defined( __CL_USHORT2__)
815 #if defined( __CL_USHORT4__)
818 #if defined( __CL_USHORT8__ )
825 cl_ushort CL_ALIGNED(32) s[16];
826 #if __CL_HAS_ANON_STRUCT__
827 __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
828 __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
829 __CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; };
831 #if defined( __CL_USHORT2__)
834 #if defined( __CL_USHORT4__)
837 #if defined( __CL_USHORT8__ )
840 #if defined( __CL_USHORT16__ )
845 /* ---- cl_intn ---- */
848 cl_int CL_ALIGNED(8) s[2];
849 #if __CL_HAS_ANON_STRUCT__
850 __CL_ANON_STRUCT__ struct{ cl_int x, y; };
851 __CL_ANON_STRUCT__ struct{ cl_int s0, s1; };
852 __CL_ANON_STRUCT__ struct{ cl_int lo, hi; };
854 #if defined( __CL_INT2__)
861 cl_int CL_ALIGNED(16) s[4];
862 #if __CL_HAS_ANON_STRUCT__
863 __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
864 __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3; };
865 __CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; };
867 #if defined( __CL_INT2__)
870 #if defined( __CL_INT4__)
875 /* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */
876 typedef cl_int4 cl_int3;
880 cl_int CL_ALIGNED(32) s[8];
881 #if __CL_HAS_ANON_STRUCT__
882 __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
883 __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
884 __CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; };
886 #if defined( __CL_INT2__)
889 #if defined( __CL_INT4__)
892 #if defined( __CL_INT8__ )
899 cl_int CL_ALIGNED(64) s[16];
900 #if __CL_HAS_ANON_STRUCT__
901 __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
902 __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
903 __CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; };
905 #if defined( __CL_INT2__)
908 #if defined( __CL_INT4__)
911 #if defined( __CL_INT8__ )
914 #if defined( __CL_INT16__ )
920 /* ---- cl_uintn ---- */
923 cl_uint CL_ALIGNED(8) s[2];
924 #if __CL_HAS_ANON_STRUCT__
925 __CL_ANON_STRUCT__ struct{ cl_uint x, y; };
926 __CL_ANON_STRUCT__ struct{ cl_uint s0, s1; };
927 __CL_ANON_STRUCT__ struct{ cl_uint lo, hi; };
929 #if defined( __CL_UINT2__)
936 cl_uint CL_ALIGNED(16) s[4];
937 #if __CL_HAS_ANON_STRUCT__
938 __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
939 __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3; };
940 __CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; };
942 #if defined( __CL_UINT2__)
945 #if defined( __CL_UINT4__)
950 /* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */
951 typedef cl_uint4 cl_uint3;
955 cl_uint CL_ALIGNED(32) s[8];
956 #if __CL_HAS_ANON_STRUCT__
957 __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
958 __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
959 __CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; };
961 #if defined( __CL_UINT2__)
964 #if defined( __CL_UINT4__)
967 #if defined( __CL_UINT8__ )
974 cl_uint CL_ALIGNED(64) s[16];
975 #if __CL_HAS_ANON_STRUCT__
976 __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
977 __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
978 __CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; };
980 #if defined( __CL_UINT2__)
983 #if defined( __CL_UINT4__)
986 #if defined( __CL_UINT8__ )
989 #if defined( __CL_UINT16__ )
994 /* ---- cl_longn ---- */
997 cl_long CL_ALIGNED(16) s[2];
998 #if __CL_HAS_ANON_STRUCT__
999 __CL_ANON_STRUCT__ struct{ cl_long x, y; };
1000 __CL_ANON_STRUCT__ struct{ cl_long s0, s1; };
1001 __CL_ANON_STRUCT__ struct{ cl_long lo, hi; };
1003 #if defined( __CL_LONG2__)
1010 cl_long CL_ALIGNED(32) s[4];
1011 #if __CL_HAS_ANON_STRUCT__
1012 __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
1013 __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3; };
1014 __CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; };
1016 #if defined( __CL_LONG2__)
1019 #if defined( __CL_LONG4__)
1024 /* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */
1025 typedef cl_long4 cl_long3;
1029 cl_long CL_ALIGNED(64) s[8];
1030 #if __CL_HAS_ANON_STRUCT__
1031 __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
1032 __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
1033 __CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; };
1035 #if defined( __CL_LONG2__)
1038 #if defined( __CL_LONG4__)
1041 #if defined( __CL_LONG8__ )
1048 cl_long CL_ALIGNED(128) s[16];
1049 #if __CL_HAS_ANON_STRUCT__
1050 __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1051 __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1052 __CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; };
1054 #if defined( __CL_LONG2__)
1057 #if defined( __CL_LONG4__)
1060 #if defined( __CL_LONG8__ )
1063 #if defined( __CL_LONG16__ )
1069 /* ---- cl_ulongn ---- */
1072 cl_ulong CL_ALIGNED(16) s[2];
1073 #if __CL_HAS_ANON_STRUCT__
1074 __CL_ANON_STRUCT__ struct{ cl_ulong x, y; };
1075 __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1; };
1076 __CL_ANON_STRUCT__ struct{ cl_ulong lo, hi; };
1078 #if defined( __CL_ULONG2__)
1085 cl_ulong CL_ALIGNED(32) s[4];
1086 #if __CL_HAS_ANON_STRUCT__
1087 __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
1088 __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3; };
1089 __CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; };
1091 #if defined( __CL_ULONG2__)
1094 #if defined( __CL_ULONG4__)
1099 /* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */
1100 typedef cl_ulong4 cl_ulong3;
1104 cl_ulong CL_ALIGNED(64) s[8];
1105 #if __CL_HAS_ANON_STRUCT__
1106 __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
1107 __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
1108 __CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; };
1110 #if defined( __CL_ULONG2__)
1113 #if defined( __CL_ULONG4__)
1116 #if defined( __CL_ULONG8__ )
1123 cl_ulong CL_ALIGNED(128) s[16];
1124 #if __CL_HAS_ANON_STRUCT__
1125 __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1126 __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1127 __CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; };
1129 #if defined( __CL_ULONG2__)
1132 #if defined( __CL_ULONG4__)
1135 #if defined( __CL_ULONG8__ )
1138 #if defined( __CL_ULONG16__ )
1144 /* --- cl_floatn ---- */
1148 cl_float CL_ALIGNED(8) s[2];
1149 #if __CL_HAS_ANON_STRUCT__
1150 __CL_ANON_STRUCT__ struct{ cl_float x, y; };
1151 __CL_ANON_STRUCT__ struct{ cl_float s0, s1; };
1152 __CL_ANON_STRUCT__ struct{ cl_float lo, hi; };
1154 #if defined( __CL_FLOAT2__)
1161 cl_float CL_ALIGNED(16) s[4];
1162 #if __CL_HAS_ANON_STRUCT__
1163 __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
1164 __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3; };
1165 __CL_ANON_STRUCT__ struct{ cl_float2 lo, hi; };
1167 #if defined( __CL_FLOAT2__)
1170 #if defined( __CL_FLOAT4__)
1175 /* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */
1176 typedef cl_float4 cl_float3;
1180 cl_float CL_ALIGNED(32) s[8];
1181 #if __CL_HAS_ANON_STRUCT__
1182 __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
1183 __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
1184 __CL_ANON_STRUCT__ struct{ cl_float4 lo, hi; };
1186 #if defined( __CL_FLOAT2__)
1189 #if defined( __CL_FLOAT4__)
1192 #if defined( __CL_FLOAT8__ )
1199 cl_float CL_ALIGNED(64) s[16];
1200 #if __CL_HAS_ANON_STRUCT__
1201 __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1202 __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1203 __CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; };
1205 #if defined( __CL_FLOAT2__)
1208 #if defined( __CL_FLOAT4__)
1211 #if defined( __CL_FLOAT8__ )
1214 #if defined( __CL_FLOAT16__ )
1219 /* --- cl_doublen ---- */
1223 cl_double CL_ALIGNED(16) s[2];
1224 #if __CL_HAS_ANON_STRUCT__
1225 __CL_ANON_STRUCT__ struct{ cl_double x, y; };
1226 __CL_ANON_STRUCT__ struct{ cl_double s0, s1; };
1227 __CL_ANON_STRUCT__ struct{ cl_double lo, hi; };
1229 #if defined( __CL_DOUBLE2__)
1236 cl_double CL_ALIGNED(32) s[4];
1237 #if __CL_HAS_ANON_STRUCT__
1238 __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
1239 __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3; };
1240 __CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; };
1242 #if defined( __CL_DOUBLE2__)
1245 #if defined( __CL_DOUBLE4__)
1250 /* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */
1251 typedef cl_double4 cl_double3;
1255 cl_double CL_ALIGNED(64) s[8];
1256 #if __CL_HAS_ANON_STRUCT__
1257 __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
1258 __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
1259 __CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; };
1261 #if defined( __CL_DOUBLE2__)
1264 #if defined( __CL_DOUBLE4__)
1267 #if defined( __CL_DOUBLE8__ )
1274 cl_double CL_ALIGNED(128) s[16];
1275 #if __CL_HAS_ANON_STRUCT__
1276 __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
1277 __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
1278 __CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; };
1280 #if defined( __CL_DOUBLE2__)
1283 #if defined( __CL_DOUBLE4__)
1286 #if defined( __CL_DOUBLE8__ )
1289 #if defined( __CL_DOUBLE16__ )
1294 /* Macro to facilitate debugging
1296 * Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source.
1297 * The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \"
1298 * Each line thereafter of OpenCL C source must end with: \n\
1299 * The last line ends in ";
1303 * const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
1304 * kernel void foo( int a, float * b ) \n\
1307 * *b[ get_global_id(0)] = a; \n\
1311 * This should correctly set up the line, (column) and file information for your source
1312 * string so you can do source level debugging.
1314 #define __CL_STRINGIFY( _x ) # _x
1315 #define _CL_STRINGIFY( _x ) __CL_STRINGIFY( _x )
1316 #define CL_PROGRAM_STRING_DEBUG_INFO "#line " _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n"
1322 #undef __CL_HAS_ANON_STRUCT__
1323 #undef __CL_ANON_STRUCT__
1324 #if defined( _WIN32) && (_MSC_VER >= 1500)
1325 #pragma warning( pop )
1328 #endif /* __CL_PLATFORM_H */