1 /**********************************************************************************
2 * Copyright (c) 2008-2018 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 * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16 * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17 * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18 * https://www.khronos.org/registry/
20 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 **********************************************************************************/
29 #ifndef __CL_PLATFORM_H
30 #define __CL_PLATFORM_H
32 #include <CL/cl_version.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.
56 #define CL_EXTENSION_WEAK_LINK
57 #define CL_API_SUFFIX__VERSION_1_0
58 #define CL_EXT_SUFFIX__VERSION_1_0
59 #define CL_API_SUFFIX__VERSION_1_1
60 #define CL_EXT_SUFFIX__VERSION_1_1
61 #define CL_API_SUFFIX__VERSION_1_2
62 #define CL_EXT_SUFFIX__VERSION_1_2
63 #define CL_API_SUFFIX__VERSION_2_0
64 #define CL_EXT_SUFFIX__VERSION_2_0
65 #define CL_API_SUFFIX__VERSION_2_1
66 #define CL_EXT_SUFFIX__VERSION_2_1
67 #define CL_API_SUFFIX__VERSION_2_2
68 #define CL_EXT_SUFFIX__VERSION_2_2
71 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
72 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
73 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
75 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated))
76 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
79 #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
80 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
81 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
83 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
84 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
87 #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS
88 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
89 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
91 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED __attribute__((deprecated))
92 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
95 #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS
96 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
97 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
99 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED __attribute__((deprecated))
100 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
103 #ifdef CL_USE_DEPRECATED_OPENCL_2_1_APIS
104 #define CL_EXT_SUFFIX__VERSION_2_1_DEPRECATED
105 #define CL_EXT_PREFIX__VERSION_2_1_DEPRECATED
107 #define CL_EXT_SUFFIX__VERSION_2_1_DEPRECATED __attribute__((deprecated))
108 #define CL_EXT_PREFIX__VERSION_2_1_DEPRECATED
110 #elif defined(_WIN32)
111 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
112 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
113 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
115 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
116 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated)
119 #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
120 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
121 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
123 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
124 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated)
127 #ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS
128 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
129 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
131 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
132 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED __declspec(deprecated)
135 #ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS
136 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
137 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
139 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
140 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED __declspec(deprecated)
143 #ifdef CL_USE_DEPRECATED_OPENCL_2_1_APIS
144 #define CL_EXT_SUFFIX__VERSION_2_1_DEPRECATED
145 #define CL_EXT_PREFIX__VERSION_2_1_DEPRECATED
147 #define CL_EXT_SUFFIX__VERSION_2_1_DEPRECATED
148 #define CL_EXT_PREFIX__VERSION_2_1_DEPRECATED __declspec(deprecated)
151 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
152 #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
154 #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
155 #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
157 #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
158 #define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
160 #define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
161 #define CL_EXT_PREFIX__VERSION_2_0_DEPRECATED
163 #define CL_EXT_SUFFIX__VERSION_2_1_DEPRECATED
164 #define CL_EXT_PREFIX__VERSION_2_1_DEPRECATED
167 #if (defined (_WIN32) && defined(_MSC_VER))
170 typedef signed __int8 cl_char
;
171 typedef unsigned __int8 cl_uchar
;
172 typedef signed __int16 cl_short
;
173 typedef unsigned __int16 cl_ushort
;
174 typedef signed __int32 cl_int
;
175 typedef unsigned __int32 cl_uint
;
176 typedef signed __int64 cl_long
;
177 typedef unsigned __int64 cl_ulong
;
179 typedef unsigned __int16 cl_half
;
180 typedef float cl_float
;
181 typedef double cl_double
;
183 /* Macro names and corresponding values defined by OpenCL */
184 #define CL_CHAR_BIT 8
185 #define CL_SCHAR_MAX 127
186 #define CL_SCHAR_MIN (-127-1)
187 #define CL_CHAR_MAX CL_SCHAR_MAX
188 #define CL_CHAR_MIN CL_SCHAR_MIN
189 #define CL_UCHAR_MAX 255
190 #define CL_SHRT_MAX 32767
191 #define CL_SHRT_MIN (-32767-1)
192 #define CL_USHRT_MAX 65535
193 #define CL_INT_MAX 2147483647
194 #define CL_INT_MIN (-2147483647-1)
195 #define CL_UINT_MAX 0xffffffffU
196 #define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
197 #define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
198 #define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
201 #define CL_FLT_MANT_DIG 24
202 #define CL_FLT_MAX_10_EXP +38
203 #define CL_FLT_MAX_EXP +128
204 #define CL_FLT_MIN_10_EXP -37
205 #define CL_FLT_MIN_EXP -125
206 #define CL_FLT_RADIX 2
207 #define CL_FLT_MAX 340282346638528859811704183484516925440.0f
208 #define CL_FLT_MIN 1.175494350822287507969e-38f
209 #define CL_FLT_EPSILON 1.1920928955078125e-7f
211 #define CL_HALF_DIG 3
212 #define CL_HALF_MANT_DIG 11
213 #define CL_HALF_MAX_10_EXP +4
214 #define CL_HALF_MAX_EXP +16
215 #define CL_HALF_MIN_10_EXP -4
216 #define CL_HALF_MIN_EXP -13
217 #define CL_HALF_RADIX 2
218 #define CL_HALF_MAX 65504.0f
219 #define CL_HALF_MIN 6.103515625e-05f
220 #define CL_HALF_EPSILON 9.765625e-04f
222 #define CL_DBL_DIG 15
223 #define CL_DBL_MANT_DIG 53
224 #define CL_DBL_MAX_10_EXP +308
225 #define CL_DBL_MAX_EXP +1024
226 #define CL_DBL_MIN_10_EXP -307
227 #define CL_DBL_MIN_EXP -1021
228 #define CL_DBL_RADIX 2
229 #define CL_DBL_MAX 1.7976931348623158e+308
230 #define CL_DBL_MIN 2.225073858507201383090e-308
231 #define CL_DBL_EPSILON 2.220446049250313080847e-16
233 #define CL_M_E 2.7182818284590452354
234 #define CL_M_LOG2E 1.4426950408889634074
235 #define CL_M_LOG10E 0.43429448190325182765
236 #define CL_M_LN2 0.69314718055994530942
237 #define CL_M_LN10 2.30258509299404568402
238 #define CL_M_PI 3.14159265358979323846
239 #define CL_M_PI_2 1.57079632679489661923
240 #define CL_M_PI_4 0.78539816339744830962
241 #define CL_M_1_PI 0.31830988618379067154
242 #define CL_M_2_PI 0.63661977236758134308
243 #define CL_M_2_SQRTPI 1.12837916709551257390
244 #define CL_M_SQRT2 1.41421356237309504880
245 #define CL_M_SQRT1_2 0.70710678118654752440
247 #define CL_M_E_F 2.718281828f
248 #define CL_M_LOG2E_F 1.442695041f
249 #define CL_M_LOG10E_F 0.434294482f
250 #define CL_M_LN2_F 0.693147181f
251 #define CL_M_LN10_F 2.302585093f
252 #define CL_M_PI_F 3.141592654f
253 #define CL_M_PI_2_F 1.570796327f
254 #define CL_M_PI_4_F 0.785398163f
255 #define CL_M_1_PI_F 0.318309886f
256 #define CL_M_2_PI_F 0.636619772f
257 #define CL_M_2_SQRTPI_F 1.128379167f
258 #define CL_M_SQRT2_F 1.414213562f
259 #define CL_M_SQRT1_2_F 0.707106781f
261 #define CL_NAN (CL_INFINITY - CL_INFINITY)
262 #define CL_HUGE_VALF ((cl_float) 1e50)
263 #define CL_HUGE_VAL ((cl_double) 1e500)
264 #define CL_MAXFLOAT CL_FLT_MAX
265 #define CL_INFINITY CL_HUGE_VALF
272 typedef int8_t cl_char
;
273 typedef uint8_t cl_uchar
;
274 typedef int16_t cl_short
__attribute__((aligned(2)));
275 typedef uint16_t cl_ushort
__attribute__((aligned(2)));
276 typedef int32_t cl_int
__attribute__((aligned(4)));
277 typedef uint32_t cl_uint
__attribute__((aligned(4)));
278 typedef int64_t cl_long
__attribute__((aligned(8)));
279 typedef uint64_t cl_ulong
__attribute__((aligned(8)));
281 typedef uint16_t cl_half
__attribute__((aligned(2)));
282 typedef float cl_float
__attribute__((aligned(4)));
283 typedef double cl_double
__attribute__((aligned(8)));
285 /* Macro names and corresponding values defined by OpenCL */
286 #define CL_CHAR_BIT 8
287 #define CL_SCHAR_MAX 127
288 #define CL_SCHAR_MIN (-127-1)
289 #define CL_CHAR_MAX CL_SCHAR_MAX
290 #define CL_CHAR_MIN CL_SCHAR_MIN
291 #define CL_UCHAR_MAX 255
292 #define CL_SHRT_MAX 32767
293 #define CL_SHRT_MIN (-32767-1)
294 #define CL_USHRT_MAX 65535
295 #define CL_INT_MAX 2147483647
296 #define CL_INT_MIN (-2147483647-1)
297 #define CL_UINT_MAX 0xffffffffU
298 #define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
299 #define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
300 #define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
303 #define CL_FLT_MANT_DIG 24
304 #define CL_FLT_MAX_10_EXP +38
305 #define CL_FLT_MAX_EXP +128
306 #define CL_FLT_MIN_10_EXP -37
307 #define CL_FLT_MIN_EXP -125
308 #define CL_FLT_RADIX 2
309 #define CL_FLT_MAX 340282346638528859811704183484516925440.0f
310 #define CL_FLT_MIN 1.175494350822287507969e-38f
311 #define CL_FLT_EPSILON 1.1920928955078125e-7f
313 #define CL_HALF_DIG 3
314 #define CL_HALF_MANT_DIG 11
315 #define CL_HALF_MAX_10_EXP +4
316 #define CL_HALF_MAX_EXP +16
317 #define CL_HALF_MIN_10_EXP -4
318 #define CL_HALF_MIN_EXP -13
319 #define CL_HALF_RADIX 2
320 #define CL_HALF_MAX 65504.0f
321 #define CL_HALF_MIN 6.103515625e-05f
322 #define CL_HALF_EPSILON 9.765625e-04f
324 #define CL_DBL_DIG 15
325 #define CL_DBL_MANT_DIG 53
326 #define CL_DBL_MAX_10_EXP +308
327 #define CL_DBL_MAX_EXP +1024
328 #define CL_DBL_MIN_10_EXP -307
329 #define CL_DBL_MIN_EXP -1021
330 #define CL_DBL_RADIX 2
331 #define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
332 #define CL_DBL_MIN 2.225073858507201383090e-308
333 #define CL_DBL_EPSILON 2.220446049250313080847e-16
335 #define CL_M_E 2.7182818284590452354
336 #define CL_M_LOG2E 1.4426950408889634074
337 #define CL_M_LOG10E 0.43429448190325182765
338 #define CL_M_LN2 0.69314718055994530942
339 #define CL_M_LN10 2.30258509299404568402
340 #define CL_M_PI 3.14159265358979323846
341 #define CL_M_PI_2 1.57079632679489661923
342 #define CL_M_PI_4 0.78539816339744830962
343 #define CL_M_1_PI 0.31830988618379067154
344 #define CL_M_2_PI 0.63661977236758134308
345 #define CL_M_2_SQRTPI 1.12837916709551257390
346 #define CL_M_SQRT2 1.41421356237309504880
347 #define CL_M_SQRT1_2 0.70710678118654752440
349 #define CL_M_E_F 2.718281828f
350 #define CL_M_LOG2E_F 1.442695041f
351 #define CL_M_LOG10E_F 0.434294482f
352 #define CL_M_LN2_F 0.693147181f
353 #define CL_M_LN10_F 2.302585093f
354 #define CL_M_PI_F 3.141592654f
355 #define CL_M_PI_2_F 1.570796327f
356 #define CL_M_PI_4_F 0.785398163f
357 #define CL_M_1_PI_F 0.318309886f
358 #define CL_M_2_PI_F 0.636619772f
359 #define CL_M_2_SQRTPI_F 1.128379167f
360 #define CL_M_SQRT2_F 1.414213562f
361 #define CL_M_SQRT1_2_F 0.707106781f
363 #if defined( __GNUC__ )
364 #define CL_HUGE_VALF __builtin_huge_valf()
365 #define CL_HUGE_VAL __builtin_huge_val()
366 #define CL_NAN __builtin_nanf( "" )
368 #define CL_HUGE_VALF ((cl_float) 1e50)
369 #define CL_HUGE_VAL ((cl_double) 1e500)
370 float nanf( const char * );
371 #define CL_NAN nanf( "" )
373 #define CL_MAXFLOAT CL_FLT_MAX
374 #define CL_INFINITY CL_HUGE_VALF
380 /* 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. */
381 typedef unsigned int cl_GLuint
;
382 typedef int cl_GLint
;
383 typedef unsigned int cl_GLenum
;
388 * Note: OpenCL requires that all types be naturally aligned.
389 * This means that vector types must be naturally aligned.
390 * For example, a vector of four floats must be aligned to
391 * a 16 byte boundary (calculated as 4 * the natural 4-byte
392 * alignment of the float). The alignment qualifiers here
393 * will only function properly if your compiler supports them
394 * and if you don't actively work to defeat them. For example,
395 * in order for a cl_float4 to be 16 byte aligned in a struct,
396 * the start of the struct must itself be 16-byte aligned.
398 * Maintaining proper alignment is the user's responsibility.
401 /* Define basic vector types */
402 #if defined( __VEC__ )
403 #include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
404 typedef __vector
unsigned char __cl_uchar16
;
405 typedef __vector
signed char __cl_char16
;
406 typedef __vector
unsigned short __cl_ushort8
;
407 typedef __vector
signed short __cl_short8
;
408 typedef __vector
unsigned int __cl_uint4
;
409 typedef __vector
signed int __cl_int4
;
410 typedef __vector
float __cl_float4
;
411 #define __CL_UCHAR16__ 1
412 #define __CL_CHAR16__ 1
413 #define __CL_USHORT8__ 1
414 #define __CL_SHORT8__ 1
415 #define __CL_UINT4__ 1
416 #define __CL_INT4__ 1
417 #define __CL_FLOAT4__ 1
420 #if defined( __SSE__ )
421 #if defined( __MINGW64__ )
424 #include <xmmintrin.h>
426 #if defined( __GNUC__ )
427 typedef float __cl_float4
__attribute__((vector_size(16)));
429 typedef __m128 __cl_float4
;
431 #define __CL_FLOAT4__ 1
434 #if defined( __SSE2__ )
435 #if defined( __MINGW64__ )
438 #include <emmintrin.h>
440 #if defined( __GNUC__ )
441 typedef cl_uchar __cl_uchar16
__attribute__((vector_size(16)));
442 typedef cl_char __cl_char16
__attribute__((vector_size(16)));
443 typedef cl_ushort __cl_ushort8
__attribute__((vector_size(16)));
444 typedef cl_short __cl_short8
__attribute__((vector_size(16)));
445 typedef cl_uint __cl_uint4
__attribute__((vector_size(16)));
446 typedef cl_int __cl_int4
__attribute__((vector_size(16)));
447 typedef cl_ulong __cl_ulong2
__attribute__((vector_size(16)));
448 typedef cl_long __cl_long2
__attribute__((vector_size(16)));
449 typedef cl_double __cl_double2
__attribute__((vector_size(16)));
451 typedef __m128i __cl_uchar16
;
452 typedef __m128i __cl_char16
;
453 typedef __m128i __cl_ushort8
;
454 typedef __m128i __cl_short8
;
455 typedef __m128i __cl_uint4
;
456 typedef __m128i __cl_int4
;
457 typedef __m128i __cl_ulong2
;
458 typedef __m128i __cl_long2
;
459 typedef __m128d __cl_double2
;
461 #define __CL_UCHAR16__ 1
462 #define __CL_CHAR16__ 1
463 #define __CL_USHORT8__ 1
464 #define __CL_SHORT8__ 1
465 #define __CL_INT4__ 1
466 #define __CL_UINT4__ 1
467 #define __CL_ULONG2__ 1
468 #define __CL_LONG2__ 1
469 #define __CL_DOUBLE2__ 1
472 #if defined( __MMX__ )
473 #include <mmintrin.h>
474 #if defined( __GNUC__ )
475 typedef cl_uchar __cl_uchar8
__attribute__((vector_size(8)));
476 typedef cl_char __cl_char8
__attribute__((vector_size(8)));
477 typedef cl_ushort __cl_ushort4
__attribute__((vector_size(8)));
478 typedef cl_short __cl_short4
__attribute__((vector_size(8)));
479 typedef cl_uint __cl_uint2
__attribute__((vector_size(8)));
480 typedef cl_int __cl_int2
__attribute__((vector_size(8)));
481 typedef cl_ulong __cl_ulong1
__attribute__((vector_size(8)));
482 typedef cl_long __cl_long1
__attribute__((vector_size(8)));
483 typedef cl_float __cl_float2
__attribute__((vector_size(8)));
485 typedef __m64 __cl_uchar8
;
486 typedef __m64 __cl_char8
;
487 typedef __m64 __cl_ushort4
;
488 typedef __m64 __cl_short4
;
489 typedef __m64 __cl_uint2
;
490 typedef __m64 __cl_int2
;
491 typedef __m64 __cl_ulong1
;
492 typedef __m64 __cl_long1
;
493 typedef __m64 __cl_float2
;
495 #define __CL_UCHAR8__ 1
496 #define __CL_CHAR8__ 1
497 #define __CL_USHORT4__ 1
498 #define __CL_SHORT4__ 1
499 #define __CL_INT2__ 1
500 #define __CL_UINT2__ 1
501 #define __CL_ULONG1__ 1
502 #define __CL_LONG1__ 1
503 #define __CL_FLOAT2__ 1
506 #if defined( __AVX__ )
507 #if defined( __MINGW64__ )
510 #include <immintrin.h>
512 #if defined( __GNUC__ )
513 typedef cl_float __cl_float8
__attribute__((vector_size(32)));
514 typedef cl_double __cl_double4
__attribute__((vector_size(32)));
516 typedef __m256 __cl_float8
;
517 typedef __m256d __cl_double4
;
519 #define __CL_FLOAT8__ 1
520 #define __CL_DOUBLE4__ 1
523 /* Define capabilities for anonymous struct members. */
524 #if !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
525 #define __CL_HAS_ANON_STRUCT__ 1
526 #define __CL_ANON_STRUCT__
527 #elif defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
528 #define __CL_HAS_ANON_STRUCT__ 1
529 #define __CL_ANON_STRUCT__ __extension__
530 #elif defined( _WIN32) && defined(_MSC_VER)
532 /* Microsoft Developer Studio 2008 supports anonymous structs, but
533 * complains by default. */
534 #define __CL_HAS_ANON_STRUCT__ 1
535 #define __CL_ANON_STRUCT__
536 /* Disable warning C4201: nonstandard extension used : nameless
538 #pragma warning( push )
539 #pragma warning( disable : 4201 )
542 #define __CL_HAS_ANON_STRUCT__ 0
543 #define __CL_ANON_STRUCT__
546 /* Define alignment keys */
547 #if defined( __GNUC__ )
548 #define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
549 #elif defined( _WIN32) && (_MSC_VER)
550 /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */
551 /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */
552 /* #include <crtdefs.h> */
553 /* #define CL_ALIGNED(_x) _CRT_ALIGN(_x) */
554 #define CL_ALIGNED(_x)
556 #warning Need to implement some method to align data here
557 #define CL_ALIGNED(_x)
560 /* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
561 #if __CL_HAS_ANON_STRUCT__
562 /* .xyzw and .s0123...{f|F} are supported */
563 #define CL_HAS_NAMED_VECTOR_FIELDS 1
564 /* .hi and .lo are supported */
565 #define CL_HAS_HI_LO_VECTOR_FIELDS 1
568 /* Define cl_vector types */
570 /* ---- cl_charn ---- */
573 cl_char
CL_ALIGNED(2) s
[2];
574 #if __CL_HAS_ANON_STRUCT__
575 __CL_ANON_STRUCT__
struct{ cl_char x
, y
; };
576 __CL_ANON_STRUCT__
struct{ cl_char s0
, s1
; };
577 __CL_ANON_STRUCT__
struct{ cl_char lo
, hi
; };
579 #if defined( __CL_CHAR2__)
586 cl_char
CL_ALIGNED(4) s
[4];
587 #if __CL_HAS_ANON_STRUCT__
588 __CL_ANON_STRUCT__
struct{ cl_char x
, y
, z
, w
; };
589 __CL_ANON_STRUCT__
struct{ cl_char s0
, s1
, s2
, s3
; };
590 __CL_ANON_STRUCT__
struct{ cl_char2 lo
, hi
; };
592 #if defined( __CL_CHAR2__)
595 #if defined( __CL_CHAR4__)
600 /* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */
601 typedef cl_char4 cl_char3
;
605 cl_char
CL_ALIGNED(8) s
[8];
606 #if __CL_HAS_ANON_STRUCT__
607 __CL_ANON_STRUCT__
struct{ cl_char x
, y
, z
, w
; };
608 __CL_ANON_STRUCT__
struct{ cl_char s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
609 __CL_ANON_STRUCT__
struct{ cl_char4 lo
, hi
; };
611 #if defined( __CL_CHAR2__)
614 #if defined( __CL_CHAR4__)
617 #if defined( __CL_CHAR8__ )
624 cl_char
CL_ALIGNED(16) s
[16];
625 #if __CL_HAS_ANON_STRUCT__
626 __CL_ANON_STRUCT__
struct{ cl_char x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
627 __CL_ANON_STRUCT__
struct{ cl_char s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
628 __CL_ANON_STRUCT__
struct{ cl_char8 lo
, hi
; };
630 #if defined( __CL_CHAR2__)
633 #if defined( __CL_CHAR4__)
636 #if defined( __CL_CHAR8__ )
639 #if defined( __CL_CHAR16__ )
645 /* ---- cl_ucharn ---- */
648 cl_uchar
CL_ALIGNED(2) s
[2];
649 #if __CL_HAS_ANON_STRUCT__
650 __CL_ANON_STRUCT__
struct{ cl_uchar x
, y
; };
651 __CL_ANON_STRUCT__
struct{ cl_uchar s0
, s1
; };
652 __CL_ANON_STRUCT__
struct{ cl_uchar lo
, hi
; };
654 #if defined( __cl_uchar2__)
661 cl_uchar
CL_ALIGNED(4) s
[4];
662 #if __CL_HAS_ANON_STRUCT__
663 __CL_ANON_STRUCT__
struct{ cl_uchar x
, y
, z
, w
; };
664 __CL_ANON_STRUCT__
struct{ cl_uchar s0
, s1
, s2
, s3
; };
665 __CL_ANON_STRUCT__
struct{ cl_uchar2 lo
, hi
; };
667 #if defined( __CL_UCHAR2__)
670 #if defined( __CL_UCHAR4__)
675 /* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */
676 typedef cl_uchar4 cl_uchar3
;
680 cl_uchar
CL_ALIGNED(8) s
[8];
681 #if __CL_HAS_ANON_STRUCT__
682 __CL_ANON_STRUCT__
struct{ cl_uchar x
, y
, z
, w
; };
683 __CL_ANON_STRUCT__
struct{ cl_uchar s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
684 __CL_ANON_STRUCT__
struct{ cl_uchar4 lo
, hi
; };
686 #if defined( __CL_UCHAR2__)
689 #if defined( __CL_UCHAR4__)
692 #if defined( __CL_UCHAR8__ )
699 cl_uchar
CL_ALIGNED(16) s
[16];
700 #if __CL_HAS_ANON_STRUCT__
701 __CL_ANON_STRUCT__
struct{ cl_uchar x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
702 __CL_ANON_STRUCT__
struct{ cl_uchar s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
703 __CL_ANON_STRUCT__
struct{ cl_uchar8 lo
, hi
; };
705 #if defined( __CL_UCHAR2__)
708 #if defined( __CL_UCHAR4__)
711 #if defined( __CL_UCHAR8__ )
714 #if defined( __CL_UCHAR16__ )
720 /* ---- cl_shortn ---- */
723 cl_short
CL_ALIGNED(4) s
[2];
724 #if __CL_HAS_ANON_STRUCT__
725 __CL_ANON_STRUCT__
struct{ cl_short x
, y
; };
726 __CL_ANON_STRUCT__
struct{ cl_short s0
, s1
; };
727 __CL_ANON_STRUCT__
struct{ cl_short lo
, hi
; };
729 #if defined( __CL_SHORT2__)
736 cl_short
CL_ALIGNED(8) s
[4];
737 #if __CL_HAS_ANON_STRUCT__
738 __CL_ANON_STRUCT__
struct{ cl_short x
, y
, z
, w
; };
739 __CL_ANON_STRUCT__
struct{ cl_short s0
, s1
, s2
, s3
; };
740 __CL_ANON_STRUCT__
struct{ cl_short2 lo
, hi
; };
742 #if defined( __CL_SHORT2__)
745 #if defined( __CL_SHORT4__)
750 /* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */
751 typedef cl_short4 cl_short3
;
755 cl_short
CL_ALIGNED(16) s
[8];
756 #if __CL_HAS_ANON_STRUCT__
757 __CL_ANON_STRUCT__
struct{ cl_short x
, y
, z
, w
; };
758 __CL_ANON_STRUCT__
struct{ cl_short s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
759 __CL_ANON_STRUCT__
struct{ cl_short4 lo
, hi
; };
761 #if defined( __CL_SHORT2__)
764 #if defined( __CL_SHORT4__)
767 #if defined( __CL_SHORT8__ )
774 cl_short
CL_ALIGNED(32) s
[16];
775 #if __CL_HAS_ANON_STRUCT__
776 __CL_ANON_STRUCT__
struct{ cl_short x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
777 __CL_ANON_STRUCT__
struct{ cl_short s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
778 __CL_ANON_STRUCT__
struct{ cl_short8 lo
, hi
; };
780 #if defined( __CL_SHORT2__)
783 #if defined( __CL_SHORT4__)
786 #if defined( __CL_SHORT8__ )
789 #if defined( __CL_SHORT16__ )
795 /* ---- cl_ushortn ---- */
798 cl_ushort
CL_ALIGNED(4) s
[2];
799 #if __CL_HAS_ANON_STRUCT__
800 __CL_ANON_STRUCT__
struct{ cl_ushort x
, y
; };
801 __CL_ANON_STRUCT__
struct{ cl_ushort s0
, s1
; };
802 __CL_ANON_STRUCT__
struct{ cl_ushort lo
, hi
; };
804 #if defined( __CL_USHORT2__)
811 cl_ushort
CL_ALIGNED(8) s
[4];
812 #if __CL_HAS_ANON_STRUCT__
813 __CL_ANON_STRUCT__
struct{ cl_ushort x
, y
, z
, w
; };
814 __CL_ANON_STRUCT__
struct{ cl_ushort s0
, s1
, s2
, s3
; };
815 __CL_ANON_STRUCT__
struct{ cl_ushort2 lo
, hi
; };
817 #if defined( __CL_USHORT2__)
820 #if defined( __CL_USHORT4__)
825 /* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */
826 typedef cl_ushort4 cl_ushort3
;
830 cl_ushort
CL_ALIGNED(16) s
[8];
831 #if __CL_HAS_ANON_STRUCT__
832 __CL_ANON_STRUCT__
struct{ cl_ushort x
, y
, z
, w
; };
833 __CL_ANON_STRUCT__
struct{ cl_ushort s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
834 __CL_ANON_STRUCT__
struct{ cl_ushort4 lo
, hi
; };
836 #if defined( __CL_USHORT2__)
839 #if defined( __CL_USHORT4__)
842 #if defined( __CL_USHORT8__ )
849 cl_ushort
CL_ALIGNED(32) s
[16];
850 #if __CL_HAS_ANON_STRUCT__
851 __CL_ANON_STRUCT__
struct{ cl_ushort x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
852 __CL_ANON_STRUCT__
struct{ cl_ushort s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
853 __CL_ANON_STRUCT__
struct{ cl_ushort8 lo
, hi
; };
855 #if defined( __CL_USHORT2__)
858 #if defined( __CL_USHORT4__)
861 #if defined( __CL_USHORT8__ )
864 #if defined( __CL_USHORT16__ )
870 /* ---- cl_halfn ---- */
873 cl_half
CL_ALIGNED(4) s
[2];
874 #if __CL_HAS_ANON_STRUCT__
875 __CL_ANON_STRUCT__
struct{ cl_half x
, y
; };
876 __CL_ANON_STRUCT__
struct{ cl_half s0
, s1
; };
877 __CL_ANON_STRUCT__
struct{ cl_half lo
, hi
; };
879 #if defined( __CL_HALF2__)
886 cl_half
CL_ALIGNED(8) s
[4];
887 #if __CL_HAS_ANON_STRUCT__
888 __CL_ANON_STRUCT__
struct{ cl_half x
, y
, z
, w
; };
889 __CL_ANON_STRUCT__
struct{ cl_half s0
, s1
, s2
, s3
; };
890 __CL_ANON_STRUCT__
struct{ cl_half2 lo
, hi
; };
892 #if defined( __CL_HALF2__)
895 #if defined( __CL_HALF4__)
900 /* cl_half3 is identical in size, alignment and behavior to cl_half4. See section 6.1.5. */
901 typedef cl_half4 cl_half3
;
905 cl_half
CL_ALIGNED(16) s
[8];
906 #if __CL_HAS_ANON_STRUCT__
907 __CL_ANON_STRUCT__
struct{ cl_half x
, y
, z
, w
; };
908 __CL_ANON_STRUCT__
struct{ cl_half s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
909 __CL_ANON_STRUCT__
struct{ cl_half4 lo
, hi
; };
911 #if defined( __CL_HALF2__)
914 #if defined( __CL_HALF4__)
917 #if defined( __CL_HALF8__ )
924 cl_half
CL_ALIGNED(32) s
[16];
925 #if __CL_HAS_ANON_STRUCT__
926 __CL_ANON_STRUCT__
struct{ cl_half x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
927 __CL_ANON_STRUCT__
struct{ cl_half s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
928 __CL_ANON_STRUCT__
struct{ cl_half8 lo
, hi
; };
930 #if defined( __CL_HALF2__)
933 #if defined( __CL_HALF4__)
936 #if defined( __CL_HALF8__ )
939 #if defined( __CL_HALF16__ )
944 /* ---- cl_intn ---- */
947 cl_int
CL_ALIGNED(8) s
[2];
948 #if __CL_HAS_ANON_STRUCT__
949 __CL_ANON_STRUCT__
struct{ cl_int x
, y
; };
950 __CL_ANON_STRUCT__
struct{ cl_int s0
, s1
; };
951 __CL_ANON_STRUCT__
struct{ cl_int lo
, hi
; };
953 #if defined( __CL_INT2__)
960 cl_int
CL_ALIGNED(16) s
[4];
961 #if __CL_HAS_ANON_STRUCT__
962 __CL_ANON_STRUCT__
struct{ cl_int x
, y
, z
, w
; };
963 __CL_ANON_STRUCT__
struct{ cl_int s0
, s1
, s2
, s3
; };
964 __CL_ANON_STRUCT__
struct{ cl_int2 lo
, hi
; };
966 #if defined( __CL_INT2__)
969 #if defined( __CL_INT4__)
974 /* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */
975 typedef cl_int4 cl_int3
;
979 cl_int
CL_ALIGNED(32) s
[8];
980 #if __CL_HAS_ANON_STRUCT__
981 __CL_ANON_STRUCT__
struct{ cl_int x
, y
, z
, w
; };
982 __CL_ANON_STRUCT__
struct{ cl_int s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
983 __CL_ANON_STRUCT__
struct{ cl_int4 lo
, hi
; };
985 #if defined( __CL_INT2__)
988 #if defined( __CL_INT4__)
991 #if defined( __CL_INT8__ )
998 cl_int
CL_ALIGNED(64) s
[16];
999 #if __CL_HAS_ANON_STRUCT__
1000 __CL_ANON_STRUCT__
struct{ cl_int x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
1001 __CL_ANON_STRUCT__
struct{ cl_int s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
1002 __CL_ANON_STRUCT__
struct{ cl_int8 lo
, hi
; };
1004 #if defined( __CL_INT2__)
1007 #if defined( __CL_INT4__)
1010 #if defined( __CL_INT8__ )
1013 #if defined( __CL_INT16__ )
1019 /* ---- cl_uintn ---- */
1022 cl_uint
CL_ALIGNED(8) s
[2];
1023 #if __CL_HAS_ANON_STRUCT__
1024 __CL_ANON_STRUCT__
struct{ cl_uint x
, y
; };
1025 __CL_ANON_STRUCT__
struct{ cl_uint s0
, s1
; };
1026 __CL_ANON_STRUCT__
struct{ cl_uint lo
, hi
; };
1028 #if defined( __CL_UINT2__)
1035 cl_uint
CL_ALIGNED(16) s
[4];
1036 #if __CL_HAS_ANON_STRUCT__
1037 __CL_ANON_STRUCT__
struct{ cl_uint x
, y
, z
, w
; };
1038 __CL_ANON_STRUCT__
struct{ cl_uint s0
, s1
, s2
, s3
; };
1039 __CL_ANON_STRUCT__
struct{ cl_uint2 lo
, hi
; };
1041 #if defined( __CL_UINT2__)
1044 #if defined( __CL_UINT4__)
1049 /* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */
1050 typedef cl_uint4 cl_uint3
;
1054 cl_uint
CL_ALIGNED(32) s
[8];
1055 #if __CL_HAS_ANON_STRUCT__
1056 __CL_ANON_STRUCT__
struct{ cl_uint x
, y
, z
, w
; };
1057 __CL_ANON_STRUCT__
struct{ cl_uint s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
1058 __CL_ANON_STRUCT__
struct{ cl_uint4 lo
, hi
; };
1060 #if defined( __CL_UINT2__)
1063 #if defined( __CL_UINT4__)
1066 #if defined( __CL_UINT8__ )
1073 cl_uint
CL_ALIGNED(64) s
[16];
1074 #if __CL_HAS_ANON_STRUCT__
1075 __CL_ANON_STRUCT__
struct{ cl_uint x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
1076 __CL_ANON_STRUCT__
struct{ cl_uint s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
1077 __CL_ANON_STRUCT__
struct{ cl_uint8 lo
, hi
; };
1079 #if defined( __CL_UINT2__)
1082 #if defined( __CL_UINT4__)
1085 #if defined( __CL_UINT8__ )
1088 #if defined( __CL_UINT16__ )
1093 /* ---- cl_longn ---- */
1096 cl_long
CL_ALIGNED(16) s
[2];
1097 #if __CL_HAS_ANON_STRUCT__
1098 __CL_ANON_STRUCT__
struct{ cl_long x
, y
; };
1099 __CL_ANON_STRUCT__
struct{ cl_long s0
, s1
; };
1100 __CL_ANON_STRUCT__
struct{ cl_long lo
, hi
; };
1102 #if defined( __CL_LONG2__)
1109 cl_long
CL_ALIGNED(32) s
[4];
1110 #if __CL_HAS_ANON_STRUCT__
1111 __CL_ANON_STRUCT__
struct{ cl_long x
, y
, z
, w
; };
1112 __CL_ANON_STRUCT__
struct{ cl_long s0
, s1
, s2
, s3
; };
1113 __CL_ANON_STRUCT__
struct{ cl_long2 lo
, hi
; };
1115 #if defined( __CL_LONG2__)
1118 #if defined( __CL_LONG4__)
1123 /* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */
1124 typedef cl_long4 cl_long3
;
1128 cl_long
CL_ALIGNED(64) s
[8];
1129 #if __CL_HAS_ANON_STRUCT__
1130 __CL_ANON_STRUCT__
struct{ cl_long x
, y
, z
, w
; };
1131 __CL_ANON_STRUCT__
struct{ cl_long s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
1132 __CL_ANON_STRUCT__
struct{ cl_long4 lo
, hi
; };
1134 #if defined( __CL_LONG2__)
1137 #if defined( __CL_LONG4__)
1140 #if defined( __CL_LONG8__ )
1147 cl_long
CL_ALIGNED(128) s
[16];
1148 #if __CL_HAS_ANON_STRUCT__
1149 __CL_ANON_STRUCT__
struct{ cl_long x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
1150 __CL_ANON_STRUCT__
struct{ cl_long s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
1151 __CL_ANON_STRUCT__
struct{ cl_long8 lo
, hi
; };
1153 #if defined( __CL_LONG2__)
1156 #if defined( __CL_LONG4__)
1159 #if defined( __CL_LONG8__ )
1162 #if defined( __CL_LONG16__ )
1168 /* ---- cl_ulongn ---- */
1171 cl_ulong
CL_ALIGNED(16) s
[2];
1172 #if __CL_HAS_ANON_STRUCT__
1173 __CL_ANON_STRUCT__
struct{ cl_ulong x
, y
; };
1174 __CL_ANON_STRUCT__
struct{ cl_ulong s0
, s1
; };
1175 __CL_ANON_STRUCT__
struct{ cl_ulong lo
, hi
; };
1177 #if defined( __CL_ULONG2__)
1184 cl_ulong
CL_ALIGNED(32) s
[4];
1185 #if __CL_HAS_ANON_STRUCT__
1186 __CL_ANON_STRUCT__
struct{ cl_ulong x
, y
, z
, w
; };
1187 __CL_ANON_STRUCT__
struct{ cl_ulong s0
, s1
, s2
, s3
; };
1188 __CL_ANON_STRUCT__
struct{ cl_ulong2 lo
, hi
; };
1190 #if defined( __CL_ULONG2__)
1193 #if defined( __CL_ULONG4__)
1198 /* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */
1199 typedef cl_ulong4 cl_ulong3
;
1203 cl_ulong
CL_ALIGNED(64) s
[8];
1204 #if __CL_HAS_ANON_STRUCT__
1205 __CL_ANON_STRUCT__
struct{ cl_ulong x
, y
, z
, w
; };
1206 __CL_ANON_STRUCT__
struct{ cl_ulong s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
1207 __CL_ANON_STRUCT__
struct{ cl_ulong4 lo
, hi
; };
1209 #if defined( __CL_ULONG2__)
1212 #if defined( __CL_ULONG4__)
1215 #if defined( __CL_ULONG8__ )
1222 cl_ulong
CL_ALIGNED(128) s
[16];
1223 #if __CL_HAS_ANON_STRUCT__
1224 __CL_ANON_STRUCT__
struct{ cl_ulong x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
1225 __CL_ANON_STRUCT__
struct{ cl_ulong s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
1226 __CL_ANON_STRUCT__
struct{ cl_ulong8 lo
, hi
; };
1228 #if defined( __CL_ULONG2__)
1231 #if defined( __CL_ULONG4__)
1234 #if defined( __CL_ULONG8__ )
1237 #if defined( __CL_ULONG16__ )
1243 /* --- cl_floatn ---- */
1247 cl_float
CL_ALIGNED(8) s
[2];
1248 #if __CL_HAS_ANON_STRUCT__
1249 __CL_ANON_STRUCT__
struct{ cl_float x
, y
; };
1250 __CL_ANON_STRUCT__
struct{ cl_float s0
, s1
; };
1251 __CL_ANON_STRUCT__
struct{ cl_float lo
, hi
; };
1253 #if defined( __CL_FLOAT2__)
1260 cl_float
CL_ALIGNED(16) s
[4];
1261 #if __CL_HAS_ANON_STRUCT__
1262 __CL_ANON_STRUCT__
struct{ cl_float x
, y
, z
, w
; };
1263 __CL_ANON_STRUCT__
struct{ cl_float s0
, s1
, s2
, s3
; };
1264 __CL_ANON_STRUCT__
struct{ cl_float2 lo
, hi
; };
1266 #if defined( __CL_FLOAT2__)
1269 #if defined( __CL_FLOAT4__)
1274 /* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */
1275 typedef cl_float4 cl_float3
;
1279 cl_float
CL_ALIGNED(32) s
[8];
1280 #if __CL_HAS_ANON_STRUCT__
1281 __CL_ANON_STRUCT__
struct{ cl_float x
, y
, z
, w
; };
1282 __CL_ANON_STRUCT__
struct{ cl_float s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
1283 __CL_ANON_STRUCT__
struct{ cl_float4 lo
, hi
; };
1285 #if defined( __CL_FLOAT2__)
1288 #if defined( __CL_FLOAT4__)
1291 #if defined( __CL_FLOAT8__ )
1298 cl_float
CL_ALIGNED(64) s
[16];
1299 #if __CL_HAS_ANON_STRUCT__
1300 __CL_ANON_STRUCT__
struct{ cl_float x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
1301 __CL_ANON_STRUCT__
struct{ cl_float s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
1302 __CL_ANON_STRUCT__
struct{ cl_float8 lo
, hi
; };
1304 #if defined( __CL_FLOAT2__)
1307 #if defined( __CL_FLOAT4__)
1310 #if defined( __CL_FLOAT8__ )
1313 #if defined( __CL_FLOAT16__ )
1318 /* --- cl_doublen ---- */
1322 cl_double
CL_ALIGNED(16) s
[2];
1323 #if __CL_HAS_ANON_STRUCT__
1324 __CL_ANON_STRUCT__
struct{ cl_double x
, y
; };
1325 __CL_ANON_STRUCT__
struct{ cl_double s0
, s1
; };
1326 __CL_ANON_STRUCT__
struct{ cl_double lo
, hi
; };
1328 #if defined( __CL_DOUBLE2__)
1335 cl_double
CL_ALIGNED(32) s
[4];
1336 #if __CL_HAS_ANON_STRUCT__
1337 __CL_ANON_STRUCT__
struct{ cl_double x
, y
, z
, w
; };
1338 __CL_ANON_STRUCT__
struct{ cl_double s0
, s1
, s2
, s3
; };
1339 __CL_ANON_STRUCT__
struct{ cl_double2 lo
, hi
; };
1341 #if defined( __CL_DOUBLE2__)
1344 #if defined( __CL_DOUBLE4__)
1349 /* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */
1350 typedef cl_double4 cl_double3
;
1354 cl_double
CL_ALIGNED(64) s
[8];
1355 #if __CL_HAS_ANON_STRUCT__
1356 __CL_ANON_STRUCT__
struct{ cl_double x
, y
, z
, w
; };
1357 __CL_ANON_STRUCT__
struct{ cl_double s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
; };
1358 __CL_ANON_STRUCT__
struct{ cl_double4 lo
, hi
; };
1360 #if defined( __CL_DOUBLE2__)
1363 #if defined( __CL_DOUBLE4__)
1366 #if defined( __CL_DOUBLE8__ )
1373 cl_double
CL_ALIGNED(128) s
[16];
1374 #if __CL_HAS_ANON_STRUCT__
1375 __CL_ANON_STRUCT__
struct{ cl_double x
, y
, z
, w
, __spacer4
, __spacer5
, __spacer6
, __spacer7
, __spacer8
, __spacer9
, sa
, sb
, sc
, sd
, se
, sf
; };
1376 __CL_ANON_STRUCT__
struct{ cl_double s0
, s1
, s2
, s3
, s4
, s5
, s6
, s7
, s8
, s9
, sA
, sB
, sC
, sD
, sE
, sF
; };
1377 __CL_ANON_STRUCT__
struct{ cl_double8 lo
, hi
; };
1379 #if defined( __CL_DOUBLE2__)
1382 #if defined( __CL_DOUBLE4__)
1385 #if defined( __CL_DOUBLE8__ )
1388 #if defined( __CL_DOUBLE16__ )
1393 /* Macro to facilitate debugging
1395 * Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source.
1396 * The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \"
1397 * Each line thereafter of OpenCL C source must end with: \n\
1398 * The last line ends in ";
1402 * const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
1403 * kernel void foo( int a, float * b ) \n\
1406 * *b[ get_global_id(0)] = a; \n\
1410 * This should correctly set up the line, (column) and file information for your source
1411 * string so you can do source level debugging.
1413 #define __CL_STRINGIFY( _x ) # _x
1414 #define _CL_STRINGIFY( _x ) __CL_STRINGIFY( _x )
1415 #define CL_PROGRAM_STRING_DEBUG_INFO "#line " _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n"
1421 #undef __CL_HAS_ANON_STRUCT__
1422 #undef __CL_ANON_STRUCT__
1423 #if defined( _WIN32) && defined(_MSC_VER)
1425 #pragma warning( pop )
1429 #endif /* __CL_PLATFORM_H */