cl_platform.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 #pragma once
00005 
00006 #if defined (WIN32) && !defined(__GNUC__) 
00007 // GCC automatically sets __SSE2__
00008 #ifndef CL_DISABLE_SSE2
00009 #define __SSE__
00010 #define __SSE2__
00011 #endif
00012 #endif
00013 
00014 #if defined(WIN32) && (defined(__MINGW32__) == 0)
00015 typedef __int8             cl_byte8;
00016 typedef unsigned __int8    cl_ubyte8;
00017 typedef __int16            cl_byte16;
00018 typedef unsigned __int16   cl_ubyte16;
00019 typedef __int32            cl_byte32;
00020 typedef unsigned __int32   cl_ubyte32;
00021 typedef __int64            cl_byte64;
00022 typedef unsigned __int64   cl_ubyte64;
00023 #else
00024 typedef char               cl_byte8;
00025 typedef unsigned char      cl_ubyte8;
00026 typedef short              cl_byte16;
00027 typedef unsigned short     cl_ubyte16;
00028 typedef int                cl_byte32;
00029 typedef unsigned int       cl_ubyte32;
00030 typedef long long          cl_byte64;
00031 typedef unsigned long long cl_ubyte64;
00032 #endif
00033 
00034 /**********************************************************************************
00035  * Copyright (c) 2008-2010 The Khronos Group Inc.
00036  *
00037  * Permission is hereby granted, free of charge, to any person obtaining a
00038  * copy of this software and/or associated documentation files (the
00039  * "Materials"), to deal in the Materials without restriction, including
00040  * without limitation the rights to use, copy, modify, merge, publish,
00041  * distribute, sublicense, and/or sell copies of the Materials, and to
00042  * permit persons to whom the Materials are furnished to do so, subject to
00043  * the following conditions:
00044  *
00045  * The above copyright notice and this permission notice shall be included
00046  * in all copies or substantial portions of the Materials.
00047  *
00048  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00049  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00050  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00051  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00052  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00053  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00054  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
00055  **********************************************************************************/
00056 
00057 /* $Revision: 14829 $ on $Date: 2011-05-26 08:22:50 -0700 (Thu, 26 May 2011) $ */
00058 
00059 #ifndef __CL_PLATFORM_H
00060 #define __CL_PLATFORM_H
00061 
00062 #ifdef __APPLE__
00063     /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */
00064     #include <AvailabilityMacros.h>
00065 #endif
00066 
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif
00070 
00071 #if defined(_WIN32)
00072     #define CL_API_ENTRY
00073     #define CL_API_CALL     __stdcall
00074     #define CL_CALLBACK     __stdcall
00075 #else
00076     #define CL_API_ENTRY
00077     #define CL_API_CALL
00078     #define CL_CALLBACK
00079 #endif
00080 
00081 #ifdef __APPLE__
00082     #define CL_EXTENSION_WEAK_LINK                  __attribute__((weak_import))       
00083     #define CL_API_SUFFIX__VERSION_1_0              AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
00084     #define CL_EXT_SUFFIX__VERSION_1_0              CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
00085     #define CL_API_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
00086     #define CL_EXT_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
00087     #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
00088 #else
00089     #define CL_EXTENSION_WEAK_LINK                         
00090     #define CL_API_SUFFIX__VERSION_1_0
00091     #define CL_EXT_SUFFIX__VERSION_1_0
00092     #define CL_API_SUFFIX__VERSION_1_1
00093     #define CL_EXT_SUFFIX__VERSION_1_1
00094     #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
00095 #endif
00096 
00097 #if (defined (_WIN32) && defined(_MSC_VER))
00098 
00099 /* scalar types  */
00100 typedef signed   __int8         cl_char;
00101 typedef unsigned __int8         cl_uchar;
00102 typedef signed   __int16        cl_short;
00103 typedef unsigned __int16        cl_ushort;
00104 typedef signed   __int32        cl_int;
00105 typedef unsigned __int32        cl_uint;
00106 typedef signed   __int64        cl_long;
00107 typedef unsigned __int64        cl_ulong;
00108 
00109 typedef unsigned __int16        cl_half;
00110 typedef float                   cl_float;
00111 typedef double                  cl_double;
00112 
00113 /* Macro names and corresponding values defined by OpenCL */
00114 #define CL_CHAR_BIT         8
00115 #define CL_SCHAR_MAX        127
00116 #define CL_SCHAR_MIN        (-127-1)
00117 #define CL_CHAR_MAX         CL_SCHAR_MAX
00118 #define CL_CHAR_MIN         CL_SCHAR_MIN
00119 #define CL_UCHAR_MAX        255
00120 #define CL_SHRT_MAX         32767
00121 #define CL_SHRT_MIN         (-32767-1)
00122 #define CL_USHRT_MAX        65535
00123 #define CL_INT_MAX          2147483647
00124 #define CL_INT_MIN          (-2147483647-1)
00125 #define CL_UINT_MAX         0xffffffffU
00126 #define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
00127 #define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
00128 #define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
00129 
00130 #define CL_FLT_DIG          6
00131 #define CL_FLT_MANT_DIG     24
00132 #define CL_FLT_MAX_10_EXP   +38
00133 #define CL_FLT_MAX_EXP      +128
00134 #define CL_FLT_MIN_10_EXP   -37
00135 #define CL_FLT_MIN_EXP      -125
00136 #define CL_FLT_RADIX        2
00137 #define CL_FLT_MAX          340282346638528859811704183484516925440.0f
00138 #define CL_FLT_MIN          1.175494350822287507969e-38f
00139 #define CL_FLT_EPSILON      0x1.0p-23f
00140 
00141 #define CL_DBL_DIG          15
00142 #define CL_DBL_MANT_DIG     53
00143 #define CL_DBL_MAX_10_EXP   +308
00144 #define CL_DBL_MAX_EXP      +1024
00145 #define CL_DBL_MIN_10_EXP   -307
00146 #define CL_DBL_MIN_EXP      -1021
00147 #define CL_DBL_RADIX        2
00148 #define CL_DBL_MAX          179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
00149 #define CL_DBL_MIN          2.225073858507201383090e-308
00150 #define CL_DBL_EPSILON      2.220446049250313080847e-16
00151 
00152 #define  CL_M_E             2.718281828459045090796
00153 #define  CL_M_LOG2E         1.442695040888963387005
00154 #define  CL_M_LOG10E        0.434294481903251816668
00155 #define  CL_M_LN2           0.693147180559945286227
00156 #define  CL_M_LN10          2.302585092994045901094
00157 #define  CL_M_PI            3.141592653589793115998
00158 #define  CL_M_PI_2          1.570796326794896557999
00159 #define  CL_M_PI_4          0.785398163397448278999
00160 #define  CL_M_1_PI          0.318309886183790691216
00161 #define  CL_M_2_PI          0.636619772367581382433
00162 #define  CL_M_2_SQRTPI      1.128379167095512558561
00163 #define  CL_M_SQRT2         1.414213562373095145475
00164 #define  CL_M_SQRT1_2       0.707106781186547572737
00165 
00166 #define  CL_M_E_F           2.71828174591064f
00167 #define  CL_M_LOG2E_F       1.44269502162933f
00168 #define  CL_M_LOG10E_F      0.43429449200630f
00169 #define  CL_M_LN2_F         0.69314718246460f
00170 #define  CL_M_LN10_F        2.30258512496948f
00171 #define  CL_M_PI_F          3.14159274101257f
00172 #define  CL_M_PI_2_F        1.57079637050629f
00173 #define  CL_M_PI_4_F        0.78539818525314f
00174 #define  CL_M_1_PI_F        0.31830987334251f
00175 #define  CL_M_2_PI_F        0.63661974668503f
00176 #define  CL_M_2_SQRTPI_F    1.12837922573090f
00177 #define  CL_M_SQRT2_F       1.41421353816986f
00178 #define  CL_M_SQRT1_2_F     0.70710676908493f
00179 
00180 #define CL_NAN              (CL_INFINITY - CL_INFINITY)
00181 #define CL_HUGE_VALF        ((cl_float) 1e50)
00182 #define CL_HUGE_VAL         ((cl_double) 1e500)
00183 #define CL_MAXFLOAT         CL_FLT_MAX
00184 #define CL_INFINITY         CL_HUGE_VALF
00185 
00186 #else
00187 
00188 #include <stdint.h>
00189 
00190 /* scalar types  */
00191 typedef int8_t          cl_char;
00192 typedef uint8_t         cl_uchar;
00193 typedef int16_t         cl_short    __attribute__((aligned(2)));
00194 typedef uint16_t        cl_ushort   __attribute__((aligned(2)));
00195 typedef int32_t         cl_int      __attribute__((aligned(4)));
00196 typedef uint32_t        cl_uint     __attribute__((aligned(4)));
00197 typedef int64_t         cl_long     __attribute__((aligned(8)));
00198 typedef uint64_t        cl_ulong    __attribute__((aligned(8)));
00199 
00200 typedef uint16_t        cl_half     __attribute__((aligned(2)));
00201 typedef float           cl_float    __attribute__((aligned(4)));
00202 typedef double          cl_double   __attribute__((aligned(8)));
00203 
00204 /* Macro names and corresponding values defined by OpenCL */
00205 #define CL_CHAR_BIT         8
00206 #define CL_SCHAR_MAX        127
00207 #define CL_SCHAR_MIN        (-127-1)
00208 #define CL_CHAR_MAX         CL_SCHAR_MAX
00209 #define CL_CHAR_MIN         CL_SCHAR_MIN
00210 #define CL_UCHAR_MAX        255
00211 #define CL_SHRT_MAX         32767
00212 #define CL_SHRT_MIN         (-32767-1)
00213 #define CL_USHRT_MAX        65535
00214 #define CL_INT_MAX          2147483647
00215 #define CL_INT_MIN          (-2147483647-1)
00216 #define CL_UINT_MAX         0xffffffffU
00217 #define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
00218 #define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
00219 #define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
00220 
00221 #define CL_FLT_DIG          6
00222 #define CL_FLT_MANT_DIG     24
00223 #define CL_FLT_MAX_10_EXP   +38
00224 #define CL_FLT_MAX_EXP      +128
00225 #define CL_FLT_MIN_10_EXP   -37
00226 #define CL_FLT_MIN_EXP      -125
00227 #define CL_FLT_RADIX        2
00228 #define CL_FLT_MAX          0x1.fffffep127f
00229 #define CL_FLT_MIN          0x1.0p-126f
00230 #define CL_FLT_EPSILON      0x1.0p-23f
00231 
00232 #define CL_DBL_DIG          15
00233 #define CL_DBL_MANT_DIG     53
00234 #define CL_DBL_MAX_10_EXP   +308
00235 #define CL_DBL_MAX_EXP      +1024
00236 #define CL_DBL_MIN_10_EXP   -307
00237 #define CL_DBL_MIN_EXP      -1021
00238 #define CL_DBL_RADIX        2
00239 #define CL_DBL_MAX          0x1.fffffffffffffp1023
00240 #define CL_DBL_MIN          0x1.0p-1022
00241 #define CL_DBL_EPSILON      0x1.0p-52
00242 
00243 #define  CL_M_E             2.718281828459045090796
00244 #define  CL_M_LOG2E         1.442695040888963387005
00245 #define  CL_M_LOG10E        0.434294481903251816668
00246 #define  CL_M_LN2           0.693147180559945286227
00247 #define  CL_M_LN10          2.302585092994045901094
00248 #define  CL_M_PI            3.141592653589793115998
00249 #define  CL_M_PI_2          1.570796326794896557999
00250 #define  CL_M_PI_4          0.785398163397448278999
00251 #define  CL_M_1_PI          0.318309886183790691216
00252 #define  CL_M_2_PI          0.636619772367581382433
00253 #define  CL_M_2_SQRTPI      1.128379167095512558561
00254 #define  CL_M_SQRT2         1.414213562373095145475
00255 #define  CL_M_SQRT1_2       0.707106781186547572737
00256 
00257 #define  CL_M_E_F           2.71828174591064f
00258 #define  CL_M_LOG2E_F       1.44269502162933f
00259 #define  CL_M_LOG10E_F      0.43429449200630f
00260 #define  CL_M_LN2_F         0.69314718246460f
00261 #define  CL_M_LN10_F        2.30258512496948f
00262 #define  CL_M_PI_F          3.14159274101257f
00263 #define  CL_M_PI_2_F        1.57079637050629f
00264 #define  CL_M_PI_4_F        0.78539818525314f
00265 #define  CL_M_1_PI_F        0.31830987334251f
00266 #define  CL_M_2_PI_F        0.63661974668503f
00267 #define  CL_M_2_SQRTPI_F    1.12837922573090f
00268 #define  CL_M_SQRT2_F       1.41421353816986f
00269 #define  CL_M_SQRT1_2_F     0.70710676908493f
00270 
00271 #if (defined( __GNUC__ ) || defined( __IBMC__ ))
00272    #define CL_HUGE_VALF     __builtin_huge_valf()
00273    #define CL_HUGE_VAL      __builtin_huge_val()
00274    #define CL_NAN           __builtin_nanf( "" )
00275 #else
00276    #define CL_HUGE_VALF     ((cl_float) 1e50)
00277    #define CL_HUGE_VAL      ((cl_double) 1e500)
00278    float nanf( const char * );
00279    #define CL_NAN           nanf( "" )  
00280 #endif
00281 #define CL_MAXFLOAT         CL_FLT_MAX
00282 #define CL_INFINITY         CL_HUGE_VALF
00283 
00284 #endif
00285 
00286 #include <stddef.h>
00287 
00288 /* Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here. */
00289 typedef unsigned int cl_GLuint;
00290 typedef int          cl_GLint;
00291 typedef unsigned int cl_GLenum;
00292 
00293 /*
00294  * Vector types 
00295  *
00296  *  Note:   OpenCL requires that all types be naturally aligned. 
00297  *          This means that vector types must be naturally aligned.
00298  *          For example, a vector of four floats must be aligned to
00299  *          a 16 byte boundary (calculated as 4 * the natural 4-byte 
00300  *          alignment of the float).  The alignment qualifiers here
00301  *          will only function properly if your compiler supports them
00302  *          and if you don't actively work to defeat them.  For example,
00303  *          in order for a cl_float4 to be 16 byte aligned in a struct,
00304  *          the start of the struct must itself be 16-byte aligned. 
00305  *
00306  *          Maintaining proper alignment is the user's responsibility.
00307  */
00308 
00309 /* Define basic vector types */
00310 #if defined( __VEC__ )
00311    #include <altivec.h>   /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
00312    typedef vector unsigned char     __cl_uchar16;
00313    typedef vector signed char       __cl_char16;
00314    typedef vector unsigned short    __cl_ushort8;
00315    typedef vector signed short      __cl_short8;
00316    typedef vector unsigned int      __cl_uint4;
00317    typedef vector signed int        __cl_int4;
00318    typedef vector float             __cl_float4;
00319    #define  __CL_UCHAR16__  1
00320    #define  __CL_CHAR16__   1
00321    #define  __CL_USHORT8__  1
00322    #define  __CL_SHORT8__   1
00323    #define  __CL_UINT4__    1
00324    #define  __CL_INT4__     1
00325    #define  __CL_FLOAT4__   1
00326 #endif
00327 
00328 #if defined( __SSE__ )
00329     #if defined( __MINGW64__ )
00330         #include <intrin.h>
00331     #else
00332         #include <xmmintrin.h>
00333     #endif
00334     #if defined( __GNUC__ )
00335         typedef float __cl_float4   __attribute__((vector_size(16)));
00336     #else
00337         typedef __m128 __cl_float4;
00338     #endif
00339     #define __CL_FLOAT4__   1
00340 #endif
00341 
00342 #if defined( __SSE2__ )
00343     #if defined( __MINGW64__ )
00344         #include <intrin.h>
00345     #else
00346         #include <emmintrin.h>
00347     #endif
00348     #if defined( __GNUC__ )
00349         typedef cl_uchar    __cl_uchar16    __attribute__((vector_size(16)));
00350         typedef cl_char     __cl_char16     __attribute__((vector_size(16)));
00351         typedef cl_ushort   __cl_ushort8    __attribute__((vector_size(16)));
00352         typedef cl_short    __cl_short8     __attribute__((vector_size(16)));
00353         typedef cl_uint     __cl_uint4      __attribute__((vector_size(16)));
00354         typedef cl_int      __cl_int4       __attribute__((vector_size(16)));
00355         typedef cl_ulong    __cl_ulong2     __attribute__((vector_size(16)));
00356         typedef cl_long     __cl_long2      __attribute__((vector_size(16)));
00357         typedef cl_double   __cl_double2    __attribute__((vector_size(16)));
00358     #else
00359         typedef __m128i __cl_uchar16;
00360         typedef __m128i __cl_char16;
00361         typedef __m128i __cl_ushort8;
00362         typedef __m128i __cl_short8;
00363         typedef __m128i __cl_uint4;
00364         typedef __m128i __cl_int4;
00365         typedef __m128i __cl_ulong2;
00366         typedef __m128i __cl_long2;
00367         typedef __m128d __cl_double2;
00368     #endif
00369     #define __CL_UCHAR16__  1
00370     #define __CL_CHAR16__   1
00371     #define __CL_USHORT8__  1
00372     #define __CL_SHORT8__   1
00373     #define __CL_INT4__     1
00374     #define __CL_UINT4__    1
00375     #define __CL_ULONG2__   1
00376     #define __CL_LONG2__    1
00377     #define __CL_DOUBLE2__  1
00378 #endif
00379 
00380 #if defined( __MMX__ )
00381     #include <mmintrin.h>
00382     #if defined( __GNUC__ )
00383         typedef cl_uchar    __cl_uchar8     __attribute__((vector_size(8)));
00384         typedef cl_char     __cl_char8      __attribute__((vector_size(8)));
00385         typedef cl_ushort   __cl_ushort4    __attribute__((vector_size(8)));
00386         typedef cl_short    __cl_short4     __attribute__((vector_size(8)));
00387         typedef cl_uint     __cl_uint2      __attribute__((vector_size(8)));
00388         typedef cl_int      __cl_int2       __attribute__((vector_size(8)));
00389         typedef cl_ulong    __cl_ulong1     __attribute__((vector_size(8)));
00390         typedef cl_long     __cl_long1      __attribute__((vector_size(8)));
00391         typedef cl_float    __cl_float2     __attribute__((vector_size(8)));
00392     #else
00393         typedef __m64       __cl_uchar8;
00394         typedef __m64       __cl_char8;
00395         typedef __m64       __cl_ushort4;
00396         typedef __m64       __cl_short4;
00397         typedef __m64       __cl_uint2;
00398         typedef __m64       __cl_int2;
00399         typedef __m64       __cl_ulong1;
00400         typedef __m64       __cl_long1;
00401         typedef __m64       __cl_float2;
00402     #endif
00403     #define __CL_UCHAR8__   1
00404     #define __CL_CHAR8__    1
00405     #define __CL_USHORT4__  1
00406     #define __CL_SHORT4__   1
00407     #define __CL_INT2__     1
00408     #define __CL_UINT2__    1
00409     #define __CL_ULONG1__   1
00410     #define __CL_LONG1__    1
00411     #define __CL_FLOAT2__   1
00412 #endif
00413 
00414 #if defined( __AVX__ )
00415     #if defined( __MINGW64__ )
00416         #include <intrin.h>
00417     #else
00418         #include <immintrin.h> 
00419     #endif
00420     #if defined( __GNUC__ )
00421         typedef cl_float    __cl_float8     __attribute__((vector_size(32)));
00422         typedef cl_double   __cl_double4    __attribute__((vector_size(32)));
00423     #else
00424         typedef __m256      __cl_float8;
00425         typedef __m256d     __cl_double4;
00426     #endif
00427     #define __CL_FLOAT8__   1
00428     #define __CL_DOUBLE4__  1
00429 #endif
00430 
00431 /* Define alignment keys */
00432 #if (defined( __GNUC__ ) || defined( __IBMC__ ))
00433     #define CL_ALIGNED(_x)          __attribute__ ((aligned(_x)))
00434 #elif defined( _WIN32) && (_MSC_VER)
00435     /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements     */
00436     /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx                                                 */
00437     /* #include <crtdefs.h>                                                                                             */
00438     /* #define CL_ALIGNED(_x)          _CRT_ALIGN(_x)                                                                   */
00439     #define CL_ALIGNED(_x)
00440 #else
00441    #warning  Need to implement some method to align data here
00442    #define  CL_ALIGNED(_x)
00443 #endif
00444 
00445 /* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
00446 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00447     /* .xyzw and .s0123...{f|F} are supported */
00448     #define CL_HAS_NAMED_VECTOR_FIELDS 1
00449     /* .hi and .lo are supported */
00450     #define CL_HAS_HI_LO_VECTOR_FIELDS 1
00451 #endif
00452 
00453 /* Define cl_vector types */
00454 
00455 /* ---- cl_charn ---- */
00456 typedef union
00457 {
00458     cl_char  CL_ALIGNED(2) s[2];
00459 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00460    __extension__ struct{ cl_char  x, y; };
00461    __extension__ struct{ cl_char  s0, s1; };
00462    __extension__ struct{ cl_char  lo, hi; };
00463 #endif
00464 #if defined( __CL_CHAR2__) 
00465     __cl_char2     v2;
00466 #endif
00467 }cl_char2;
00468 
00469 typedef union
00470 {
00471     cl_char  CL_ALIGNED(4) s[4];
00472 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00473    __extension__ struct{ cl_char  x, y, z, w; };
00474    __extension__ struct{ cl_char  s0, s1, s2, s3; };
00475    __extension__ struct{ cl_char2 lo, hi; };
00476 #endif
00477 #if defined( __CL_CHAR2__) 
00478     __cl_char2     v2[2];
00479 #endif
00480 #if defined( __CL_CHAR4__) 
00481     __cl_char4     v4;
00482 #endif
00483 }cl_char4;
00484 
00485 /* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */
00486 typedef  cl_char4  cl_char3;
00487 
00488 typedef union
00489 {
00490     cl_char   CL_ALIGNED(8) s[8];
00491 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00492    __extension__ struct{ cl_char  x, y, z, w; };
00493    __extension__ struct{ cl_char  s0, s1, s2, s3, s4, s5, s6, s7; };
00494    __extension__ struct{ cl_char4 lo, hi; };
00495 #endif
00496 #if defined( __CL_CHAR2__) 
00497     __cl_char2     v2[4];
00498 #endif
00499 #if defined( __CL_CHAR4__) 
00500     __cl_char4     v4[2];
00501 #endif
00502 #if defined( __CL_CHAR8__ )
00503     __cl_char8     v8;
00504 #endif
00505 }cl_char8;
00506 
00507 typedef union
00508 {
00509     cl_char  CL_ALIGNED(16) s[16];
00510 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00511    __extension__ struct{ cl_char  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00512    __extension__ struct{ cl_char  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00513    __extension__ struct{ cl_char8 lo, hi; };
00514 #endif
00515 #if defined( __CL_CHAR2__) 
00516     __cl_char2     v2[8];
00517 #endif
00518 #if defined( __CL_CHAR4__) 
00519     __cl_char4     v4[4];
00520 #endif
00521 #if defined( __CL_CHAR8__ )
00522     __cl_char8     v8[2];
00523 #endif
00524 #if defined( __CL_CHAR16__ )
00525     __cl_char16    v16;
00526 #endif
00527 }cl_char16;
00528 
00529 
00530 /* ---- cl_ucharn ---- */
00531 typedef union
00532 {
00533     cl_uchar  CL_ALIGNED(2) s[2];
00534 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00535    __extension__ struct{ cl_uchar  x, y; };
00536    __extension__ struct{ cl_uchar  s0, s1; };
00537    __extension__ struct{ cl_uchar  lo, hi; };
00538 #endif
00539 #if defined( __cl_uchar2__) 
00540     __cl_uchar2     v2;
00541 #endif
00542 }cl_uchar2;
00543 
00544 typedef union
00545 {
00546     cl_uchar  CL_ALIGNED(4) s[4];
00547 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00548    __extension__ struct{ cl_uchar  x, y, z, w; };
00549    __extension__ struct{ cl_uchar  s0, s1, s2, s3; };
00550    __extension__ struct{ cl_uchar2 lo, hi; };
00551 #endif
00552 #if defined( __CL_UCHAR2__) 
00553     __cl_uchar2     v2[2];
00554 #endif
00555 #if defined( __CL_UCHAR4__) 
00556     __cl_uchar4     v4;
00557 #endif
00558 }cl_uchar4;
00559 
00560 /* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */
00561 typedef  cl_uchar4  cl_uchar3;
00562 
00563 typedef union
00564 {
00565     cl_uchar   CL_ALIGNED(8) s[8];
00566 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00567    __extension__ struct{ cl_uchar  x, y, z, w; };
00568    __extension__ struct{ cl_uchar  s0, s1, s2, s3, s4, s5, s6, s7; };
00569    __extension__ struct{ cl_uchar4 lo, hi; };
00570 #endif
00571 #if defined( __CL_UCHAR2__) 
00572     __cl_uchar2     v2[4];
00573 #endif
00574 #if defined( __CL_UCHAR4__) 
00575     __cl_uchar4     v4[2];
00576 #endif
00577 #if defined( __CL_UCHAR8__ )
00578     __cl_uchar8     v8;
00579 #endif
00580 }cl_uchar8;
00581 
00582 typedef union
00583 {
00584     cl_uchar  CL_ALIGNED(16) s[16];
00585 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00586    __extension__ struct{ cl_uchar  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00587    __extension__ struct{ cl_uchar  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00588    __extension__ struct{ cl_uchar8 lo, hi; };
00589 #endif
00590 #if defined( __CL_UCHAR2__) 
00591     __cl_uchar2     v2[8];
00592 #endif
00593 #if defined( __CL_UCHAR4__) 
00594     __cl_uchar4     v4[4];
00595 #endif
00596 #if defined( __CL_UCHAR8__ )
00597     __cl_uchar8     v8[2];
00598 #endif
00599 #if defined( __CL_UCHAR16__ )
00600     __cl_uchar16    v16;
00601 #endif
00602 }cl_uchar16;
00603 
00604 
00605 /* ---- cl_shortn ---- */
00606 typedef union
00607 {
00608     cl_short  CL_ALIGNED(4) s[2];
00609 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00610    __extension__ struct{ cl_short  x, y; };
00611    __extension__ struct{ cl_short  s0, s1; };
00612    __extension__ struct{ cl_short  lo, hi; };
00613 #endif
00614 #if defined( __CL_SHORT2__) 
00615     __cl_short2     v2;
00616 #endif
00617 }cl_short2;
00618 
00619 typedef union
00620 {
00621     cl_short  CL_ALIGNED(8) s[4];
00622 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00623    __extension__ struct{ cl_short  x, y, z, w; };
00624    __extension__ struct{ cl_short  s0, s1, s2, s3; };
00625    __extension__ struct{ cl_short2 lo, hi; };
00626 #endif
00627 #if defined( __CL_SHORT2__) 
00628     __cl_short2     v2[2];
00629 #endif
00630 #if defined( __CL_SHORT4__) 
00631     __cl_short4     v4;
00632 #endif
00633 }cl_short4;
00634 
00635 /* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */
00636 typedef  cl_short4  cl_short3;
00637 
00638 typedef union
00639 {
00640     cl_short   CL_ALIGNED(16) s[8];
00641 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00642    __extension__ struct{ cl_short  x, y, z, w; };
00643    __extension__ struct{ cl_short  s0, s1, s2, s3, s4, s5, s6, s7; };
00644    __extension__ struct{ cl_short4 lo, hi; };
00645 #endif
00646 #if defined( __CL_SHORT2__) 
00647     __cl_short2     v2[4];
00648 #endif
00649 #if defined( __CL_SHORT4__) 
00650     __cl_short4     v4[2];
00651 #endif
00652 #if defined( __CL_SHORT8__ )
00653     __cl_short8     v8;
00654 #endif
00655 }cl_short8;
00656 
00657 typedef union
00658 {
00659     cl_short  CL_ALIGNED(32) s[16];
00660 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00661    __extension__ struct{ cl_short  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00662    __extension__ struct{ cl_short  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00663    __extension__ struct{ cl_short8 lo, hi; };
00664 #endif
00665 #if defined( __CL_SHORT2__) 
00666     __cl_short2     v2[8];
00667 #endif
00668 #if defined( __CL_SHORT4__) 
00669     __cl_short4     v4[4];
00670 #endif
00671 #if defined( __CL_SHORT8__ )
00672     __cl_short8     v8[2];
00673 #endif
00674 #if defined( __CL_SHORT16__ )
00675     __cl_short16    v16;
00676 #endif
00677 }cl_short16;
00678 
00679 
00680 /* ---- cl_ushortn ---- */
00681 typedef union
00682 {
00683     cl_ushort  CL_ALIGNED(4) s[2];
00684 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00685    __extension__ struct{ cl_ushort  x, y; };
00686    __extension__ struct{ cl_ushort  s0, s1; };
00687    __extension__ struct{ cl_ushort  lo, hi; };
00688 #endif
00689 #if defined( __CL_USHORT2__) 
00690     __cl_ushort2     v2;
00691 #endif
00692 }cl_ushort2;
00693 
00694 typedef union
00695 {
00696     cl_ushort  CL_ALIGNED(8) s[4];
00697 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00698    __extension__ struct{ cl_ushort  x, y, z, w; };
00699    __extension__ struct{ cl_ushort  s0, s1, s2, s3; };
00700    __extension__ struct{ cl_ushort2 lo, hi; };
00701 #endif
00702 #if defined( __CL_USHORT2__) 
00703     __cl_ushort2     v2[2];
00704 #endif
00705 #if defined( __CL_USHORT4__) 
00706     __cl_ushort4     v4;
00707 #endif
00708 }cl_ushort4;
00709 
00710 /* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */
00711 typedef  cl_ushort4  cl_ushort3;
00712 
00713 typedef union
00714 {
00715     cl_ushort   CL_ALIGNED(16) s[8];
00716 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00717    __extension__ struct{ cl_ushort  x, y, z, w; };
00718    __extension__ struct{ cl_ushort  s0, s1, s2, s3, s4, s5, s6, s7; };
00719    __extension__ struct{ cl_ushort4 lo, hi; };
00720 #endif
00721 #if defined( __CL_USHORT2__) 
00722     __cl_ushort2     v2[4];
00723 #endif
00724 #if defined( __CL_USHORT4__) 
00725     __cl_ushort4     v4[2];
00726 #endif
00727 #if defined( __CL_USHORT8__ )
00728     __cl_ushort8     v8;
00729 #endif
00730 }cl_ushort8;
00731 
00732 typedef union
00733 {
00734     cl_ushort  CL_ALIGNED(32) s[16];
00735 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00736    __extension__ struct{ cl_ushort  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00737    __extension__ struct{ cl_ushort  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00738    __extension__ struct{ cl_ushort8 lo, hi; };
00739 #endif
00740 #if defined( __CL_USHORT2__) 
00741     __cl_ushort2     v2[8];
00742 #endif
00743 #if defined( __CL_USHORT4__) 
00744     __cl_ushort4     v4[4];
00745 #endif
00746 #if defined( __CL_USHORT8__ )
00747     __cl_ushort8     v8[2];
00748 #endif
00749 #if defined( __CL_USHORT16__ )
00750     __cl_ushort16    v16;
00751 #endif
00752 }cl_ushort16;
00753 
00754 /* ---- cl_intn ---- */
00755 typedef union
00756 {
00757     cl_int  CL_ALIGNED(8) s[2];
00758 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00759    __extension__ struct{ cl_int  x, y; };
00760    __extension__ struct{ cl_int  s0, s1; };
00761    __extension__ struct{ cl_int  lo, hi; };
00762 #endif
00763 #if defined( __CL_INT2__) 
00764     __cl_int2     v2;
00765 #endif
00766 }cl_int2;
00767 
00768 typedef union
00769 {
00770     cl_int  CL_ALIGNED(16) s[4];
00771 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00772    __extension__ struct{ cl_int  x, y, z, w; };
00773    __extension__ struct{ cl_int  s0, s1, s2, s3; };
00774    __extension__ struct{ cl_int2 lo, hi; };
00775 #endif
00776 #if defined( __CL_INT2__) 
00777     __cl_int2     v2[2];
00778 #endif
00779 #if defined( __CL_INT4__) 
00780     __cl_int4     v4;
00781 #endif
00782 }cl_int4;
00783 
00784 /* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */
00785 typedef  cl_int4  cl_int3;
00786 
00787 typedef union
00788 {
00789     cl_int   CL_ALIGNED(32) s[8];
00790 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00791    __extension__ struct{ cl_int  x, y, z, w; };
00792    __extension__ struct{ cl_int  s0, s1, s2, s3, s4, s5, s6, s7; };
00793    __extension__ struct{ cl_int4 lo, hi; };
00794 #endif
00795 #if defined( __CL_INT2__) 
00796     __cl_int2     v2[4];
00797 #endif
00798 #if defined( __CL_INT4__) 
00799     __cl_int4     v4[2];
00800 #endif
00801 #if defined( __CL_INT8__ )
00802     __cl_int8     v8;
00803 #endif
00804 }cl_int8;
00805 
00806 typedef union
00807 {
00808     cl_int  CL_ALIGNED(64) s[16];
00809 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00810    __extension__ struct{ cl_int  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00811    __extension__ struct{ cl_int  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00812    __extension__ struct{ cl_int8 lo, hi; };
00813 #endif
00814 #if defined( __CL_INT2__) 
00815     __cl_int2     v2[8];
00816 #endif
00817 #if defined( __CL_INT4__) 
00818     __cl_int4     v4[4];
00819 #endif
00820 #if defined( __CL_INT8__ )
00821     __cl_int8     v8[2];
00822 #endif
00823 #if defined( __CL_INT16__ )
00824     __cl_int16    v16;
00825 #endif
00826 }cl_int16;
00827 
00828 
00829 /* ---- cl_uintn ---- */
00830 typedef union
00831 {
00832     cl_uint  CL_ALIGNED(8) s[2];
00833 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00834    __extension__ struct{ cl_uint  x, y; };
00835    __extension__ struct{ cl_uint  s0, s1; };
00836    __extension__ struct{ cl_uint  lo, hi; };
00837 #endif
00838 #if defined( __CL_UINT2__) 
00839     __cl_uint2     v2;
00840 #endif
00841 }cl_uint2;
00842 
00843 typedef union
00844 {
00845     cl_uint  CL_ALIGNED(16) s[4];
00846 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00847    __extension__ struct{ cl_uint  x, y, z, w; };
00848    __extension__ struct{ cl_uint  s0, s1, s2, s3; };
00849    __extension__ struct{ cl_uint2 lo, hi; };
00850 #endif
00851 #if defined( __CL_UINT2__) 
00852     __cl_uint2     v2[2];
00853 #endif
00854 #if defined( __CL_UINT4__) 
00855     __cl_uint4     v4;
00856 #endif
00857 }cl_uint4;
00858 
00859 /* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */
00860 typedef  cl_uint4  cl_uint3;
00861 
00862 typedef union
00863 {
00864     cl_uint   CL_ALIGNED(32) s[8];
00865 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00866    __extension__ struct{ cl_uint  x, y, z, w; };
00867    __extension__ struct{ cl_uint  s0, s1, s2, s3, s4, s5, s6, s7; };
00868    __extension__ struct{ cl_uint4 lo, hi; };
00869 #endif
00870 #if defined( __CL_UINT2__) 
00871     __cl_uint2     v2[4];
00872 #endif
00873 #if defined( __CL_UINT4__) 
00874     __cl_uint4     v4[2];
00875 #endif
00876 #if defined( __CL_UINT8__ )
00877     __cl_uint8     v8;
00878 #endif
00879 }cl_uint8;
00880 
00881 typedef union
00882 {
00883     cl_uint  CL_ALIGNED(64) s[16];
00884 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00885    __extension__ struct{ cl_uint  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00886    __extension__ struct{ cl_uint  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00887    __extension__ struct{ cl_uint8 lo, hi; };
00888 #endif
00889 #if defined( __CL_UINT2__) 
00890     __cl_uint2     v2[8];
00891 #endif
00892 #if defined( __CL_UINT4__) 
00893     __cl_uint4     v4[4];
00894 #endif
00895 #if defined( __CL_UINT8__ )
00896     __cl_uint8     v8[2];
00897 #endif
00898 #if defined( __CL_UINT16__ )
00899     __cl_uint16    v16;
00900 #endif
00901 }cl_uint16;
00902 
00903 /* ---- cl_longn ---- */
00904 typedef union
00905 {
00906     cl_long  CL_ALIGNED(16) s[2];
00907 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00908    __extension__ struct{ cl_long  x, y; };
00909    __extension__ struct{ cl_long  s0, s1; };
00910    __extension__ struct{ cl_long  lo, hi; };
00911 #endif
00912 #if defined( __CL_LONG2__) 
00913     __cl_long2     v2;
00914 #endif
00915 }cl_long2;
00916 
00917 typedef union
00918 {
00919     cl_long  CL_ALIGNED(32) s[4];
00920 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00921    __extension__ struct{ cl_long  x, y, z, w; };
00922    __extension__ struct{ cl_long  s0, s1, s2, s3; };
00923    __extension__ struct{ cl_long2 lo, hi; };
00924 #endif
00925 #if defined( __CL_LONG2__) 
00926     __cl_long2     v2[2];
00927 #endif
00928 #if defined( __CL_LONG4__) 
00929     __cl_long4     v4;
00930 #endif
00931 }cl_long4;
00932 
00933 /* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */
00934 typedef  cl_long4  cl_long3;
00935 
00936 typedef union
00937 {
00938     cl_long   CL_ALIGNED(64) s[8];
00939 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00940    __extension__ struct{ cl_long  x, y, z, w; };
00941    __extension__ struct{ cl_long  s0, s1, s2, s3, s4, s5, s6, s7; };
00942    __extension__ struct{ cl_long4 lo, hi; };
00943 #endif
00944 #if defined( __CL_LONG2__) 
00945     __cl_long2     v2[4];
00946 #endif
00947 #if defined( __CL_LONG4__) 
00948     __cl_long4     v4[2];
00949 #endif
00950 #if defined( __CL_LONG8__ )
00951     __cl_long8     v8;
00952 #endif
00953 }cl_long8;
00954 
00955 typedef union
00956 {
00957     cl_long  CL_ALIGNED(128) s[16];
00958 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00959    __extension__ struct{ cl_long  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
00960    __extension__ struct{ cl_long  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
00961    __extension__ struct{ cl_long8 lo, hi; };
00962 #endif
00963 #if defined( __CL_LONG2__) 
00964     __cl_long2     v2[8];
00965 #endif
00966 #if defined( __CL_LONG4__) 
00967     __cl_long4     v4[4];
00968 #endif
00969 #if defined( __CL_LONG8__ )
00970     __cl_long8     v8[2];
00971 #endif
00972 #if defined( __CL_LONG16__ )
00973     __cl_long16    v16;
00974 #endif
00975 }cl_long16;
00976 
00977 
00978 /* ---- cl_ulongn ---- */
00979 typedef union
00980 {
00981     cl_ulong  CL_ALIGNED(16) s[2];
00982 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00983    __extension__ struct{ cl_ulong  x, y; };
00984    __extension__ struct{ cl_ulong  s0, s1; };
00985    __extension__ struct{ cl_ulong  lo, hi; };
00986 #endif
00987 #if defined( __CL_ULONG2__) 
00988     __cl_ulong2     v2;
00989 #endif
00990 }cl_ulong2;
00991 
00992 typedef union
00993 {
00994     cl_ulong  CL_ALIGNED(32) s[4];
00995 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
00996    __extension__ struct{ cl_ulong  x, y, z, w; };
00997    __extension__ struct{ cl_ulong  s0, s1, s2, s3; };
00998    __extension__ struct{ cl_ulong2 lo, hi; };
00999 #endif
01000 #if defined( __CL_ULONG2__) 
01001     __cl_ulong2     v2[2];
01002 #endif
01003 #if defined( __CL_ULONG4__) 
01004     __cl_ulong4     v4;
01005 #endif
01006 }cl_ulong4;
01007 
01008 /* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */
01009 typedef  cl_ulong4  cl_ulong3;
01010 
01011 typedef union
01012 {
01013     cl_ulong   CL_ALIGNED(64) s[8];
01014 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01015    __extension__ struct{ cl_ulong  x, y, z, w; };
01016    __extension__ struct{ cl_ulong  s0, s1, s2, s3, s4, s5, s6, s7; };
01017    __extension__ struct{ cl_ulong4 lo, hi; };
01018 #endif
01019 #if defined( __CL_ULONG2__) 
01020     __cl_ulong2     v2[4];
01021 #endif
01022 #if defined( __CL_ULONG4__) 
01023     __cl_ulong4     v4[2];
01024 #endif
01025 #if defined( __CL_ULONG8__ )
01026     __cl_ulong8     v8;
01027 #endif
01028 }cl_ulong8;
01029 
01030 typedef union
01031 {
01032     cl_ulong  CL_ALIGNED(128) s[16];
01033 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01034    __extension__ struct{ cl_ulong  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
01035    __extension__ struct{ cl_ulong  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
01036    __extension__ struct{ cl_ulong8 lo, hi; };
01037 #endif
01038 #if defined( __CL_ULONG2__) 
01039     __cl_ulong2     v2[8];
01040 #endif
01041 #if defined( __CL_ULONG4__) 
01042     __cl_ulong4     v4[4];
01043 #endif
01044 #if defined( __CL_ULONG8__ )
01045     __cl_ulong8     v8[2];
01046 #endif
01047 #if defined( __CL_ULONG16__ )
01048     __cl_ulong16    v16;
01049 #endif
01050 }cl_ulong16;
01051 
01052 
01053 /* --- cl_floatn ---- */
01054 
01055 typedef union
01056 {
01057     cl_float  CL_ALIGNED(8) s[2];
01058 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01059    __extension__ struct{ cl_float  x, y; };
01060    __extension__ struct{ cl_float  s0, s1; };
01061    __extension__ struct{ cl_float  lo, hi; };
01062 #endif
01063 #if defined( __CL_FLOAT2__) 
01064     __cl_float2     v2;
01065 #endif
01066 }cl_float2;
01067 
01068 typedef union
01069 {
01070     cl_float  CL_ALIGNED(16) s[4];
01071 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01072    __extension__ struct{ cl_float   x, y, z, w; };
01073    __extension__ struct{ cl_float   s0, s1, s2, s3; };
01074    __extension__ struct{ cl_float2  lo, hi; };
01075 #endif
01076 #if defined( __CL_FLOAT2__) 
01077     __cl_float2     v2[2];
01078 #endif
01079 #if defined( __CL_FLOAT4__) 
01080     __cl_float4     v4;
01081 #endif
01082 }cl_float4;
01083 
01084 /* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */
01085 typedef  cl_float4  cl_float3;
01086 
01087 typedef union
01088 {
01089     cl_float   CL_ALIGNED(32) s[8];
01090 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01091    __extension__ struct{ cl_float   x, y, z, w; };
01092    __extension__ struct{ cl_float   s0, s1, s2, s3, s4, s5, s6, s7; };
01093    __extension__ struct{ cl_float4  lo, hi; };
01094 #endif
01095 #if defined( __CL_FLOAT2__) 
01096     __cl_float2     v2[4];
01097 #endif
01098 #if defined( __CL_FLOAT4__) 
01099     __cl_float4     v4[2];
01100 #endif
01101 #if defined( __CL_FLOAT8__ )
01102     __cl_float8     v8;
01103 #endif
01104 }cl_float8;
01105 
01106 typedef union
01107 {
01108     cl_float  CL_ALIGNED(64) s[16];
01109 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01110    __extension__ struct{ cl_float  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
01111    __extension__ struct{ cl_float  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
01112    __extension__ struct{ cl_float8 lo, hi; };
01113 #endif
01114 #if defined( __CL_FLOAT2__) 
01115     __cl_float2     v2[8];
01116 #endif
01117 #if defined( __CL_FLOAT4__) 
01118     __cl_float4     v4[4];
01119 #endif
01120 #if defined( __CL_FLOAT8__ )
01121     __cl_float8     v8[2];
01122 #endif
01123 #if defined( __CL_FLOAT16__ )
01124     __cl_float16    v16;
01125 #endif
01126 }cl_float16;
01127 
01128 /* --- cl_doublen ---- */
01129 
01130 typedef union
01131 {
01132     cl_double  CL_ALIGNED(16) s[2];
01133 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01134    __extension__ struct{ cl_double  x, y; };
01135    __extension__ struct{ cl_double s0, s1; };
01136    __extension__ struct{ cl_double lo, hi; };
01137 #endif
01138 #if defined( __CL_DOUBLE2__) 
01139     __cl_double2     v2;
01140 #endif
01141 }cl_double2;
01142 
01143 typedef union
01144 {
01145     cl_double  CL_ALIGNED(32) s[4];
01146 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01147    __extension__ struct{ cl_double  x, y, z, w; };
01148    __extension__ struct{ cl_double  s0, s1, s2, s3; };
01149    __extension__ struct{ cl_double2 lo, hi; };
01150 #endif
01151 #if defined( __CL_DOUBLE2__) 
01152     __cl_double2     v2[2];
01153 #endif
01154 #if defined( __CL_DOUBLE4__) 
01155     __cl_double4     v4;
01156 #endif
01157 }cl_double4;
01158 
01159 /* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */
01160 typedef  cl_double4  cl_double3;
01161 
01162 typedef union
01163 {
01164     cl_double   CL_ALIGNED(64) s[8];
01165 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01166    __extension__ struct{ cl_double  x, y, z, w; };
01167    __extension__ struct{ cl_double  s0, s1, s2, s3, s4, s5, s6, s7; };
01168    __extension__ struct{ cl_double4 lo, hi; };
01169 #endif
01170 #if defined( __CL_DOUBLE2__) 
01171     __cl_double2     v2[4];
01172 #endif
01173 #if defined( __CL_DOUBLE4__) 
01174     __cl_double4     v4[2];
01175 #endif
01176 #if defined( __CL_DOUBLE8__ )
01177     __cl_double8     v8;
01178 #endif
01179 }cl_double8;
01180 
01181 typedef union
01182 {
01183     cl_double  CL_ALIGNED(128) s[16];
01184 #if (defined( __GNUC__) ||  defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
01185    __extension__ struct{ cl_double  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
01186    __extension__ struct{ cl_double  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
01187    __extension__ struct{ cl_double8 lo, hi; };
01188 #endif
01189 #if defined( __CL_DOUBLE2__) 
01190     __cl_double2     v2[8];
01191 #endif
01192 #if defined( __CL_DOUBLE4__) 
01193     __cl_double4     v4[4];
01194 #endif
01195 #if defined( __CL_DOUBLE8__ )
01196     __cl_double8     v8[2];
01197 #endif
01198 #if defined( __CL_DOUBLE16__ )
01199     __cl_double16    v16;
01200 #endif
01201 }cl_double16;
01202 
01203 /* Macro to facilitate debugging 
01204  * Usage:
01205  *   Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source. 
01206  *   The first line ends with:   CL_PROGRAM_STRING_BEGIN \"
01207  *   Each line thereafter of OpenCL C source must end with: \n\
01208  *   The last line ends in ";
01209  *
01210  *   Example:
01211  *
01212  *   const char *my_program = CL_PROGRAM_STRING_BEGIN "\
01213  *   kernel void foo( int a, float * b )             \n\
01214  *   {                                               \n\
01215  *      // my comment                                \n\
01216  *      *b[ get_global_id(0)] = a;                   \n\
01217  *   }                                               \n\
01218  *   ";
01219  *
01220  * This should correctly set up the line, (column) and file information for your source 
01221  * string so you can do source level debugging.
01222  */
01223 #define  __CL_STRINGIFY( _x )               # _x
01224 #define  _CL_STRINGIFY( _x )                __CL_STRINGIFY( _x )
01225 #define  CL_PROGRAM_STRING_DEBUG_INFO       "#line "  _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n" 
01226   
01227 #ifdef __cplusplus
01228 }
01229 #endif
01230 
01231 #endif  /* __CL_PLATFORM_H  */
01232 
01233