1 #ifndef CLEW_HPP_INCLUDED 2 #define CLEW_HPP_INCLUDED 3 4 ////////////////////////////////////////////////////////////////////////// 5 // Copyright (c) 2009-2011 Organic Vectory B.V., KindDragon 6 // Written by George van Venrooij 7 // 8 // Distributed under the MIT License. 9 ////////////////////////////////////////////////////////////////////////// 10 11 //! \file clew.h 12 //! \brief OpenCL run-time loader header 13 //! 14 //! This file contains a copy of the contents of CL.H and CL_PLATFORM.H from the 15 //! official OpenCL spec. The purpose of this code is to load the OpenCL dynamic 16 //! library at run-time and thus allow the executable to function on many 17 //! platforms regardless of the vendor of the OpenCL driver actually installed. 18 //! Some of the techniques used here were inspired by work done in the GLEW 19 //! library (http://glew.sourceforge.net/) 20 21 // Run-time dynamic linking functionality based on concepts used in GLEW 22 #ifdef __OPENCL_CL_H 23 #error cl.h included before clew.h 24 #endif 25 26 #ifdef __OPENCL_CL_PLATFORM_H 27 #error cl_platform.h included before clew.h 28 #endif 29 30 // Prevent cl.h inclusion 31 #define __OPENCL_CL_H 32 // Prevent cl_platform.h inclusion 33 #define __CL_PLATFORM_H 34 35 /******************************************************************************* 36 * Copyright (c) 2008-2010 The Khronos Group Inc. 37 * 38 * Permission is hereby granted, free of charge, to any person obtaining a 39 * copy of this software and/or associated documentation files (the 40 * "Materials"), to deal in the Materials without restriction, including 41 * without limitation the rights to use, copy, modify, merge, publish, 42 * distribute, sublicense, and/or sell copies of the Materials, and to 43 * permit persons to whom the Materials are furnished to do so, subject to 44 * the following conditions: 45 * 46 * The above copyright notice and this permission notice shall be included 47 * in all copies or substantial portions of the Materials. 48 * 49 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 50 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 51 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 52 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 53 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 54 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 55 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 56 ******************************************************************************/ 57 #ifdef __APPLE__ 58 /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */ 59 #include <AvailabilityMacros.h> 60 #endif 61 62 #ifdef __cplusplus 63 extern "C" 64 { 65 #endif 66 67 #if defined(_WIN32) 68 #define CL_API_ENTRY 69 #define CL_API_CALL __stdcall 70 #define CL_CALLBACK __stdcall 71 #else 72 #define CL_API_ENTRY 73 #define CL_API_CALL 74 #define CL_CALLBACK 75 #endif 76 //disabled the APPLE thing, don't know why it is there, is just causes tons of warnings 77 78 #ifdef __APPLE1__ 79 #define CL_EXTENSION_WEAK_LINK __attribute__((weak_import)) 80 #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER 81 #define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER 82 #define CL_API_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK 83 #define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK 84 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER 85 #else 86 #define CL_EXTENSION_WEAK_LINK 87 #define CL_API_SUFFIX__VERSION_1_0 88 #define CL_EXT_SUFFIX__VERSION_1_0 89 #define CL_API_SUFFIX__VERSION_1_1 90 #define CL_EXT_SUFFIX__VERSION_1_1 91 #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED 92 #endif 93 94 #if (defined(_WIN32) && defined(_MSC_VER)) 95 96 /* scalar types */ 97 typedef signed __int8 cl_char; 98 typedef unsigned __int8 cl_uchar; 99 typedef signed __int16 cl_short; 100 typedef unsigned __int16 cl_ushort; 101 typedef signed __int32 cl_int; 102 typedef unsigned __int32 cl_uint; 103 typedef signed __int64 cl_long; 104 typedef unsigned __int64 cl_ulong; 105 106 typedef unsigned __int16 cl_half; 107 typedef float cl_float; 108 typedef double cl_double; 109 110 /* Macro names and corresponding values defined by OpenCL */ 111 #define CL_CHAR_BIT 8 112 #define CL_SCHAR_MAX 127 113 #define CL_SCHAR_MIN (-127 - 1) 114 #define CL_CHAR_MAX CL_SCHAR_MAX 115 #define CL_CHAR_MIN CL_SCHAR_MIN 116 #define CL_UCHAR_MAX 255 117 #define CL_SHRT_MAX 32767 118 #define CL_SHRT_MIN (-32767 - 1) 119 #define CL_USHRT_MAX 65535 120 #define CL_INT_MAX 2147483647 121 #define CL_INT_MIN (-2147483647 - 1) 122 #define CL_UINT_MAX 0xffffffffU 123 #define CL_LONG_MAX ((cl_long)0x7FFFFFFFFFFFFFFFLL) 124 #define CL_LONG_MIN ((cl_long)-0x7FFFFFFFFFFFFFFFLL - 1LL) 125 #define CL_ULONG_MAX ((cl_ulong)0xFFFFFFFFFFFFFFFFULL) 126 127 #define CL_FLT_DIG 6 128 #define CL_FLT_MANT_DIG 24 129 #define CL_FLT_MAX_10_EXP +38 130 #define CL_FLT_MAX_EXP +128 131 #define CL_FLT_MIN_10_EXP -37 132 #define CL_FLT_MIN_EXP -125 133 #define CL_FLT_RADIX 2 134 #define CL_FLT_MAX 340282346638528859811704183484516925440.0f 135 #define CL_FLT_MIN 1.175494350822287507969e-38f 136 #define CL_FLT_EPSILON 0x1.0p-23f 137 138 #define CL_DBL_DIG 15 139 #define CL_DBL_MANT_DIG 53 140 #define CL_DBL_MAX_10_EXP +308 141 #define CL_DBL_MAX_EXP +1024 142 #define CL_DBL_MIN_10_EXP -307 143 #define CL_DBL_MIN_EXP -1021 144 #define CL_DBL_RADIX 2 145 #define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 146 #define CL_DBL_MIN 2.225073858507201383090e-308 147 #define CL_DBL_EPSILON 2.220446049250313080847e-16 148 149 #define CL_M_E 2.718281828459045090796 150 #define CL_M_LOG2E 1.442695040888963387005 151 #define CL_M_LOG10E 0.434294481903251816668 152 #define CL_M_LN2 0.693147180559945286227 153 #define CL_M_LN10 2.302585092994045901094 154 #define CL_M_PI 3.141592653589793115998 155 #define CL_M_PI_2 1.570796326794896557999 156 #define CL_M_PI_4 0.785398163397448278999 157 #define CL_M_1_PI 0.318309886183790691216 158 #define CL_M_2_PI 0.636619772367581382433 159 #define CL_M_2_SQRTPI 1.128379167095512558561 160 #define CL_M_SQRT2 1.414213562373095145475 161 #define CL_M_SQRT1_2 0.707106781186547572737 162 163 #define CL_M_E_F 2.71828174591064f 164 #define CL_M_LOG2E_F 1.44269502162933f 165 #define CL_M_LOG10E_F 0.43429449200630f 166 #define CL_M_LN2_F 0.69314718246460f 167 #define CL_M_LN10_F 2.30258512496948f 168 #define CL_M_PI_F 3.14159274101257f 169 #define CL_M_PI_2_F 1.57079637050629f 170 #define CL_M_PI_4_F 0.78539818525314f 171 #define CL_M_1_PI_F 0.31830987334251f 172 #define CL_M_2_PI_F 0.63661974668503f 173 #define CL_M_2_SQRTPI_F 1.12837922573090f 174 #define CL_M_SQRT2_F 1.41421353816986f 175 #define CL_M_SQRT1_2_F 0.70710676908493f 176 177 #define CL_NAN (CL_INFINITY - CL_INFINITY) 178 #define CL_HUGE_VALF ((cl_float)1e50) 179 #define CL_HUGE_VAL ((cl_double)1e500) 180 #define CL_MAXFLOAT CL_FLT_MAX 181 #define CL_INFINITY CL_HUGE_VALF 182 183 #else 184 185 #include <stdint.h> 186 187 /* scalar types */ 188 typedef int8_t cl_char; 189 typedef uint8_t cl_uchar; 190 typedef int16_t cl_short __attribute__((aligned(2))); 191 typedef uint16_t cl_ushort __attribute__((aligned(2))); 192 typedef int32_t cl_int __attribute__((aligned(4))); 193 typedef uint32_t cl_uint __attribute__((aligned(4))); 194 typedef int64_t cl_long __attribute__((aligned(8))); 195 typedef uint64_t cl_ulong __attribute__((aligned(8))); 196 197 typedef uint16_t cl_half __attribute__((aligned(2))); 198 typedef float cl_float __attribute__((aligned(4))); 199 typedef double cl_double __attribute__((aligned(8))); 200 201 /* Macro names and corresponding values defined by OpenCL */ 202 #define CL_CHAR_BIT 8 203 #define CL_SCHAR_MAX 127 204 #define CL_SCHAR_MIN (-127 - 1) 205 #define CL_CHAR_MAX CL_SCHAR_MAX 206 #define CL_CHAR_MIN CL_SCHAR_MIN 207 #define CL_UCHAR_MAX 255 208 #define CL_SHRT_MAX 32767 209 #define CL_SHRT_MIN (-32767 - 1) 210 #define CL_USHRT_MAX 65535 211 #define CL_INT_MAX 2147483647 212 #define CL_INT_MIN (-2147483647 - 1) 213 #define CL_UINT_MAX 0xffffffffU 214 #define CL_LONG_MAX ((cl_long)0x7FFFFFFFFFFFFFFFLL) 215 #define CL_LONG_MIN ((cl_long)-0x7FFFFFFFFFFFFFFFLL - 1LL) 216 #define CL_ULONG_MAX ((cl_ulong)0xFFFFFFFFFFFFFFFFULL) 217 218 #define CL_FLT_DIG 6 219 #define CL_FLT_MANT_DIG 24 220 #define CL_FLT_MAX_10_EXP +38 221 #define CL_FLT_MAX_EXP +128 222 #define CL_FLT_MIN_10_EXP -37 223 #define CL_FLT_MIN_EXP -125 224 #define CL_FLT_RADIX 2 225 #define CL_FLT_MAX 0x1.fffffep127f 226 #define CL_FLT_MIN 0x1.0p-126f 227 #define CL_FLT_EPSILON 0x1.0p-23f 228 229 #define CL_DBL_DIG 15 230 #define CL_DBL_MANT_DIG 53 231 #define CL_DBL_MAX_10_EXP +308 232 #define CL_DBL_MAX_EXP +1024 233 #define CL_DBL_MIN_10_EXP -307 234 #define CL_DBL_MIN_EXP -1021 235 #define CL_DBL_RADIX 2 236 #define CL_DBL_MAX 0x1.fffffffffffffp1023 237 #define CL_DBL_MIN 0x1.0p-1022 238 #define CL_DBL_EPSILON 0x1.0p-52 239 240 #define CL_M_E 2.718281828459045090796 241 #define CL_M_LOG2E 1.442695040888963387005 242 #define CL_M_LOG10E 0.434294481903251816668 243 #define CL_M_LN2 0.693147180559945286227 244 #define CL_M_LN10 2.302585092994045901094 245 #define CL_M_PI 3.141592653589793115998 246 #define CL_M_PI_2 1.570796326794896557999 247 #define CL_M_PI_4 0.785398163397448278999 248 #define CL_M_1_PI 0.318309886183790691216 249 #define CL_M_2_PI 0.636619772367581382433 250 #define CL_M_2_SQRTPI 1.128379167095512558561 251 #define CL_M_SQRT2 1.414213562373095145475 252 #define CL_M_SQRT1_2 0.707106781186547572737 253 254 #define CL_M_E_F 2.71828174591064f 255 #define CL_M_LOG2E_F 1.44269502162933f 256 #define CL_M_LOG10E_F 0.43429449200630f 257 #define CL_M_LN2_F 0.69314718246460f 258 #define CL_M_LN10_F 2.30258512496948f 259 #define CL_M_PI_F 3.14159274101257f 260 #define CL_M_PI_2_F 1.57079637050629f 261 #define CL_M_PI_4_F 0.78539818525314f 262 #define CL_M_1_PI_F 0.31830987334251f 263 #define CL_M_2_PI_F 0.63661974668503f 264 #define CL_M_2_SQRTPI_F 1.12837922573090f 265 #define CL_M_SQRT2_F 1.41421353816986f 266 #define CL_M_SQRT1_2_F 0.70710676908493f 267 268 #if defined(__GNUC__) 269 #define CL_HUGE_VALF __builtin_huge_valf() 270 #define CL_HUGE_VAL __builtin_huge_val() 271 #define CL_NAN __builtin_nanf("") 272 #else 273 #define CL_HUGE_VALF ((cl_float)1e50) 274 #define CL_HUGE_VAL ((cl_double)1e500) 275 float nanf(const char *); 276 #define CL_NAN nanf("") 277 #endif 278 #define CL_MAXFLOAT CL_FLT_MAX 279 #define CL_INFINITY CL_HUGE_VALF 280 281 #endif 282 283 #include <stddef.h> 284 285 /* 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. */ 286 typedef unsigned int cl_GLuint; 287 typedef int cl_GLint; 288 typedef unsigned int cl_GLenum; 289 290 /* 291 * Vector types 292 * 293 * Note: OpenCL requires that all types be naturally aligned. 294 * This means that vector types must be naturally aligned. 295 * For example, a vector of four floats must be aligned to 296 * a 16 byte boundary (calculated as 4 * the natural 4-byte 297 * alignment of the float). The alignment qualifiers here 298 * will only function properly if your compiler supports them 299 * and if you don't actively work to defeat them. For example, 300 * in order for a cl_float4 to be 16 byte aligned in a struct, 301 * the start of the struct must itself be 16-byte aligned. 302 * 303 * Maintaining proper alignment is the user's responsibility. 304 */ 305 306 #ifdef _MSC_VER 307 #if defined(_M_IX86) 308 #if _M_IX86_FP >= 0 309 #define __SSE__ 310 #endif 311 #if _M_IX86_FP >= 1 312 #define __SSE2__ 313 #endif 314 #elif defined(_M_X64) 315 #define __SSE__ 316 #define __SSE2__ 317 #endif 318 #endif 319 320 /* Define basic vector types */ 321 #if defined(__VEC__) 322 #include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */ 323 typedef vector unsigned char __cl_uchar16; 324 typedef vector signed char __cl_char16; 325 typedef vector unsigned short __cl_ushort8; 326 typedef vector signed short __cl_short8; 327 typedef vector unsigned int __cl_uint4; 328 typedef vector signed int __cl_int4; 329 typedef vector float __cl_float4; 330 #define __CL_UCHAR16__ 1 331 #define __CL_CHAR16__ 1 332 #define __CL_USHORT8__ 1 333 #define __CL_SHORT8__ 1 334 #define __CL_UINT4__ 1 335 #define __CL_INT4__ 1 336 #define __CL_FLOAT4__ 1 337 #endif 338 339 #if defined(__SSE__) 340 #if defined(__MINGW64__) 341 #include <intrin.h> 342 #else 343 #include <xmmintrin.h> 344 #endif 345 #if defined(__GNUC__) && !defined(__ICC) 346 typedef float __cl_float4 __attribute__((vector_size(16))); 347 #else 348 typedef __m128 __cl_float4; 349 #endif 350 #define __CL_FLOAT4__ 1 351 #endif 352 353 #if defined(__SSE2__) 354 #if defined(__MINGW64__) 355 #include <intrin.h> 356 #else 357 #include <emmintrin.h> 358 #endif 359 #if defined(__GNUC__) && !defined(__ICC) 360 typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16))); 361 typedef cl_char __cl_char16 __attribute__((vector_size(16))); 362 typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16))); 363 typedef cl_short __cl_short8 __attribute__((vector_size(16))); 364 typedef cl_uint __cl_uint4 __attribute__((vector_size(16))); 365 typedef cl_int __cl_int4 __attribute__((vector_size(16))); 366 typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16))); 367 typedef cl_long __cl_long2 __attribute__((vector_size(16))); 368 typedef cl_double __cl_double2 __attribute__((vector_size(16))); 369 #else 370 typedef __m128i __cl_uchar16; 371 typedef __m128i __cl_char16; 372 typedef __m128i __cl_ushort8; 373 typedef __m128i __cl_short8; 374 typedef __m128i __cl_uint4; 375 typedef __m128i __cl_int4; 376 typedef __m128i __cl_ulong2; 377 typedef __m128i __cl_long2; 378 typedef __m128d __cl_double2; 379 #endif 380 #define __CL_UCHAR16__ 1 381 #define __CL_CHAR16__ 1 382 #define __CL_USHORT8__ 1 383 #define __CL_SHORT8__ 1 384 #define __CL_INT4__ 1 385 #define __CL_UINT4__ 1 386 #define __CL_ULONG2__ 1 387 #define __CL_LONG2__ 1 388 #define __CL_DOUBLE2__ 1 389 #endif 390 391 #if defined(__MMX__) 392 #include <mmintrin.h> 393 #if defined(__GNUC__) && !defined(__ICC) 394 typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8))); 395 typedef cl_char __cl_char8 __attribute__((vector_size(8))); 396 typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8))); 397 typedef cl_short __cl_short4 __attribute__((vector_size(8))); 398 typedef cl_uint __cl_uint2 __attribute__((vector_size(8))); 399 typedef cl_int __cl_int2 __attribute__((vector_size(8))); 400 typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8))); 401 typedef cl_long __cl_long1 __attribute__((vector_size(8))); 402 typedef cl_float __cl_float2 __attribute__((vector_size(8))); 403 #else 404 typedef __m64 __cl_uchar8; 405 typedef __m64 __cl_char8; 406 typedef __m64 __cl_ushort4; 407 typedef __m64 __cl_short4; 408 typedef __m64 __cl_uint2; 409 typedef __m64 __cl_int2; 410 typedef __m64 __cl_ulong1; 411 typedef __m64 __cl_long1; 412 typedef __m64 __cl_float2; 413 #endif 414 #define __CL_UCHAR8__ 1 415 #define __CL_CHAR8__ 1 416 #define __CL_USHORT4__ 1 417 #define __CL_SHORT4__ 1 418 #define __CL_INT2__ 1 419 #define __CL_UINT2__ 1 420 #define __CL_ULONG1__ 1 421 #define __CL_LONG1__ 1 422 #define __CL_FLOAT2__ 1 423 #endif 424 425 #if defined(__AVX__) 426 #if defined(__MINGW64__) 427 #include <intrin.h> 428 #else 429 #include <immintrin.h> 430 #endif 431 #if defined(__GNUC__) && !defined(__ICC) 432 typedef cl_float __cl_float8 __attribute__((vector_size(32))); 433 typedef cl_double __cl_double4 __attribute__((vector_size(32))); 434 #else 435 typedef __m256 __cl_float8; 436 typedef __m256d __cl_double4; 437 #endif 438 #define __CL_FLOAT8__ 1 439 #define __CL_DOUBLE4__ 1 440 #endif 441 442 /* Define alignment keys */ 443 #if defined(__GNUC__) 444 #define CL_ALIGNED(_x) __attribute__((aligned(_x))) 445 #elif defined(_WIN32) && (_MSC_VER) 446 /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */ 447 /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */ 448 /* #include <crtdefs.h> */ 449 /* #define CL_ALIGNED(_x) _CRT_ALIGN(_x) */ 450 #define CL_ALIGNED(_x) 451 #else 452 #warning Need to implement some method to align data here 453 #define CL_ALIGNED(_x) 454 #endif 455 456 /* Indicate whether .xyzw, .s0123 and .hi.lo are supported */ 457 #if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || (defined(_MSC_VER) && !defined(__STDC__)) 458 /* .xyzw and .s0123...{f|F} are supported */ 459 #define CL_HAS_NAMED_VECTOR_FIELDS 1 460 /* .hi and .lo are supported */ 461 #define CL_HAS_HI_LO_VECTOR_FIELDS 1 462 463 #define CL_NAMED_STRUCT_SUPPORTED 464 #endif 465 466 #if defined(CL_NAMED_STRUCT_SUPPORTED) && defined(_MSC_VER) 467 #define __extension__ __pragma(warning(suppress : 4201)) 468 #endif 469 470 /* Define cl_vector types */ 471 472 /* ---- cl_charn ---- */ 473 typedef union { 474 cl_char CL_ALIGNED(2) s[2]; 475 #if defined(CL_NAMED_STRUCT_SUPPORTED) 476 __extension__ struct 477 { 478 cl_char x, y; 479 }; 480 __extension__ struct 481 { 482 cl_char s0, s1; 483 }; 484 __extension__ struct 485 { 486 cl_char lo, hi; 487 }; 488 #endif 489 #if defined(__CL_CHAR2__) 490 __cl_char2 v2; 491 #endif 492 } cl_char2; 493 494 typedef union { 495 cl_char CL_ALIGNED(4) s[4]; 496 #if defined(CL_NAMED_STRUCT_SUPPORTED) 497 __extension__ struct 498 { 499 cl_char x, y, z, w; 500 }; 501 __extension__ struct 502 { 503 cl_char s0, s1, s2, s3; 504 }; 505 __extension__ struct 506 { 507 cl_char2 lo, hi; 508 }; 509 #endif 510 #if defined(__CL_CHAR2__) 511 __cl_char2 v2[2]; 512 #endif 513 #if defined(__CL_CHAR4__) 514 __cl_char4 v4; 515 #endif 516 } cl_char4; 517 518 /* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */ 519 typedef cl_char4 cl_char3; 520 521 typedef union { 522 cl_char CL_ALIGNED(8) s[8]; 523 #if defined(CL_NAMED_STRUCT_SUPPORTED) 524 __extension__ struct 525 { 526 cl_char x, y, z, w; 527 }; 528 __extension__ struct 529 { 530 cl_char s0, s1, s2, s3, s4, s5, s6, s7; 531 }; 532 __extension__ struct 533 { 534 cl_char4 lo, hi; 535 }; 536 #endif 537 #if defined(__CL_CHAR2__) 538 __cl_char2 v2[4]; 539 #endif 540 #if defined(__CL_CHAR4__) 541 __cl_char4 v4[2]; 542 #endif 543 #if defined(__CL_CHAR8__) 544 __cl_char8 v8; 545 #endif 546 } cl_char8; 547 548 typedef union { 549 cl_char CL_ALIGNED(16) s[16]; 550 #if defined(CL_NAMED_STRUCT_SUPPORTED) 551 __extension__ struct 552 { 553 cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 554 }; 555 __extension__ struct 556 { 557 cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 558 }; 559 __extension__ struct 560 { 561 cl_char8 lo, hi; 562 }; 563 #endif 564 #if defined(__CL_CHAR2__) 565 __cl_char2 v2[8]; 566 #endif 567 #if defined(__CL_CHAR4__) 568 __cl_char4 v4[4]; 569 #endif 570 #if defined(__CL_CHAR8__) 571 __cl_char8 v8[2]; 572 #endif 573 #if defined(__CL_CHAR16__) 574 __cl_char16 v16; 575 #endif 576 } cl_char16; 577 578 /* ---- cl_ucharn ---- */ 579 typedef union { 580 cl_uchar CL_ALIGNED(2) s[2]; 581 #if defined(CL_NAMED_STRUCT_SUPPORTED) 582 __extension__ struct 583 { 584 cl_uchar x, y; 585 }; 586 __extension__ struct 587 { 588 cl_uchar s0, s1; 589 }; 590 __extension__ struct 591 { 592 cl_uchar lo, hi; 593 }; 594 #endif 595 #if defined(__cl_uchar2__) 596 __cl_uchar2 v2; 597 #endif 598 } cl_uchar2; 599 600 typedef union { 601 cl_uchar CL_ALIGNED(4) s[4]; 602 #if defined(CL_NAMED_STRUCT_SUPPORTED) 603 __extension__ struct 604 { 605 cl_uchar x, y, z, w; 606 }; 607 __extension__ struct 608 { 609 cl_uchar s0, s1, s2, s3; 610 }; 611 __extension__ struct 612 { 613 cl_uchar2 lo, hi; 614 }; 615 #endif 616 #if defined(__CL_UCHAR2__) 617 __cl_uchar2 v2[2]; 618 #endif 619 #if defined(__CL_UCHAR4__) 620 __cl_uchar4 v4; 621 #endif 622 } cl_uchar4; 623 624 /* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */ 625 typedef cl_uchar4 cl_uchar3; 626 627 typedef union { 628 cl_uchar CL_ALIGNED(8) s[8]; 629 #if defined(CL_NAMED_STRUCT_SUPPORTED) 630 __extension__ struct 631 { 632 cl_uchar x, y, z, w; 633 }; 634 __extension__ struct 635 { 636 cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; 637 }; 638 __extension__ struct 639 { 640 cl_uchar4 lo, hi; 641 }; 642 #endif 643 #if defined(__CL_UCHAR2__) 644 __cl_uchar2 v2[4]; 645 #endif 646 #if defined(__CL_UCHAR4__) 647 __cl_uchar4 v4[2]; 648 #endif 649 #if defined(__CL_UCHAR8__) 650 __cl_uchar8 v8; 651 #endif 652 } cl_uchar8; 653 654 typedef union { 655 cl_uchar CL_ALIGNED(16) s[16]; 656 #if defined(CL_NAMED_STRUCT_SUPPORTED) 657 __extension__ struct 658 { 659 cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 660 }; 661 __extension__ struct 662 { 663 cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 664 }; 665 __extension__ struct 666 { 667 cl_uchar8 lo, hi; 668 }; 669 #endif 670 #if defined(__CL_UCHAR2__) 671 __cl_uchar2 v2[8]; 672 #endif 673 #if defined(__CL_UCHAR4__) 674 __cl_uchar4 v4[4]; 675 #endif 676 #if defined(__CL_UCHAR8__) 677 __cl_uchar8 v8[2]; 678 #endif 679 #if defined(__CL_UCHAR16__) 680 __cl_uchar16 v16; 681 #endif 682 } cl_uchar16; 683 684 /* ---- cl_shortn ---- */ 685 typedef union { 686 cl_short CL_ALIGNED(4) s[2]; 687 #if defined(CL_NAMED_STRUCT_SUPPORTED) 688 __extension__ struct 689 { 690 cl_short x, y; 691 }; 692 __extension__ struct 693 { 694 cl_short s0, s1; 695 }; 696 __extension__ struct 697 { 698 cl_short lo, hi; 699 }; 700 #endif 701 #if defined(__CL_SHORT2__) 702 __cl_short2 v2; 703 #endif 704 } cl_short2; 705 706 typedef union { 707 cl_short CL_ALIGNED(8) s[4]; 708 #if defined(CL_NAMED_STRUCT_SUPPORTED) 709 __extension__ struct 710 { 711 cl_short x, y, z, w; 712 }; 713 __extension__ struct 714 { 715 cl_short s0, s1, s2, s3; 716 }; 717 __extension__ struct 718 { 719 cl_short2 lo, hi; 720 }; 721 #endif 722 #if defined(__CL_SHORT2__) 723 __cl_short2 v2[2]; 724 #endif 725 #if defined(__CL_SHORT4__) 726 __cl_short4 v4; 727 #endif 728 } cl_short4; 729 730 /* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */ 731 typedef cl_short4 cl_short3; 732 733 typedef union { 734 cl_short CL_ALIGNED(16) s[8]; 735 #if defined(CL_NAMED_STRUCT_SUPPORTED) 736 __extension__ struct 737 { 738 cl_short x, y, z, w; 739 }; 740 __extension__ struct 741 { 742 cl_short s0, s1, s2, s3, s4, s5, s6, s7; 743 }; 744 __extension__ struct 745 { 746 cl_short4 lo, hi; 747 }; 748 #endif 749 #if defined(__CL_SHORT2__) 750 __cl_short2 v2[4]; 751 #endif 752 #if defined(__CL_SHORT4__) 753 __cl_short4 v4[2]; 754 #endif 755 #if defined(__CL_SHORT8__) 756 __cl_short8 v8; 757 #endif 758 } cl_short8; 759 760 typedef union { 761 cl_short CL_ALIGNED(32) s[16]; 762 #if defined(CL_NAMED_STRUCT_SUPPORTED) 763 __extension__ struct 764 { 765 cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 766 }; 767 __extension__ struct 768 { 769 cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 770 }; 771 __extension__ struct 772 { 773 cl_short8 lo, hi; 774 }; 775 #endif 776 #if defined(__CL_SHORT2__) 777 __cl_short2 v2[8]; 778 #endif 779 #if defined(__CL_SHORT4__) 780 __cl_short4 v4[4]; 781 #endif 782 #if defined(__CL_SHORT8__) 783 __cl_short8 v8[2]; 784 #endif 785 #if defined(__CL_SHORT16__) 786 __cl_short16 v16; 787 #endif 788 } cl_short16; 789 790 /* ---- cl_ushortn ---- */ 791 typedef union { 792 cl_ushort CL_ALIGNED(4) s[2]; 793 #if defined(CL_NAMED_STRUCT_SUPPORTED) 794 __extension__ struct 795 { 796 cl_ushort x, y; 797 }; 798 __extension__ struct 799 { 800 cl_ushort s0, s1; 801 }; 802 __extension__ struct 803 { 804 cl_ushort lo, hi; 805 }; 806 #endif 807 #if defined(__CL_USHORT2__) 808 __cl_ushort2 v2; 809 #endif 810 } cl_ushort2; 811 812 typedef union { 813 cl_ushort CL_ALIGNED(8) s[4]; 814 #if defined(CL_NAMED_STRUCT_SUPPORTED) 815 __extension__ struct 816 { 817 cl_ushort x, y, z, w; 818 }; 819 __extension__ struct 820 { 821 cl_ushort s0, s1, s2, s3; 822 }; 823 __extension__ struct 824 { 825 cl_ushort2 lo, hi; 826 }; 827 #endif 828 #if defined(__CL_USHORT2__) 829 __cl_ushort2 v2[2]; 830 #endif 831 #if defined(__CL_USHORT4__) 832 __cl_ushort4 v4; 833 #endif 834 } cl_ushort4; 835 836 /* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */ 837 typedef cl_ushort4 cl_ushort3; 838 839 typedef union { 840 cl_ushort CL_ALIGNED(16) s[8]; 841 #if defined(CL_NAMED_STRUCT_SUPPORTED) 842 __extension__ struct 843 { 844 cl_ushort x, y, z, w; 845 }; 846 __extension__ struct 847 { 848 cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; 849 }; 850 __extension__ struct 851 { 852 cl_ushort4 lo, hi; 853 }; 854 #endif 855 #if defined(__CL_USHORT2__) 856 __cl_ushort2 v2[4]; 857 #endif 858 #if defined(__CL_USHORT4__) 859 __cl_ushort4 v4[2]; 860 #endif 861 #if defined(__CL_USHORT8__) 862 __cl_ushort8 v8; 863 #endif 864 } cl_ushort8; 865 866 typedef union { 867 cl_ushort CL_ALIGNED(32) s[16]; 868 #if defined(CL_NAMED_STRUCT_SUPPORTED) 869 __extension__ struct 870 { 871 cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 872 }; 873 __extension__ struct 874 { 875 cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 876 }; 877 __extension__ struct 878 { 879 cl_ushort8 lo, hi; 880 }; 881 #endif 882 #if defined(__CL_USHORT2__) 883 __cl_ushort2 v2[8]; 884 #endif 885 #if defined(__CL_USHORT4__) 886 __cl_ushort4 v4[4]; 887 #endif 888 #if defined(__CL_USHORT8__) 889 __cl_ushort8 v8[2]; 890 #endif 891 #if defined(__CL_USHORT16__) 892 __cl_ushort16 v16; 893 #endif 894 } cl_ushort16; 895 896 /* ---- cl_intn ---- */ 897 typedef union { 898 cl_int CL_ALIGNED(8) s[2]; 899 #if defined(CL_NAMED_STRUCT_SUPPORTED) 900 __extension__ struct 901 { 902 cl_int x, y; 903 }; 904 __extension__ struct 905 { 906 cl_int s0, s1; 907 }; 908 __extension__ struct 909 { 910 cl_int lo, hi; 911 }; 912 #endif 913 #if defined(__CL_INT2__) 914 __cl_int2 v2; 915 #endif 916 } cl_int2; 917 918 typedef union { 919 cl_int CL_ALIGNED(16) s[4]; 920 #if defined(CL_NAMED_STRUCT_SUPPORTED) 921 __extension__ struct 922 { 923 cl_int x, y, z, w; 924 }; 925 __extension__ struct 926 { 927 cl_int s0, s1, s2, s3; 928 }; 929 __extension__ struct 930 { 931 cl_int2 lo, hi; 932 }; 933 #endif 934 #if defined(__CL_INT2__) 935 __cl_int2 v2[2]; 936 #endif 937 #if defined(__CL_INT4__) 938 __cl_int4 v4; 939 #endif 940 } cl_int4; 941 942 /* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */ 943 typedef cl_int4 cl_int3; 944 945 typedef union { 946 cl_int CL_ALIGNED(32) s[8]; 947 #if defined(CL_NAMED_STRUCT_SUPPORTED) 948 __extension__ struct 949 { 950 cl_int x, y, z, w; 951 }; 952 __extension__ struct 953 { 954 cl_int s0, s1, s2, s3, s4, s5, s6, s7; 955 }; 956 __extension__ struct 957 { 958 cl_int4 lo, hi; 959 }; 960 #endif 961 #if defined(__CL_INT2__) 962 __cl_int2 v2[4]; 963 #endif 964 #if defined(__CL_INT4__) 965 __cl_int4 v4[2]; 966 #endif 967 #if defined(__CL_INT8__) 968 __cl_int8 v8; 969 #endif 970 } cl_int8; 971 972 typedef union { 973 cl_int CL_ALIGNED(64) s[16]; 974 #if defined(CL_NAMED_STRUCT_SUPPORTED) 975 __extension__ struct 976 { 977 cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 978 }; 979 __extension__ struct 980 { 981 cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 982 }; 983 __extension__ struct 984 { 985 cl_int8 lo, hi; 986 }; 987 #endif 988 #if defined(__CL_INT2__) 989 __cl_int2 v2[8]; 990 #endif 991 #if defined(__CL_INT4__) 992 __cl_int4 v4[4]; 993 #endif 994 #if defined(__CL_INT8__) 995 __cl_int8 v8[2]; 996 #endif 997 #if defined(__CL_INT16__) 998 __cl_int16 v16; 999 #endif 1000 } cl_int16; 1001 1002 /* ---- cl_uintn ---- */ 1003 typedef union { 1004 cl_uint CL_ALIGNED(8) s[2]; 1005 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1006 __extension__ struct 1007 { 1008 cl_uint x, y; 1009 }; 1010 __extension__ struct 1011 { 1012 cl_uint s0, s1; 1013 }; 1014 __extension__ struct 1015 { 1016 cl_uint lo, hi; 1017 }; 1018 #endif 1019 #if defined(__CL_UINT2__) 1020 __cl_uint2 v2; 1021 #endif 1022 } cl_uint2; 1023 1024 typedef union { 1025 cl_uint CL_ALIGNED(16) s[4]; 1026 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1027 __extension__ struct 1028 { 1029 cl_uint x, y, z, w; 1030 }; 1031 __extension__ struct 1032 { 1033 cl_uint s0, s1, s2, s3; 1034 }; 1035 __extension__ struct 1036 { 1037 cl_uint2 lo, hi; 1038 }; 1039 #endif 1040 #if defined(__CL_UINT2__) 1041 __cl_uint2 v2[2]; 1042 #endif 1043 #if defined(__CL_UINT4__) 1044 __cl_uint4 v4; 1045 #endif 1046 } cl_uint4; 1047 1048 /* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */ 1049 typedef cl_uint4 cl_uint3; 1050 1051 typedef union { 1052 cl_uint CL_ALIGNED(32) s[8]; 1053 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1054 __extension__ struct 1055 { 1056 cl_uint x, y, z, w; 1057 }; 1058 __extension__ struct 1059 { 1060 cl_uint s0, s1, s2, s3, s4, s5, s6, s7; 1061 }; 1062 __extension__ struct 1063 { 1064 cl_uint4 lo, hi; 1065 }; 1066 #endif 1067 #if defined(__CL_UINT2__) 1068 __cl_uint2 v2[4]; 1069 #endif 1070 #if defined(__CL_UINT4__) 1071 __cl_uint4 v4[2]; 1072 #endif 1073 #if defined(__CL_UINT8__) 1074 __cl_uint8 v8; 1075 #endif 1076 } cl_uint8; 1077 1078 typedef union { 1079 cl_uint CL_ALIGNED(64) s[16]; 1080 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1081 __extension__ struct 1082 { 1083 cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 1084 }; 1085 __extension__ struct 1086 { 1087 cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 1088 }; 1089 __extension__ struct 1090 { 1091 cl_uint8 lo, hi; 1092 }; 1093 #endif 1094 #if defined(__CL_UINT2__) 1095 __cl_uint2 v2[8]; 1096 #endif 1097 #if defined(__CL_UINT4__) 1098 __cl_uint4 v4[4]; 1099 #endif 1100 #if defined(__CL_UINT8__) 1101 __cl_uint8 v8[2]; 1102 #endif 1103 #if defined(__CL_UINT16__) 1104 __cl_uint16 v16; 1105 #endif 1106 } cl_uint16; 1107 1108 /* ---- cl_longn ---- */ 1109 typedef union { 1110 cl_long CL_ALIGNED(16) s[2]; 1111 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1112 __extension__ struct 1113 { 1114 cl_long x, y; 1115 }; 1116 __extension__ struct 1117 { 1118 cl_long s0, s1; 1119 }; 1120 __extension__ struct 1121 { 1122 cl_long lo, hi; 1123 }; 1124 #endif 1125 #if defined(__CL_LONG2__) 1126 __cl_long2 v2; 1127 #endif 1128 } cl_long2; 1129 1130 typedef union { 1131 cl_long CL_ALIGNED(32) s[4]; 1132 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1133 __extension__ struct 1134 { 1135 cl_long x, y, z, w; 1136 }; 1137 __extension__ struct 1138 { 1139 cl_long s0, s1, s2, s3; 1140 }; 1141 __extension__ struct 1142 { 1143 cl_long2 lo, hi; 1144 }; 1145 #endif 1146 #if defined(__CL_LONG2__) 1147 __cl_long2 v2[2]; 1148 #endif 1149 #if defined(__CL_LONG4__) 1150 __cl_long4 v4; 1151 #endif 1152 } cl_long4; 1153 1154 /* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */ 1155 typedef cl_long4 cl_long3; 1156 1157 typedef union { 1158 cl_long CL_ALIGNED(64) s[8]; 1159 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1160 __extension__ struct 1161 { 1162 cl_long x, y, z, w; 1163 }; 1164 __extension__ struct 1165 { 1166 cl_long s0, s1, s2, s3, s4, s5, s6, s7; 1167 }; 1168 __extension__ struct 1169 { 1170 cl_long4 lo, hi; 1171 }; 1172 #endif 1173 #if defined(__CL_LONG2__) 1174 __cl_long2 v2[4]; 1175 #endif 1176 #if defined(__CL_LONG4__) 1177 __cl_long4 v4[2]; 1178 #endif 1179 #if defined(__CL_LONG8__) 1180 __cl_long8 v8; 1181 #endif 1182 } cl_long8; 1183 1184 typedef union { 1185 cl_long CL_ALIGNED(128) s[16]; 1186 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1187 __extension__ struct 1188 { 1189 cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 1190 }; 1191 __extension__ struct 1192 { 1193 cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 1194 }; 1195 __extension__ struct 1196 { 1197 cl_long8 lo, hi; 1198 }; 1199 #endif 1200 #if defined(__CL_LONG2__) 1201 __cl_long2 v2[8]; 1202 #endif 1203 #if defined(__CL_LONG4__) 1204 __cl_long4 v4[4]; 1205 #endif 1206 #if defined(__CL_LONG8__) 1207 __cl_long8 v8[2]; 1208 #endif 1209 #if defined(__CL_LONG16__) 1210 __cl_long16 v16; 1211 #endif 1212 } cl_long16; 1213 1214 /* ---- cl_ulongn ---- */ 1215 typedef union { 1216 cl_ulong CL_ALIGNED(16) s[2]; 1217 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1218 __extension__ struct 1219 { 1220 cl_ulong x, y; 1221 }; 1222 __extension__ struct 1223 { 1224 cl_ulong s0, s1; 1225 }; 1226 __extension__ struct 1227 { 1228 cl_ulong lo, hi; 1229 }; 1230 #endif 1231 #if defined(__CL_ULONG2__) 1232 __cl_ulong2 v2; 1233 #endif 1234 } cl_ulong2; 1235 1236 typedef union { 1237 cl_ulong CL_ALIGNED(32) s[4]; 1238 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1239 __extension__ struct 1240 { 1241 cl_ulong x, y, z, w; 1242 }; 1243 __extension__ struct 1244 { 1245 cl_ulong s0, s1, s2, s3; 1246 }; 1247 __extension__ struct 1248 { 1249 cl_ulong2 lo, hi; 1250 }; 1251 #endif 1252 #if defined(__CL_ULONG2__) 1253 __cl_ulong2 v2[2]; 1254 #endif 1255 #if defined(__CL_ULONG4__) 1256 __cl_ulong4 v4; 1257 #endif 1258 } cl_ulong4; 1259 1260 /* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */ 1261 typedef cl_ulong4 cl_ulong3; 1262 1263 typedef union { 1264 cl_ulong CL_ALIGNED(64) s[8]; 1265 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1266 __extension__ struct 1267 { 1268 cl_ulong x, y, z, w; 1269 }; 1270 __extension__ struct 1271 { 1272 cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; 1273 }; 1274 __extension__ struct 1275 { 1276 cl_ulong4 lo, hi; 1277 }; 1278 #endif 1279 #if defined(__CL_ULONG2__) 1280 __cl_ulong2 v2[4]; 1281 #endif 1282 #if defined(__CL_ULONG4__) 1283 __cl_ulong4 v4[2]; 1284 #endif 1285 #if defined(__CL_ULONG8__) 1286 __cl_ulong8 v8; 1287 #endif 1288 } cl_ulong8; 1289 1290 typedef union { 1291 cl_ulong CL_ALIGNED(128) s[16]; 1292 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1293 __extension__ struct 1294 { 1295 cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 1296 }; 1297 __extension__ struct 1298 { 1299 cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 1300 }; 1301 __extension__ struct 1302 { 1303 cl_ulong8 lo, hi; 1304 }; 1305 #endif 1306 #if defined(__CL_ULONG2__) 1307 __cl_ulong2 v2[8]; 1308 #endif 1309 #if defined(__CL_ULONG4__) 1310 __cl_ulong4 v4[4]; 1311 #endif 1312 #if defined(__CL_ULONG8__) 1313 __cl_ulong8 v8[2]; 1314 #endif 1315 #if defined(__CL_ULONG16__) 1316 __cl_ulong16 v16; 1317 #endif 1318 } cl_ulong16; 1319 1320 /* --- cl_floatn ---- */ 1321 1322 typedef union { 1323 cl_float CL_ALIGNED(8) s[2]; 1324 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1325 __extension__ struct 1326 { 1327 cl_float x, y; 1328 }; 1329 __extension__ struct 1330 { 1331 cl_float s0, s1; 1332 }; 1333 __extension__ struct 1334 { 1335 cl_float lo, hi; 1336 }; 1337 #endif 1338 #if defined(__CL_FLOAT2__) 1339 __cl_float2 v2; 1340 #endif 1341 } cl_float2; 1342 1343 typedef union { 1344 cl_float CL_ALIGNED(16) s[4]; 1345 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1346 __extension__ struct 1347 { 1348 cl_float x, y, z, w; 1349 }; 1350 __extension__ struct 1351 { 1352 cl_float s0, s1, s2, s3; 1353 }; 1354 __extension__ struct 1355 { 1356 cl_float2 lo, hi; 1357 }; 1358 #endif 1359 #if defined(__CL_FLOAT2__) 1360 __cl_float2 v2[2]; 1361 #endif 1362 #if defined(__CL_FLOAT4__) 1363 __cl_float4 v4; 1364 #endif 1365 } cl_float4; 1366 1367 /* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */ 1368 typedef cl_float4 cl_float3; 1369 1370 typedef union { 1371 cl_float CL_ALIGNED(32) s[8]; 1372 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1373 __extension__ struct 1374 { 1375 cl_float x, y, z, w; 1376 }; 1377 __extension__ struct 1378 { 1379 cl_float s0, s1, s2, s3, s4, s5, s6, s7; 1380 }; 1381 __extension__ struct 1382 { 1383 cl_float4 lo, hi; 1384 }; 1385 #endif 1386 #if defined(__CL_FLOAT2__) 1387 __cl_float2 v2[4]; 1388 #endif 1389 #if defined(__CL_FLOAT4__) 1390 __cl_float4 v4[2]; 1391 #endif 1392 #if defined(__CL_FLOAT8__) 1393 __cl_float8 v8; 1394 #endif 1395 } cl_float8; 1396 1397 typedef union { 1398 cl_float CL_ALIGNED(64) s[16]; 1399 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1400 __extension__ struct 1401 { 1402 cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 1403 }; 1404 __extension__ struct 1405 { 1406 cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 1407 }; 1408 __extension__ struct 1409 { 1410 cl_float8 lo, hi; 1411 }; 1412 #endif 1413 #if defined(__CL_FLOAT2__) 1414 __cl_float2 v2[8]; 1415 #endif 1416 #if defined(__CL_FLOAT4__) 1417 __cl_float4 v4[4]; 1418 #endif 1419 #if defined(__CL_FLOAT8__) 1420 __cl_float8 v8[2]; 1421 #endif 1422 #if defined(__CL_FLOAT16__) 1423 __cl_float16 v16; 1424 #endif 1425 } cl_float16; 1426 1427 /* --- cl_doublen ---- */ 1428 1429 typedef union { 1430 cl_double CL_ALIGNED(16) s[2]; 1431 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1432 __extension__ struct 1433 { 1434 cl_double x, y; 1435 }; 1436 __extension__ struct 1437 { 1438 cl_double s0, s1; 1439 }; 1440 __extension__ struct 1441 { 1442 cl_double lo, hi; 1443 }; 1444 #endif 1445 #if defined(__CL_DOUBLE2__) 1446 __cl_double2 v2; 1447 #endif 1448 } cl_double2; 1449 1450 typedef union { 1451 cl_double CL_ALIGNED(32) s[4]; 1452 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1453 __extension__ struct 1454 { 1455 cl_double x, y, z, w; 1456 }; 1457 __extension__ struct 1458 { 1459 cl_double s0, s1, s2, s3; 1460 }; 1461 __extension__ struct 1462 { 1463 cl_double2 lo, hi; 1464 }; 1465 #endif 1466 #if defined(__CL_DOUBLE2__) 1467 __cl_double2 v2[2]; 1468 #endif 1469 #if defined(__CL_DOUBLE4__) 1470 __cl_double4 v4; 1471 #endif 1472 } cl_double4; 1473 1474 /* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */ 1475 typedef cl_double4 cl_double3; 1476 1477 typedef union { 1478 cl_double CL_ALIGNED(64) s[8]; 1479 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1480 __extension__ struct 1481 { 1482 cl_double x, y, z, w; 1483 }; 1484 __extension__ struct 1485 { 1486 cl_double s0, s1, s2, s3, s4, s5, s6, s7; 1487 }; 1488 __extension__ struct 1489 { 1490 cl_double4 lo, hi; 1491 }; 1492 #endif 1493 #if defined(__CL_DOUBLE2__) 1494 __cl_double2 v2[4]; 1495 #endif 1496 #if defined(__CL_DOUBLE4__) 1497 __cl_double4 v4[2]; 1498 #endif 1499 #if defined(__CL_DOUBLE8__) 1500 __cl_double8 v8; 1501 #endif 1502 } cl_double8; 1503 1504 typedef union { 1505 cl_double CL_ALIGNED(128) s[16]; 1506 #if defined(CL_NAMED_STRUCT_SUPPORTED) 1507 __extension__ struct 1508 { 1509 cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; 1510 }; 1511 __extension__ struct 1512 { 1513 cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; 1514 }; 1515 __extension__ struct 1516 { 1517 cl_double8 lo, hi; 1518 }; 1519 #endif 1520 #if defined(__CL_DOUBLE2__) 1521 __cl_double2 v2[8]; 1522 #endif 1523 #if defined(__CL_DOUBLE4__) 1524 __cl_double4 v4[4]; 1525 #endif 1526 #if defined(__CL_DOUBLE8__) 1527 __cl_double8 v8[2]; 1528 #endif 1529 #if defined(__CL_DOUBLE16__) 1530 __cl_double16 v16; 1531 #endif 1532 } cl_double16; 1533 1534 /* Macro to facilitate debugging 1535 * Usage: 1536 * Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source. 1537 * The first line ends with: CL_PROGRAM_STRING_BEGIN \" 1538 * Each line thereafter of OpenCL C source must end with: \n\ 1539 * The last line ends in "; 1540 * 1541 * Example: 1542 * 1543 * const char *my_program = CL_PROGRAM_STRING_BEGIN "\ 1544 * kernel void foo( int a, float * b ) \n\ 1545 * { \n\ 1546 * // my comment \n\ 1547 * *b[ get_global_id(0)] = a; \n\ 1548 * } \n\ 1549 * "; 1550 * 1551 * This should correctly set up the line, (column) and file information for your source 1552 * string so you can do source level debugging. 1553 */ 1554 #define __CL_STRINGIFY(_x) #_x 1555 #define _CL_STRINGIFY(_x) __CL_STRINGIFY(_x) 1556 #define CL_PROGRAM_STRING_DEBUG_INFO "#line " _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n" 1557 1558 // CL.h contents 1559 /******************************************************************************/ 1560 1561 typedef struct _cl_platform_id *cl_platform_id; 1562 typedef struct _cl_device_id *cl_device_id; 1563 typedef struct _cl_context *cl_context; 1564 typedef struct _cl_command_queue *cl_command_queue; 1565 typedef struct _cl_mem *cl_mem; 1566 typedef struct _cl_program *cl_program; 1567 typedef struct _cl_kernel *cl_kernel; 1568 typedef struct _cl_event *cl_event; 1569 typedef struct _cl_sampler *cl_sampler; 1570 1571 typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ 1572 typedef cl_ulong cl_bitfield; 1573 typedef cl_bitfield cl_device_type; 1574 typedef cl_uint cl_platform_info; 1575 typedef cl_uint cl_device_info; 1576 typedef cl_bitfield cl_device_fp_config; 1577 typedef cl_uint cl_device_mem_cache_type; 1578 typedef cl_uint cl_device_local_mem_type; 1579 typedef cl_bitfield cl_device_exec_capabilities; 1580 typedef cl_bitfield cl_command_queue_properties; 1581 1582 typedef intptr_t cl_context_properties; 1583 typedef cl_uint cl_context_info; 1584 typedef cl_uint cl_command_queue_info; 1585 typedef cl_uint cl_channel_order; 1586 typedef cl_uint cl_channel_type; 1587 typedef cl_bitfield cl_mem_flags; 1588 typedef cl_uint cl_mem_object_type; 1589 typedef cl_uint cl_mem_info; 1590 typedef cl_uint cl_image_info; 1591 typedef cl_uint cl_buffer_create_type; 1592 typedef cl_uint cl_addressing_mode; 1593 typedef cl_uint cl_filter_mode; 1594 typedef cl_uint cl_sampler_info; 1595 typedef cl_bitfield cl_map_flags; 1596 typedef cl_uint cl_program_info; 1597 typedef cl_uint cl_program_build_info; 1598 typedef cl_int cl_build_status; 1599 typedef cl_uint cl_kernel_info; 1600 typedef cl_uint cl_kernel_work_group_info; 1601 typedef cl_uint cl_event_info; 1602 typedef cl_uint cl_command_type; 1603 typedef cl_uint cl_profiling_info; 1604 1605 typedef struct _cl_image_format 1606 { 1607 cl_channel_order image_channel_order; 1608 cl_channel_type image_channel_data_type; 1609 } cl_image_format; 1610 1611 typedef struct _cl_buffer_region 1612 { 1613 size_t origin; 1614 size_t size; 1615 } cl_buffer_region; 1616 1617 /******************************************************************************/ 1618 1619 /* Error Codes */ 1620 #define CL_SUCCESS 0 1621 #define CL_DEVICE_NOT_FOUND -1 1622 #define CL_DEVICE_NOT_AVAILABLE -2 1623 #define CL_COMPILER_NOT_AVAILABLE -3 1624 #define CL_MEM_OBJECT_ALLOCATION_FAILURE -4 1625 #define CL_OUT_OF_RESOURCES -5 1626 #define CL_OUT_OF_HOST_MEMORY -6 1627 #define CL_PROFILING_INFO_NOT_AVAILABLE -7 1628 #define CL_MEM_COPY_OVERLAP -8 1629 #define CL_IMAGE_FORMAT_MISMATCH -9 1630 #define CL_IMAGE_FORMAT_NOT_SUPPORTED -10 1631 #define CL_BUILD_PROGRAM_FAILURE -11 1632 #define CL_MAP_FAILURE -12 1633 #define CL_MISALIGNED_SUB_BUFFER_OFFSET -13 1634 #define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14 1635 1636 #define CL_INVALID_VALUE -30 1637 #define CL_INVALID_DEVICE_TYPE -31 1638 #define CL_INVALID_PLATFORM -32 1639 #define CL_INVALID_DEVICE -33 1640 #define CL_INVALID_CONTEXT -34 1641 #define CL_INVALID_QUEUE_PROPERTIES -35 1642 #define CL_INVALID_COMMAND_QUEUE -36 1643 #define CL_INVALID_HOST_PTR -37 1644 #define CL_INVALID_MEM_OBJECT -38 1645 #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39 1646 #define CL_INVALID_IMAGE_SIZE -40 1647 #define CL_INVALID_SAMPLER -41 1648 #define CL_INVALID_BINARY -42 1649 #define CL_INVALID_BUILD_OPTIONS -43 1650 #define CL_INVALID_PROGRAM -44 1651 #define CL_INVALID_PROGRAM_EXECUTABLE -45 1652 #define CL_INVALID_KERNEL_NAME -46 1653 #define CL_INVALID_KERNEL_DEFINITION -47 1654 #define CL_INVALID_KERNEL -48 1655 #define CL_INVALID_ARG_INDEX -49 1656 #define CL_INVALID_ARG_VALUE -50 1657 #define CL_INVALID_ARG_SIZE -51 1658 #define CL_INVALID_KERNEL_ARGS -52 1659 #define CL_INVALID_WORK_DIMENSION -53 1660 #define CL_INVALID_WORK_GROUP_SIZE -54 1661 #define CL_INVALID_WORK_ITEM_SIZE -55 1662 #define CL_INVALID_GLOBAL_OFFSET -56 1663 #define CL_INVALID_EVENT_WAIT_LIST -57 1664 #define CL_INVALID_EVENT -58 1665 #define CL_INVALID_OPERATION -59 1666 #define CL_INVALID_GL_OBJECT -60 1667 #define CL_INVALID_BUFFER_SIZE -61 1668 #define CL_INVALID_MIP_LEVEL -62 1669 #define CL_INVALID_GLOBAL_WORK_SIZE -63 1670 #define CL_INVALID_PROPERTY -64 1671 1672 /* OpenCL Version */ 1673 #define CL_VERSION_1_0 1 1674 #define CL_VERSION_1_1 1 1675 1676 /* cl_bool */ 1677 #define CL_FALSE 0 1678 #define CL_TRUE 1 1679 1680 /* cl_platform_info */ 1681 #define CL_PLATFORM_PROFILE 0x0900 1682 #define CL_PLATFORM_VERSION 0x0901 1683 #define CL_PLATFORM_NAME 0x0902 1684 #define CL_PLATFORM_VENDOR 0x0903 1685 #define CL_PLATFORM_EXTENSIONS 0x0904 1686 1687 /* cl_device_type - bitfield */ 1688 #define CL_DEVICE_TYPE_DEFAULT (1 << 0) 1689 #define CL_DEVICE_TYPE_CPU (1 << 1) 1690 #define CL_DEVICE_TYPE_GPU (1 << 2) 1691 #define CL_DEVICE_TYPE_ACCELERATOR (1 << 3) 1692 #define CL_DEVICE_TYPE_ALL 0xFFFFFFFF 1693 1694 /* cl_device_info */ 1695 #define CL_DEVICE_TYPE 0x1000 1696 #define CL_DEVICE_VENDOR_ID 0x1001 1697 #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002 1698 #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003 1699 #define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004 1700 #define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005 1701 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006 1702 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007 1703 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008 1704 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009 1705 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A 1706 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B 1707 #define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C 1708 #define CL_DEVICE_ADDRESS_BITS 0x100D 1709 #define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E 1710 #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F 1711 #define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010 1712 #define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011 1713 #define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012 1714 #define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013 1715 #define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014 1716 #define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015 1717 #define CL_DEVICE_IMAGE_SUPPORT 0x1016 1718 #define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017 1719 #define CL_DEVICE_MAX_SAMPLERS 0x1018 1720 #define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019 1721 #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A 1722 #define CL_DEVICE_SINGLE_FP_CONFIG 0x101B 1723 #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C 1724 #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D 1725 #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E 1726 #define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F 1727 #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020 1728 #define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021 1729 #define CL_DEVICE_LOCAL_MEM_TYPE 0x1022 1730 #define CL_DEVICE_LOCAL_MEM_SIZE 0x1023 1731 #define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024 1732 #define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025 1733 #define CL_DEVICE_ENDIAN_LITTLE 0x1026 1734 #define CL_DEVICE_AVAILABLE 0x1027 1735 #define CL_DEVICE_COMPILER_AVAILABLE 0x1028 1736 #define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029 1737 #define CL_DEVICE_QUEUE_PROPERTIES 0x102A 1738 #define CL_DEVICE_NAME 0x102B 1739 #define CL_DEVICE_VENDOR 0x102C 1740 #define CL_DRIVER_VERSION 0x102D 1741 #define CL_DEVICE_PROFILE 0x102E 1742 #define CL_DEVICE_VERSION 0x102F 1743 #define CL_DEVICE_EXTENSIONS 0x1030 1744 #define CL_DEVICE_PLATFORM 0x1031 1745 /* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */ 1746 /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */ 1747 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034 1748 #define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 1749 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036 1750 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037 1751 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038 1752 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039 1753 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A 1754 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B 1755 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C 1756 #define CL_DEVICE_OPENCL_C_VERSION 0x103D 1757 1758 /* cl_device_fp_config - bitfield */ 1759 #define CL_FP_DENORM (1 << 0) 1760 #define CL_FP_INF_NAN (1 << 1) 1761 #define CL_FP_ROUND_TO_NEAREST (1 << 2) 1762 #define CL_FP_ROUND_TO_ZERO (1 << 3) 1763 #define CL_FP_ROUND_TO_INF (1 << 4) 1764 #define CL_FP_FMA (1 << 5) 1765 #define CL_FP_SOFT_FLOAT (1 << 6) 1766 1767 /* cl_device_mem_cache_type */ 1768 #define CL_NONE 0x0 1769 #define CL_READ_ONLY_CACHE 0x1 1770 #define CL_READ_WRITE_CACHE 0x2 1771 1772 /* cl_device_local_mem_type */ 1773 #define CL_LOCAL 0x1 1774 #define CL_GLOBAL 0x2 1775 1776 /* cl_device_exec_capabilities - bitfield */ 1777 #define CL_EXEC_KERNEL (1 << 0) 1778 #define CL_EXEC_NATIVE_KERNEL (1 << 1) 1779 1780 /* cl_command_queue_properties - bitfield */ 1781 #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0) 1782 #define CL_QUEUE_PROFILING_ENABLE (1 << 1) 1783 1784 /* cl_context_info */ 1785 #define CL_CONTEXT_REFERENCE_COUNT 0x1080 1786 #define CL_CONTEXT_DEVICES 0x1081 1787 #define CL_CONTEXT_PROPERTIES 0x1082 1788 #define CL_CONTEXT_NUM_DEVICES 0x1083 1789 1790 /* cl_context_info + cl_context_properties */ 1791 #define CL_CONTEXT_PLATFORM 0x1084 1792 1793 /* cl_command_queue_info */ 1794 #define CL_QUEUE_CONTEXT 0x1090 1795 #define CL_QUEUE_DEVICE 0x1091 1796 #define CL_QUEUE_REFERENCE_COUNT 0x1092 1797 #define CL_QUEUE_PROPERTIES 0x1093 1798 1799 /* cl_mem_flags - bitfield */ 1800 #define CL_MEM_READ_WRITE (1 << 0) 1801 #define CL_MEM_WRITE_ONLY (1 << 1) 1802 #define CL_MEM_READ_ONLY (1 << 2) 1803 #define CL_MEM_USE_HOST_PTR (1 << 3) 1804 #define CL_MEM_ALLOC_HOST_PTR (1 << 4) 1805 #define CL_MEM_COPY_HOST_PTR (1 << 5) 1806 1807 /* cl_channel_order */ 1808 #define CL_R 0x10B0 1809 #define CL_A 0x10B1 1810 #define CL_RG 0x10B2 1811 #define CL_RA 0x10B3 1812 #define CL_RGB 0x10B4 1813 #define CL_RGBA 0x10B5 1814 #define CL_BGRA 0x10B6 1815 #define CL_ARGB 0x10B7 1816 #define CL_INTENSITY 0x10B8 1817 #define CL_LUMINANCE 0x10B9 1818 #define CL_Rx 0x10BA 1819 #define CL_RGx 0x10BB 1820 #define CL_RGBx 0x10BC 1821 1822 /* cl_channel_type */ 1823 #define CL_SNORM_INT8 0x10D0 1824 #define CL_SNORM_INT16 0x10D1 1825 #define CL_UNORM_INT8 0x10D2 1826 #define CL_UNORM_INT16 0x10D3 1827 #define CL_UNORM_SHORT_565 0x10D4 1828 #define CL_UNORM_SHORT_555 0x10D5 1829 #define CL_UNORM_INT_101010 0x10D6 1830 #define CL_SIGNED_INT8 0x10D7 1831 #define CL_SIGNED_INT16 0x10D8 1832 #define CL_SIGNED_INT32 0x10D9 1833 #define CL_UNSIGNED_INT8 0x10DA 1834 #define CL_UNSIGNED_INT16 0x10DB 1835 #define CL_UNSIGNED_INT32 0x10DC 1836 #define CL_HALF_FLOAT 0x10DD 1837 #define CL_FLOAT 0x10DE 1838 1839 /* cl_mem_object_type */ 1840 #define CL_MEM_OBJECT_BUFFER 0x10F0 1841 #define CL_MEM_OBJECT_IMAGE2D 0x10F1 1842 #define CL_MEM_OBJECT_IMAGE3D 0x10F2 1843 1844 /* cl_mem_info */ 1845 #define CL_MEM_TYPE 0x1100 1846 #define CL_MEM_FLAGS 0x1101 1847 #define CL_MEM_SIZE 0x1102 1848 #define CL_MEM_HOST_PTR 0x1103 1849 #define CL_MEM_MAP_COUNT 0x1104 1850 #define CL_MEM_REFERENCE_COUNT 0x1105 1851 #define CL_MEM_CONTEXT 0x1106 1852 #define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107 1853 #define CL_MEM_OFFSET 0x1108 1854 1855 /* cl_image_info */ 1856 #define CL_IMAGE_FORMAT 0x1110 1857 #define CL_IMAGE_ELEMENT_SIZE 0x1111 1858 #define CL_IMAGE_ROW_PITCH 0x1112 1859 #define CL_IMAGE_SLICE_PITCH 0x1113 1860 #define CL_IMAGE_WIDTH 0x1114 1861 #define CL_IMAGE_HEIGHT 0x1115 1862 #define CL_IMAGE_DEPTH 0x1116 1863 1864 /* cl_addressing_mode */ 1865 #define CL_ADDRESS_NONE 0x1130 1866 #define CL_ADDRESS_CLAMP_TO_EDGE 0x1131 1867 #define CL_ADDRESS_CLAMP 0x1132 1868 #define CL_ADDRESS_REPEAT 0x1133 1869 #define CL_ADDRESS_MIRRORED_REPEAT 0x1134 1870 1871 /* cl_filter_mode */ 1872 #define CL_FILTER_NEAREST 0x1140 1873 #define CL_FILTER_LINEAR 0x1141 1874 1875 /* cl_sampler_info */ 1876 #define CL_SAMPLER_REFERENCE_COUNT 0x1150 1877 #define CL_SAMPLER_CONTEXT 0x1151 1878 #define CL_SAMPLER_NORMALIZED_COORDS 0x1152 1879 #define CL_SAMPLER_ADDRESSING_MODE 0x1153 1880 #define CL_SAMPLER_FILTER_MODE 0x1154 1881 1882 /* cl_map_flags - bitfield */ 1883 #define CL_MAP_READ (1 << 0) 1884 #define CL_MAP_WRITE (1 << 1) 1885 1886 /* cl_program_info */ 1887 #define CL_PROGRAM_REFERENCE_COUNT 0x1160 1888 #define CL_PROGRAM_CONTEXT 0x1161 1889 #define CL_PROGRAM_NUM_DEVICES 0x1162 1890 #define CL_PROGRAM_DEVICES 0x1163 1891 #define CL_PROGRAM_SOURCE 0x1164 1892 #define CL_PROGRAM_BINARY_SIZES 0x1165 1893 #define CL_PROGRAM_BINARIES 0x1166 1894 1895 /* cl_program_build_info */ 1896 #define CL_PROGRAM_BUILD_STATUS 0x1181 1897 #define CL_PROGRAM_BUILD_OPTIONS 0x1182 1898 #define CL_PROGRAM_BUILD_LOG 0x1183 1899 1900 /* cl_build_status */ 1901 #define CL_BUILD_SUCCESS 0 1902 #define CL_BUILD_NONE -1 1903 #define CL_BUILD_ERROR -2 1904 #define CL_BUILD_IN_PROGRESS -3 1905 1906 /* cl_kernel_info */ 1907 #define CL_KERNEL_FUNCTION_NAME 0x1190 1908 #define CL_KERNEL_NUM_ARGS 0x1191 1909 #define CL_KERNEL_REFERENCE_COUNT 0x1192 1910 #define CL_KERNEL_CONTEXT 0x1193 1911 #define CL_KERNEL_PROGRAM 0x1194 1912 1913 /* cl_kernel_work_group_info */ 1914 #define CL_KERNEL_WORK_GROUP_SIZE 0x11B0 1915 #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1 1916 #define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2 1917 #define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3 1918 #define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4 1919 1920 /* cl_event_info */ 1921 #define CL_EVENT_COMMAND_QUEUE 0x11D0 1922 #define CL_EVENT_COMMAND_TYPE 0x11D1 1923 #define CL_EVENT_REFERENCE_COUNT 0x11D2 1924 #define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3 1925 #define CL_EVENT_CONTEXT 0x11D4 1926 1927 /* cl_command_type */ 1928 #define CL_COMMAND_NDRANGE_KERNEL 0x11F0 1929 #define CL_COMMAND_TASK 0x11F1 1930 #define CL_COMMAND_NATIVE_KERNEL 0x11F2 1931 #define CL_COMMAND_READ_BUFFER 0x11F3 1932 #define CL_COMMAND_WRITE_BUFFER 0x11F4 1933 #define CL_COMMAND_COPY_BUFFER 0x11F5 1934 #define CL_COMMAND_READ_IMAGE 0x11F6 1935 #define CL_COMMAND_WRITE_IMAGE 0x11F7 1936 #define CL_COMMAND_COPY_IMAGE 0x11F8 1937 #define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9 1938 #define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA 1939 #define CL_COMMAND_MAP_BUFFER 0x11FB 1940 #define CL_COMMAND_MAP_IMAGE 0x11FC 1941 #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD 1942 #define CL_COMMAND_MARKER 0x11FE 1943 #define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF 1944 #define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200 1945 #define CL_COMMAND_READ_BUFFER_RECT 0x1201 1946 #define CL_COMMAND_WRITE_BUFFER_RECT 0x1202 1947 #define CL_COMMAND_COPY_BUFFER_RECT 0x1203 1948 #define CL_COMMAND_USER 0x1204 1949 1950 /* command execution status */ 1951 #define CL_COMPLETE 0x0 1952 #define CL_RUNNING 0x1 1953 #define CL_SUBMITTED 0x2 1954 #define CL_QUEUED 0x3 1955 1956 /* cl_buffer_create_type */ 1957 #define CL_BUFFER_CREATE_TYPE_REGION 0x1220 1958 1959 /* cl_profiling_info */ 1960 #define CL_PROFILING_COMMAND_QUEUED 0x1280 1961 #define CL_PROFILING_COMMAND_SUBMIT 0x1281 1962 #define CL_PROFILING_COMMAND_START 0x1282 1963 #define CL_PROFILING_COMMAND_END 0x1283 1964 1965 /********************************************************************************************************/ 1966 1967 /********************************************************************************************************/ 1968 1969 /* Function signature typedef's */ 1970 1971 /* Platform API */ 1972 typedef CL_API_ENTRY cl_int(CL_API_CALL * 1973 PFNCLGETPLATFORMIDS)(cl_uint /* num_entries */, 1974 cl_platform_id * /* platforms */, 1975 cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0; 1976 1977 typedef CL_API_ENTRY cl_int(CL_API_CALL * 1978 PFNCLGETPLATFORMINFO)(cl_platform_id /* platform */, 1979 cl_platform_info /* param_name */, 1980 size_t /* param_value_size */, 1981 void * /* param_value */, 1982 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 1983 1984 /* Device APIs */ 1985 typedef CL_API_ENTRY cl_int(CL_API_CALL * 1986 PFNCLGETDEVICEIDS)(cl_platform_id /* platform */, 1987 cl_device_type /* device_type */, 1988 cl_uint /* num_entries */, 1989 cl_device_id * /* devices */, 1990 cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0; 1991 1992 typedef CL_API_ENTRY cl_int(CL_API_CALL * 1993 PFNCLGETDEVICEINFO)(cl_device_id /* device */, 1994 cl_device_info /* param_name */, 1995 size_t /* param_value_size */, 1996 void * /* param_value */, 1997 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 1998 1999 // Context APIs 2000 typedef CL_API_ENTRY cl_context(CL_API_CALL * 2001 PFNCLCREATECONTEXT)(const cl_context_properties * /* properties */, 2002 cl_uint /* num_devices */, 2003 const cl_device_id * /* devices */, 2004 void(CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *), 2005 void * /* user_data */, 2006 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2007 2008 typedef CL_API_ENTRY cl_context(CL_API_CALL * 2009 PFNCLCREATECONTEXTFROMTYPE)(const cl_context_properties * /* properties */, 2010 cl_device_type /* device_type */, 2011 void(CL_CALLBACK * /* pfn_notify*/)(const char *, const void *, size_t, void *), 2012 void * /* user_data */, 2013 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2014 2015 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2016 PFNCLRETAINCONTEXT)(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0; 2017 2018 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2019 PFNCLRELEASECONTEXT)(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0; 2020 2021 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2022 PFNCLGETCONTEXTINFO)(cl_context /* context */, 2023 cl_context_info /* param_name */, 2024 size_t /* param_value_size */, 2025 void * /* param_value */, 2026 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2027 2028 /* Command Queue APIs */ 2029 typedef CL_API_ENTRY cl_command_queue(CL_API_CALL * 2030 PFNCLCREATECOMMANDQUEUE)(cl_context /* context */, 2031 cl_device_id /* device */, 2032 cl_command_queue_properties /* properties */, 2033 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2034 2035 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2036 PFNCLRETAINCOMMANDQUEUE)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; 2037 2038 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2039 PFNCLRELEASECOMMANDQUEUE)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; 2040 2041 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2042 PFNCLGETCOMMANDQUEUEINFO)(cl_command_queue /* command_queue */, 2043 cl_command_queue_info /* param_name */, 2044 size_t /* param_value_size */, 2045 void * /* param_value */, 2046 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2047 2048 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2049 PFNCLSETCOMMANDQUEUEPROPERTY)(cl_command_queue /* command_queue */, 2050 cl_command_queue_properties /* properties */, 2051 cl_bool /* enable */, 2052 cl_command_queue_properties * /* old_properties */) CL_API_SUFFIX__VERSION_1_0; 2053 2054 /* Memory Object APIs */ 2055 typedef CL_API_ENTRY cl_mem(CL_API_CALL * 2056 PFNCLCREATEBUFFER)(cl_context /* context */, 2057 cl_mem_flags /* flags */, 2058 size_t /* size */, 2059 void * /* host_ptr */, 2060 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2061 2062 typedef CL_API_ENTRY cl_mem(CL_API_CALL * 2063 PFNCLCREATESUBBUFFER)(cl_mem /* buffer */, 2064 cl_mem_flags /* flags */, 2065 cl_buffer_create_type /* buffer_create_type */, 2066 const void * /* buffer_create_info */, 2067 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1; 2068 2069 typedef CL_API_ENTRY cl_mem(CL_API_CALL * 2070 PFNCLCREATEIMAGE2D)(cl_context /* context */, 2071 cl_mem_flags /* flags */, 2072 const cl_image_format * /* image_format */, 2073 size_t /* image_width */, 2074 size_t /* image_height */, 2075 size_t /* image_row_pitch */, 2076 void * /* host_ptr */, 2077 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2078 2079 typedef CL_API_ENTRY cl_mem(CL_API_CALL * 2080 PFNCLCREATEIMAGE3D)(cl_context /* context */, 2081 cl_mem_flags /* flags */, 2082 const cl_image_format * /* image_format */, 2083 size_t /* image_width */, 2084 size_t /* image_height */, 2085 size_t /* image_depth */, 2086 size_t /* image_row_pitch */, 2087 size_t /* image_slice_pitch */, 2088 void * /* host_ptr */, 2089 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2090 2091 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2092 PFNCLRETAINMEMOBJECT)(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0; 2093 2094 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2095 PFNCLRELEASEMEMOBJECT)(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0; 2096 2097 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2098 PFNCLGETSUPPORTEDIMAGEFORMATS)(cl_context /* context */, 2099 cl_mem_flags /* flags */, 2100 cl_mem_object_type /* image_type */, 2101 cl_uint /* num_entries */, 2102 cl_image_format * /* image_formats */, 2103 cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0; 2104 2105 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2106 PFNCLGETMEMOBJECTINFO)(cl_mem /* memobj */, 2107 cl_mem_info /* param_name */, 2108 size_t /* param_value_size */, 2109 void * /* param_value */, 2110 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2111 2112 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2113 PFNCLGETIMAGEINFO)(cl_mem /* image */, 2114 cl_image_info /* param_name */, 2115 size_t /* param_value_size */, 2116 void * /* param_value */, 2117 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2118 2119 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2120 PFNCLSETMEMOBJECTDESTRUCTORCALLBACK)(cl_mem /* memobj */, 2121 void(CL_CALLBACK * /*pfn_notify*/)(cl_mem /* memobj */, void * /*user_data*/), 2122 void * /*user_data */) CL_API_SUFFIX__VERSION_1_1; 2123 2124 /* Sampler APIs */ 2125 typedef CL_API_ENTRY cl_sampler(CL_API_CALL * 2126 PFNCLCREATESAMPLER)(cl_context /* context */, 2127 cl_bool /* normalized_coords */, 2128 cl_addressing_mode /* addressing_mode */, 2129 cl_filter_mode /* filter_mode */, 2130 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2131 2132 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2133 PFNCLRETAINSAMPLER)(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0; 2134 2135 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2136 PFNCLRELEASESAMPLER)(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0; 2137 2138 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2139 PFNCLGETSAMPLERINFO)(cl_sampler /* sampler */, 2140 cl_sampler_info /* param_name */, 2141 size_t /* param_value_size */, 2142 void * /* param_value */, 2143 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2144 2145 /* Program Object APIs */ 2146 typedef CL_API_ENTRY cl_program(CL_API_CALL * 2147 PFNCLCREATEPROGRAMWITHSOURCE)(cl_context /* context */, 2148 cl_uint /* count */, 2149 const char ** /* strings */, 2150 const size_t * /* lengths */, 2151 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2152 2153 typedef CL_API_ENTRY cl_program(CL_API_CALL * 2154 PFNCLCREATEPROGRAMWITHBINARY)(cl_context /* context */, 2155 cl_uint /* num_devices */, 2156 const cl_device_id * /* device_list */, 2157 const size_t * /* lengths */, 2158 const unsigned char ** /* binaries */, 2159 cl_int * /* binary_status */, 2160 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2161 2162 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2163 PFNCLRETAINPROGRAM)(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0; 2164 2165 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2166 PFNCLRELEASEPROGRAM)(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0; 2167 2168 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2169 PFNCLBUILDPROGRAM)(cl_program /* program */, 2170 cl_uint /* num_devices */, 2171 const cl_device_id * /* device_list */, 2172 const char * /* options */, 2173 void(CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), 2174 void * /* user_data */) CL_API_SUFFIX__VERSION_1_0; 2175 2176 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2177 PFNCLUNLOADCOMPILER)(void) CL_API_SUFFIX__VERSION_1_0; 2178 2179 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2180 PFNCLGETPROGRAMINFO)(cl_program /* program */, 2181 cl_program_info /* param_name */, 2182 size_t /* param_value_size */, 2183 void * /* param_value */, 2184 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2185 2186 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2187 PFNCLGETPROGRAMBUILDINFO)(cl_program /* program */, 2188 cl_device_id /* device */, 2189 cl_program_build_info /* param_name */, 2190 size_t /* param_value_size */, 2191 void * /* param_value */, 2192 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2193 2194 /* Kernel Object APIs */ 2195 typedef CL_API_ENTRY cl_kernel(CL_API_CALL * 2196 PFNCLCREATEKERNEL)(cl_program /* program */, 2197 const char * /* kernel_name */, 2198 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; 2199 2200 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2201 PFNCLCREATEKERNELSINPROGRAM)(cl_program /* program */, 2202 cl_uint /* num_kernels */, 2203 cl_kernel * /* kernels */, 2204 cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0; 2205 2206 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2207 PFNCLRETAINKERNEL)(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0; 2208 2209 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2210 PFNCLRELEASEKERNEL)(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0; 2211 2212 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2213 PFNCLSETKERNELARG)(cl_kernel /* kernel */, 2214 cl_uint /* arg_index */, 2215 size_t /* arg_size */, 2216 const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0; 2217 2218 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2219 PFNCLGETKERNELINFO)(cl_kernel /* kernel */, 2220 cl_kernel_info /* param_name */, 2221 size_t /* param_value_size */, 2222 void * /* param_value */, 2223 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2224 2225 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2226 PFNCLGETKERNELWORKGROUPINFO)(cl_kernel /* kernel */, 2227 cl_device_id /* device */, 2228 cl_kernel_work_group_info /* param_name */, 2229 size_t /* param_value_size */, 2230 void * /* param_value */, 2231 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2232 2233 // Event Object APIs 2234 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2235 PFNCLWAITFOREVENTS)(cl_uint /* num_events */, 2236 const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0; 2237 2238 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2239 PFNCLGETEVENTINFO)(cl_event /* event */, 2240 cl_event_info /* param_name */, 2241 size_t /* param_value_size */, 2242 void * /* param_value */, 2243 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2244 2245 typedef CL_API_ENTRY cl_event(CL_API_CALL * 2246 PFNCLCREATEUSEREVENT)(cl_context /* context */, 2247 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1; 2248 2249 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2250 PFNCLRETAINEVENT)(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0; 2251 2252 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2253 PFNCLRELEASEEVENT)(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0; 2254 2255 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2256 PFNCLSETUSEREVENTSTATUS)(cl_event /* event */, 2257 cl_int /* execution_status */) CL_API_SUFFIX__VERSION_1_1; 2258 2259 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2260 PFNCLSETEVENTCALLBACK)(cl_event /* event */, 2261 cl_int /* command_exec_callback_type */, 2262 void(CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *), 2263 void * /* user_data */) CL_API_SUFFIX__VERSION_1_1; 2264 2265 /* Profiling APIs */ 2266 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2267 PFNCLGETEVENTPROFILINGINFO)(cl_event /* event */, 2268 cl_profiling_info /* param_name */, 2269 size_t /* param_value_size */, 2270 void * /* param_value */, 2271 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; 2272 2273 // Flush and Finish APIs 2274 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2275 PFNCLFLUSH)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; 2276 2277 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2278 PFNCLFINISH)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; 2279 2280 /* Enqueued Commands APIs */ 2281 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2282 PFNCLENQUEUEREADBUFFER)(cl_command_queue /* command_queue */, 2283 cl_mem /* buffer */, 2284 cl_bool /* blocking_read */, 2285 size_t /* offset */, 2286 size_t /* cb */, 2287 void * /* ptr */, 2288 cl_uint /* num_events_in_wait_list */, 2289 const cl_event * /* event_wait_list */, 2290 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2291 2292 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2293 PFNCLENQUEUEREADBUFFERRECT)(cl_command_queue /* command_queue */, 2294 cl_mem /* buffer */, 2295 cl_bool /* blocking_read */, 2296 const size_t * /* buffer_origin */, 2297 const size_t * /* host_origin */, 2298 const size_t * /* region */, 2299 size_t /* buffer_row_pitch */, 2300 size_t /* buffer_slice_pitch */, 2301 size_t /* host_row_pitch */, 2302 size_t /* host_slice_pitch */, 2303 void * /* ptr */, 2304 cl_uint /* num_events_in_wait_list */, 2305 const cl_event * /* event_wait_list */, 2306 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; 2307 2308 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2309 PFNCLENQUEUEWRITEBUFFER)(cl_command_queue /* command_queue */, 2310 cl_mem /* buffer */, 2311 cl_bool /* blocking_write */, 2312 size_t /* offset */, 2313 size_t /* cb */, 2314 const void * /* ptr */, 2315 cl_uint /* num_events_in_wait_list */, 2316 const cl_event * /* event_wait_list */, 2317 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2318 2319 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2320 PFNCLENQUEUEWRITEBUFFERRECT)(cl_command_queue /* command_queue */, 2321 cl_mem /* buffer */, 2322 cl_bool /* blocking_write */, 2323 const size_t * /* buffer_origin */, 2324 const size_t * /* host_origin */, 2325 const size_t * /* region */, 2326 size_t /* buffer_row_pitch */, 2327 size_t /* buffer_slice_pitch */, 2328 size_t /* host_row_pitch */, 2329 size_t /* host_slice_pitch */, 2330 const void * /* ptr */, 2331 cl_uint /* num_events_in_wait_list */, 2332 const cl_event * /* event_wait_list */, 2333 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; 2334 2335 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2336 PFNCLENQUEUECOPYBUFFER)(cl_command_queue /* command_queue */, 2337 cl_mem /* src_buffer */, 2338 cl_mem /* dst_buffer */, 2339 size_t /* src_offset */, 2340 size_t /* dst_offset */, 2341 size_t /* cb */, 2342 cl_uint /* num_events_in_wait_list */, 2343 const cl_event * /* event_wait_list */, 2344 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2345 2346 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2347 PFNCLENQUEUECOPYBUFFERRECT)(cl_command_queue /* command_queue */, 2348 cl_mem /* src_buffer */, 2349 cl_mem /* dst_buffer */, 2350 const size_t * /* src_origin */, 2351 const size_t * /* dst_origin */, 2352 const size_t * /* region */, 2353 size_t /* src_row_pitch */, 2354 size_t /* src_slice_pitch */, 2355 size_t /* dst_row_pitch */, 2356 size_t /* dst_slice_pitch */, 2357 cl_uint /* num_events_in_wait_list */, 2358 const cl_event * /* event_wait_list */, 2359 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; 2360 2361 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2362 PFNCLENQUEUEREADIMAGE)(cl_command_queue /* command_queue */, 2363 cl_mem /* image */, 2364 cl_bool /* blocking_read */, 2365 const size_t * /* origin[3] */, 2366 const size_t * /* region[3] */, 2367 size_t /* row_pitch */, 2368 size_t /* slice_pitch */, 2369 void * /* ptr */, 2370 cl_uint /* num_events_in_wait_list */, 2371 const cl_event * /* event_wait_list */, 2372 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2373 2374 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2375 PFNCLENQUEUEWRITEIMAGE)(cl_command_queue /* command_queue */, 2376 cl_mem /* image */, 2377 cl_bool /* blocking_write */, 2378 const size_t * /* origin[3] */, 2379 const size_t * /* region[3] */, 2380 size_t /* input_row_pitch */, 2381 size_t /* input_slice_pitch */, 2382 const void * /* ptr */, 2383 cl_uint /* num_events_in_wait_list */, 2384 const cl_event * /* event_wait_list */, 2385 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2386 2387 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2388 PFNCLENQUEUECOPYIMAGE)(cl_command_queue /* command_queue */, 2389 cl_mem /* src_image */, 2390 cl_mem /* dst_image */, 2391 const size_t * /* src_origin[3] */, 2392 const size_t * /* dst_origin[3] */, 2393 const size_t * /* region[3] */, 2394 cl_uint /* num_events_in_wait_list */, 2395 const cl_event * /* event_wait_list */, 2396 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2397 2398 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2399 PFNCLENQUEUECOPYIMAGETOBUFFER)(cl_command_queue /* command_queue */, 2400 cl_mem /* src_image */, 2401 cl_mem /* dst_buffer */, 2402 const size_t * /* src_origin[3] */, 2403 const size_t * /* region[3] */, 2404 size_t /* dst_offset */, 2405 cl_uint /* num_events_in_wait_list */, 2406 const cl_event * /* event_wait_list */, 2407 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2408 2409 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2410 PFNCLENQUEUECOPYBUFFERTOIMAGE)(cl_command_queue /* command_queue */, 2411 cl_mem /* src_buffer */, 2412 cl_mem /* dst_image */, 2413 size_t /* src_offset */, 2414 const size_t * /* dst_origin[3] */, 2415 const size_t * /* region[3] */, 2416 cl_uint /* num_events_in_wait_list */, 2417 const cl_event * /* event_wait_list */, 2418 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2419 2420 typedef CL_API_ENTRY void *(CL_API_CALL * 2421 PFNCLENQUEUEMAPBUFFER)(cl_command_queue /* command_queue */, 2422 cl_mem /* buffer */, 2423 cl_bool /* blocking_map */, 2424 cl_map_flags /* map_flags */, 2425 size_t /* offset */, 2426 size_t /* cb */, 2427 cl_uint /* num_events_in_wait_list */, 2428 const cl_event * /* event_wait_list */, 2429 cl_event * /* event */, 2430 cl_int * /* errcode_ret */)CL_API_SUFFIX__VERSION_1_0; 2431 2432 typedef CL_API_ENTRY void *(CL_API_CALL * 2433 PFNCLENQUEUEMAPIMAGE)(cl_command_queue /* command_queue */, 2434 cl_mem /* image */, 2435 cl_bool /* blocking_map */, 2436 cl_map_flags /* map_flags */, 2437 const size_t * /* origin[3] */, 2438 const size_t * /* region[3] */, 2439 size_t * /* image_row_pitch */, 2440 size_t * /* image_slice_pitch */, 2441 cl_uint /* num_events_in_wait_list */, 2442 const cl_event * /* event_wait_list */, 2443 cl_event * /* event */, 2444 cl_int * /* errcode_ret */)CL_API_SUFFIX__VERSION_1_0; 2445 2446 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2447 PFNCLENQUEUEUNMAPMEMOBJECT)(cl_command_queue /* command_queue */, 2448 cl_mem /* memobj */, 2449 void * /* mapped_ptr */, 2450 cl_uint /* num_events_in_wait_list */, 2451 const cl_event * /* event_wait_list */, 2452 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2453 2454 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2455 PFNCLENQUEUENDRANGEKERNEL)(cl_command_queue /* command_queue */, 2456 cl_kernel /* kernel */, 2457 cl_uint /* work_dim */, 2458 const size_t * /* global_work_offset */, 2459 const size_t * /* global_work_size */, 2460 const size_t * /* local_work_size */, 2461 cl_uint /* num_events_in_wait_list */, 2462 const cl_event * /* event_wait_list */, 2463 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2464 2465 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2466 PFNCLENQUEUETASK)(cl_command_queue /* command_queue */, 2467 cl_kernel /* kernel */, 2468 cl_uint /* num_events_in_wait_list */, 2469 const cl_event * /* event_wait_list */, 2470 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2471 2472 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2473 PFNCLENQUEUENATIVEKERNEL)(cl_command_queue /* command_queue */, 2474 void (*user_func)(void *), 2475 void * /* args */, 2476 size_t /* cb_args */, 2477 cl_uint /* num_mem_objects */, 2478 const cl_mem * /* mem_list */, 2479 const void ** /* args_mem_loc */, 2480 cl_uint /* num_events_in_wait_list */, 2481 const cl_event * /* event_wait_list */, 2482 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2483 2484 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2485 PFNCLENQUEUEMARKER)(cl_command_queue /* command_queue */, 2486 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; 2487 2488 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2489 PFNCLENQUEUEWAITFOREVENTS)(cl_command_queue /* command_queue */, 2490 cl_uint /* num_events */, 2491 const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0; 2492 2493 typedef CL_API_ENTRY cl_int(CL_API_CALL * 2494 PFNCLENQUEUEBARRIER)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; 2495 2496 // Extension function access 2497 // 2498 // Returns the extension function address for the given function name, 2499 // or NULL if a valid function can not be found. The client must 2500 // check to make sure the address is not NULL, before using or 2501 // calling the returned function address. 2502 // 2503 typedef CL_API_ENTRY void *(CL_API_CALL *PFNCLGETEXTENSIONFUNCTIONADDRESS)(const char * /* func_name */)CL_API_SUFFIX__VERSION_1_0; 2504 2505 #define CLEW_STATIC 2506 2507 #ifdef CLEW_STATIC 2508 #define CLEWAPI extern 2509 #else 2510 #ifdef CLEW_BUILD 2511 #define CLEWAPI extern __declspec(dllexport) 2512 #else 2513 #define CLEWAPI extern __declspec(dllimport) 2514 #endif 2515 #endif 2516 2517 #if defined(_WIN32) 2518 #define CLEW_FUN_EXPORT extern 2519 #else 2520 #define CLEW_FUN_EXPORT CLEWAPI 2521 #endif 2522 2523 #define CLEW_GET_FUN(x) x 2524 2525 // Variables holding function entry points 2526 CLEW_FUN_EXPORT PFNCLGETPLATFORMIDS __clewGetPlatformIDs; 2527 CLEW_FUN_EXPORT PFNCLGETPLATFORMINFO __clewGetPlatformInfo; 2528 CLEW_FUN_EXPORT PFNCLGETDEVICEIDS __clewGetDeviceIDs; 2529 CLEW_FUN_EXPORT PFNCLGETDEVICEINFO __clewGetDeviceInfo; 2530 CLEW_FUN_EXPORT PFNCLCREATECONTEXT __clewCreateContext; 2531 CLEW_FUN_EXPORT PFNCLCREATECONTEXTFROMTYPE __clewCreateContextFromType; 2532 CLEW_FUN_EXPORT PFNCLRETAINCONTEXT __clewRetainContext; 2533 CLEW_FUN_EXPORT PFNCLRELEASECONTEXT __clewReleaseContext; 2534 CLEW_FUN_EXPORT PFNCLGETCONTEXTINFO __clewGetContextInfo; 2535 CLEW_FUN_EXPORT PFNCLCREATECOMMANDQUEUE __clewCreateCommandQueue; 2536 CLEW_FUN_EXPORT PFNCLRETAINCOMMANDQUEUE __clewRetainCommandQueue; 2537 CLEW_FUN_EXPORT PFNCLRELEASECOMMANDQUEUE __clewReleaseCommandQueue; 2538 CLEW_FUN_EXPORT PFNCLGETCOMMANDQUEUEINFO __clewGetCommandQueueInfo; 2539 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS 2540 CLEW_FUN_EXPORT PFNCLSETCOMMANDQUEUEPROPERTY __clewSetCommandQueueProperty; 2541 #endif 2542 CLEW_FUN_EXPORT PFNCLCREATEBUFFER __clewCreateBuffer; 2543 CLEW_FUN_EXPORT PFNCLCREATESUBBUFFER __clewCreateSubBuffer; 2544 CLEW_FUN_EXPORT PFNCLCREATEIMAGE2D __clewCreateImage2D; 2545 CLEW_FUN_EXPORT PFNCLCREATEIMAGE3D __clewCreateImage3D; 2546 CLEW_FUN_EXPORT PFNCLRETAINMEMOBJECT __clewRetainMemObject; 2547 CLEW_FUN_EXPORT PFNCLRELEASEMEMOBJECT __clewReleaseMemObject; 2548 CLEW_FUN_EXPORT PFNCLGETSUPPORTEDIMAGEFORMATS __clewGetSupportedImageFormats; 2549 CLEW_FUN_EXPORT PFNCLGETMEMOBJECTINFO __clewGetMemObjectInfo; 2550 CLEW_FUN_EXPORT PFNCLGETIMAGEINFO __clewGetImageInfo; 2551 CLEW_FUN_EXPORT PFNCLSETMEMOBJECTDESTRUCTORCALLBACK __clewSetMemObjectDestructorCallback; 2552 CLEW_FUN_EXPORT PFNCLCREATESAMPLER __clewCreateSampler; 2553 CLEW_FUN_EXPORT PFNCLRETAINSAMPLER __clewRetainSampler; 2554 CLEW_FUN_EXPORT PFNCLRELEASESAMPLER __clewReleaseSampler; 2555 CLEW_FUN_EXPORT PFNCLGETSAMPLERINFO __clewGetSamplerInfo; 2556 CLEW_FUN_EXPORT PFNCLCREATEPROGRAMWITHSOURCE __clewCreateProgramWithSource; 2557 CLEW_FUN_EXPORT PFNCLCREATEPROGRAMWITHBINARY __clewCreateProgramWithBinary; 2558 CLEW_FUN_EXPORT PFNCLRETAINPROGRAM __clewRetainProgram; 2559 CLEW_FUN_EXPORT PFNCLRELEASEPROGRAM __clewReleaseProgram; 2560 CLEW_FUN_EXPORT PFNCLBUILDPROGRAM __clewBuildProgram; 2561 CLEW_FUN_EXPORT PFNCLUNLOADCOMPILER __clewUnloadCompiler; 2562 CLEW_FUN_EXPORT PFNCLGETPROGRAMINFO __clewGetProgramInfo; 2563 CLEW_FUN_EXPORT PFNCLGETPROGRAMBUILDINFO __clewGetProgramBuildInfo; 2564 CLEW_FUN_EXPORT PFNCLCREATEKERNEL __clewCreateKernel; 2565 CLEW_FUN_EXPORT PFNCLCREATEKERNELSINPROGRAM __clewCreateKernelsInProgram; 2566 CLEW_FUN_EXPORT PFNCLRETAINKERNEL __clewRetainKernel; 2567 CLEW_FUN_EXPORT PFNCLRELEASEKERNEL __clewReleaseKernel; 2568 CLEW_FUN_EXPORT PFNCLSETKERNELARG __clewSetKernelArg; 2569 CLEW_FUN_EXPORT PFNCLGETKERNELINFO __clewGetKernelInfo; 2570 CLEW_FUN_EXPORT PFNCLGETKERNELWORKGROUPINFO __clewGetKernelWorkGroupInfo; 2571 CLEW_FUN_EXPORT PFNCLWAITFOREVENTS __clewWaitForEvents; 2572 CLEW_FUN_EXPORT PFNCLGETEVENTINFO __clewGetEventInfo; 2573 CLEW_FUN_EXPORT PFNCLCREATEUSEREVENT __clewCreateUserEvent; 2574 CLEW_FUN_EXPORT PFNCLRETAINEVENT __clewRetainEvent; 2575 CLEW_FUN_EXPORT PFNCLRELEASEEVENT __clewReleaseEvent; 2576 CLEW_FUN_EXPORT PFNCLSETUSEREVENTSTATUS __clewSetUserEventStatus; 2577 CLEW_FUN_EXPORT PFNCLSETEVENTCALLBACK __clewSetEventCallback; 2578 CLEW_FUN_EXPORT PFNCLGETEVENTPROFILINGINFO __clewGetEventProfilingInfo; 2579 CLEW_FUN_EXPORT PFNCLFLUSH __clewFlush; 2580 CLEW_FUN_EXPORT PFNCLFINISH __clewFinish; 2581 CLEW_FUN_EXPORT PFNCLENQUEUEREADBUFFER __clewEnqueueReadBuffer; 2582 CLEW_FUN_EXPORT PFNCLENQUEUEREADBUFFERRECT __clewEnqueueReadBufferRect; 2583 CLEW_FUN_EXPORT PFNCLENQUEUEWRITEBUFFER __clewEnqueueWriteBuffer; 2584 CLEW_FUN_EXPORT PFNCLENQUEUEWRITEBUFFERRECT __clewEnqueueWriteBufferRect; 2585 CLEW_FUN_EXPORT PFNCLENQUEUECOPYBUFFER __clewEnqueueCopyBuffer; 2586 CLEW_FUN_EXPORT PFNCLENQUEUECOPYBUFFERRECT __clewEnqueueCopyBufferRect; 2587 CLEW_FUN_EXPORT PFNCLENQUEUEREADIMAGE __clewEnqueueReadImage; 2588 CLEW_FUN_EXPORT PFNCLENQUEUEWRITEIMAGE __clewEnqueueWriteImage; 2589 CLEW_FUN_EXPORT PFNCLENQUEUECOPYIMAGE __clewEnqueueCopyImage; 2590 CLEW_FUN_EXPORT PFNCLENQUEUECOPYIMAGETOBUFFER __clewEnqueueCopyImageToBuffer; 2591 CLEW_FUN_EXPORT PFNCLENQUEUECOPYBUFFERTOIMAGE __clewEnqueueCopyBufferToImage; 2592 CLEW_FUN_EXPORT PFNCLENQUEUEMAPBUFFER __clewEnqueueMapBuffer; 2593 CLEW_FUN_EXPORT PFNCLENQUEUEMAPIMAGE __clewEnqueueMapImage; 2594 CLEW_FUN_EXPORT PFNCLENQUEUEUNMAPMEMOBJECT __clewEnqueueUnmapMemObject; 2595 CLEW_FUN_EXPORT PFNCLENQUEUENDRANGEKERNEL __clewEnqueueNDRangeKernel; 2596 CLEW_FUN_EXPORT PFNCLENQUEUETASK __clewEnqueueTask; 2597 CLEW_FUN_EXPORT PFNCLENQUEUENATIVEKERNEL __clewEnqueueNativeKernel; 2598 CLEW_FUN_EXPORT PFNCLENQUEUEMARKER __clewEnqueueMarker; 2599 CLEW_FUN_EXPORT PFNCLENQUEUEWAITFOREVENTS __clewEnqueueWaitForEvents; 2600 CLEW_FUN_EXPORT PFNCLENQUEUEBARRIER __clewEnqueueBarrier; 2601 CLEW_FUN_EXPORT PFNCLGETEXTENSIONFUNCTIONADDRESS __clewGetExtensionFunctionAddress; 2602 2603 #define clGetPlatformIDs CLEW_GET_FUN(__clewGetPlatformIDs) 2604 #define clGetPlatformInfo CLEW_GET_FUN(__clewGetPlatformInfo) 2605 #define clGetDeviceIDs CLEW_GET_FUN(__clewGetDeviceIDs) 2606 #define clGetDeviceInfo CLEW_GET_FUN(__clewGetDeviceInfo) 2607 #define clCreateContext CLEW_GET_FUN(__clewCreateContext) 2608 #define clCreateContextFromType CLEW_GET_FUN(__clewCreateContextFromType) 2609 #define clRetainContext CLEW_GET_FUN(__clewRetainContext) 2610 #define clReleaseContext CLEW_GET_FUN(__clewReleaseContext) 2611 #define clGetContextInfo CLEW_GET_FUN(__clewGetContextInfo) 2612 #define clCreateCommandQueue CLEW_GET_FUN(__clewCreateCommandQueue) 2613 #define clRetainCommandQueue CLEW_GET_FUN(__clewRetainCommandQueue) 2614 #define clReleaseCommandQueue CLEW_GET_FUN(__clewReleaseCommandQueue) 2615 #define clGetCommandQueueInfo CLEW_GET_FUN(__clewGetCommandQueueInfo) 2616 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS 2617 #warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1! 2618 /* 2619 * WARNING: 2620 * This API introduces mutable state into the OpenCL implementation. It has been REMOVED 2621 * to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the 2622 * OpenCL 1.1 conformance test, and consequently may not work or may not work dependably. 2623 * It is likely to be non-performant. Use of this API is not advised. Use at your own risk. 2624 * 2625 * Software developers previously relying on this API are instructed to set the command queue 2626 * properties when creating the queue, instead. 2627 */ 2628 #define clSetCommandQueueProperty CLEW_GET_FUN(__clewSetCommandQueueProperty) 2629 #endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */ 2630 #define clCreateBuffer CLEW_GET_FUN(__clewCreateBuffer) 2631 #define clCreateSubBuffer CLEW_GET_FUN(__clewCreateSubBuffer) 2632 #define clCreateImage2D CLEW_GET_FUN(__clewCreateImage2D) 2633 #define clCreateImage3D CLEW_GET_FUN(__clewCreateImage3D) 2634 #define clRetainMemObject CLEW_GET_FUN(__clewRetainMemObject) 2635 #define clReleaseMemObject CLEW_GET_FUN(__clewReleaseMemObject) 2636 #define clGetSupportedImageFormats CLEW_GET_FUN(__clewGetSupportedImageFormats) 2637 #define clGetMemObjectInfo CLEW_GET_FUN(__clewGetMemObjectInfo) 2638 #define clGetImageInfo CLEW_GET_FUN(__clewGetImageInfo) 2639 #define clSetMemObjectDestructorCallback CLEW_GET_FUN(__clewSetMemObjectDestructorCallback) 2640 #define clCreateSampler CLEW_GET_FUN(__clewCreateSampler) 2641 #define clRetainSampler CLEW_GET_FUN(__clewRetainSampler) 2642 #define clReleaseSampler CLEW_GET_FUN(__clewReleaseSampler) 2643 #define clGetSamplerInfo CLEW_GET_FUN(__clewGetSamplerInfo) 2644 #define clCreateProgramWithSource CLEW_GET_FUN(__clewCreateProgramWithSource) 2645 #define clCreateProgramWithBinary CLEW_GET_FUN(__clewCreateProgramWithBinary) 2646 #define clRetainProgram CLEW_GET_FUN(__clewRetainProgram) 2647 #define clReleaseProgram CLEW_GET_FUN(__clewReleaseProgram) 2648 #define clBuildProgram CLEW_GET_FUN(__clewBuildProgram) 2649 #define clUnloadCompiler CLEW_GET_FUN(__clewUnloadCompiler) 2650 #define clGetProgramInfo CLEW_GET_FUN(__clewGetProgramInfo) 2651 #define clGetProgramBuildInfo CLEW_GET_FUN(__clewGetProgramBuildInfo) 2652 #define clCreateKernel CLEW_GET_FUN(__clewCreateKernel) 2653 #define clCreateKernelsInProgram CLEW_GET_FUN(__clewCreateKernelsInProgram) 2654 #define clRetainKernel CLEW_GET_FUN(__clewRetainKernel) 2655 #define clReleaseKernel CLEW_GET_FUN(__clewReleaseKernel) 2656 #define clSetKernelArg CLEW_GET_FUN(__clewSetKernelArg) 2657 #define clGetKernelInfo CLEW_GET_FUN(__clewGetKernelInfo) 2658 #define clGetKernelWorkGroupInfo CLEW_GET_FUN(__clewGetKernelWorkGroupInfo) 2659 #define clWaitForEvents CLEW_GET_FUN(__clewWaitForEvents) 2660 #define clGetEventInfo CLEW_GET_FUN(__clewGetEventInfo) 2661 #define clCreateUserEvent CLEW_GET_FUN(__clewCreateUserEvent) 2662 #define clRetainEvent CLEW_GET_FUN(__clewRetainEvent) 2663 #define clReleaseEvent CLEW_GET_FUN(__clewReleaseEvent) 2664 #define clSetUserEventStatus CLEW_GET_FUN(__clewSetUserEventStatus) 2665 #define clSetEventCallback CLEW_GET_FUN(__clewSetEventCallback) 2666 #define clGetEventProfilingInfo CLEW_GET_FUN(__clewGetEventProfilingInfo) 2667 #define clFlush CLEW_GET_FUN(__clewFlush) 2668 #define clFinish CLEW_GET_FUN(__clewFinish) 2669 #define clEnqueueReadBuffer CLEW_GET_FUN(__clewEnqueueReadBuffer) 2670 #define clEnqueueReadBufferRect CLEW_GET_FUN(__clewEnqueueReadBufferRect) 2671 #define clEnqueueWriteBuffer CLEW_GET_FUN(__clewEnqueueWriteBuffer) 2672 #define clEnqueueWriteBufferRect CLEW_GET_FUN(__clewEnqueueWriteBufferRect) 2673 #define clEnqueueCopyBuffer CLEW_GET_FUN(__clewEnqueueCopyBuffer) 2674 #define clEnqueueCopyBufferRect CLEW_GET_FUN(__clewEnqueueCopyBufferRect) 2675 #define clEnqueueReadImage CLEW_GET_FUN(__clewEnqueueReadImage) 2676 #define clEnqueueWriteImage CLEW_GET_FUN(__clewEnqueueWriteImage) 2677 #define clEnqueueCopyImage CLEW_GET_FUN(__clewEnqueueCopyImage) 2678 #define clEnqueueCopyImageToBuffer CLEW_GET_FUN(__clewEnqueueCopyImageToBuffer) 2679 #define clEnqueueCopyBufferToImage CLEW_GET_FUN(__clewEnqueueCopyBufferToImage) 2680 #define clEnqueueMapBuffer CLEW_GET_FUN(__clewEnqueueMapBuffer) 2681 #define clEnqueueMapImage CLEW_GET_FUN(__clewEnqueueMapImage) 2682 #define clEnqueueUnmapMemObject CLEW_GET_FUN(__clewEnqueueUnmapMemObject) 2683 #define clEnqueueNDRangeKernel CLEW_GET_FUN(__clewEnqueueNDRangeKernel) 2684 #define clEnqueueTask CLEW_GET_FUN(__clewEnqueueTask) 2685 #define clEnqueueNativeKernel CLEW_GET_FUN(__clewEnqueueNativeKernel) 2686 #define clEnqueueMarker CLEW_GET_FUN(__clewEnqueueMarker) 2687 #define clEnqueueWaitForEvents CLEW_GET_FUN(__clewEnqueueWaitForEvents) 2688 #define clEnqueueBarrier CLEW_GET_FUN(__clewEnqueueBarrier) 2689 #define clGetExtensionFunctionAddress CLEW_GET_FUN(__clewGetExtensionFunctionAddress) 2690 2691 #define CLEW_SUCCESS 0 //!< Success error code 2692 #define CLEW_ERROR_OPEN_FAILED -1 //!< Error code for failing to open the dynamic library 2693 #define CLEW_ERROR_ATEXIT_FAILED -2 //!< Error code for failing to queue the closing of the dynamic library to atexit() 2694 2695 //! \brief Load OpenCL dynamic library and set function entry points 2696 int clewInit(const char *); 2697 2698 //! \brief Exit clew and unload OpenCL dynamic library 2699 void clewExit(); 2700 2701 //! \brief Convert an OpenCL error code to its string equivalent 2702 const char *clewErrorString(cl_int error); 2703 2704 #ifdef __cplusplus 2705 } 2706 #endif 2707 2708 #endif // CLEW_HPP_INCLUDED 2709