style cleanup: block comments
[blender.git] / intern / cycles / util / util_opencl.h
1 //////////////////////////////////////////////////////////////////////////
2 //  Copyright (c) 2009 Organic Vectory B.V.
3 //  Written by George van Venrooij
4 //
5 //  Distributed under the Boost Software License, Version 1.0.
6 //  (See accompanying file doc/license/Boost.txt)
7 //  Extracted from the CLCC project - http://clcc.sourceforge.net/
8 //////////////////////////////////////////////////////////////////////////
9
10 #ifndef __UTIL_OPENCL_H__
11 #define __UTIL_OPENCL_H__
12
13 CCL_NAMESPACE_BEGIN
14
15 //! This file contains a copy of the contents of CL.H and CL_PLATFORM.H from the 
16 //! official OpenCL spec. The purpose of this code is to load the OpenCL dynamic
17 //! library at run-time and thus allow the executable to function on many
18 //! platforms regardless of the vendor of the OpenCL driver actually installed.
19 //! Some of the techniques used here were inspired by work done in the GLEW
20 //! library (http://glew.sourceforge.net/)
21
22 //  Run-time dynamic linking functionality based on concepts used in GLEW
23 #ifdef  __OPENCL_CL_H
24 #error cl.h included before clew.h
25 #endif
26
27 #ifdef  __OPENCL_CL_PLATFORM_H
28 #error cl_platform.h included before clew.h
29 #endif
30
31 #ifndef CLCC_GENERATE_DOCUMENTATION
32 //  Prevent cl.h inclusion
33 #define __OPENCL_CL_H
34 //  Prevent cl_platform.h inclusion
35 #define __CL_PLATFORM_H
36 #endif  //  CLCC_GENERATE_DOCUMENTATION
37
38 /*******************************************************************************
39  * Copyright (c) 2008-2009 The Khronos Group Inc.
40  *
41  * Permission is hereby granted, free of charge, to any person obtaining a
42  * copy of this software and/or associated documentation files (the
43  * "Materials"), to deal in the Materials without restriction, including
44  * without limitation the rights to use, copy, modify, merge, publish,
45  * distribute, sublicense, and/or sell copies of the Materials, and to
46  * permit persons to whom the Materials are furnished to do so, subject to
47  * the following conditions:
48  *
49  * The above copyright notice and this permission notice shall be included
50  * in all copies or substantial portions of the Materials.
51  *
52  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
53  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
54  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
55  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
56  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
57  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
58  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
59  ******************************************************************************/
60
61 #ifndef CLCC_GENERATE_DOCUMENTATION
62
63 #if defined(_WIN32)
64 #define CL_API_ENTRY
65 #define CL_API_CALL __stdcall
66 #else
67 #define CL_API_ENTRY
68 #define CL_API_CALL
69 #endif
70
71 #define CL_API_SUFFIX__VERSION_1_0
72
73 #if defined(_WIN32) && defined(_MSC_VER)
74
75 /* scalar types  */
76 typedef signed   __int8         cl_char;
77 typedef unsigned __int8         cl_uchar;
78 typedef signed   __int16        cl_short;
79 typedef unsigned __int16        cl_ushort;
80 typedef signed   __int32        cl_int;
81 typedef unsigned __int32        cl_uint;
82 typedef signed   __int64        cl_long;
83 typedef unsigned __int64        cl_ulong;
84
85 typedef unsigned __int16        cl_half;
86 typedef float                   cl_float;
87 typedef double                  cl_double;
88
89
90 /*
91  * Vector types
92  *
93  *  Note:   OpenCL requires that all types be naturally aligned.
94  *          This means that vector types must be naturally aligned.
95  *          For example, a vector of four floats must be aligned to
96  *          a 16 byte boundary (calculated as 4 * the natural 4-byte
97  *          alignment of the float).  The alignment qualifiers here
98  *          will only function properly if your compiler supports them
99  *          and if you don't actively work to defeat them.  For example,
100  *          in order for a cl_float4 to be 16 byte aligned in a struct,
101  *          the start of the struct must itself be 16-byte aligned.
102  *
103  *          Maintaining proper alignment is the user's responsibility.
104  */
105 typedef signed   __int8          cl_char2[2];
106 typedef signed   __int8          cl_char4[4];
107 typedef signed   __int8          cl_char8[8];
108 typedef signed   __int8          cl_char16[16];
109 typedef unsigned __int8         cl_uchar2[2];
110 typedef unsigned __int8         cl_uchar4[4];
111 typedef unsigned __int8         cl_uchar8[8];
112 typedef unsigned __int8         cl_uchar16[16];
113
114 typedef signed   __int16         cl_short2[2];
115 typedef signed   __int16         cl_short4[4];
116 typedef signed   __int16         cl_short8[8];
117 typedef signed   __int16         cl_short16[16];
118 typedef unsigned __int16        cl_ushort2[2];
119 typedef unsigned __int16        cl_ushort4[4];
120 typedef unsigned __int16        cl_ushort8[8];
121 typedef unsigned __int16        cl_ushort16[16];
122
123 typedef signed   __int32         cl_int2[2];
124 typedef signed   __int32         cl_int4[4];
125 typedef signed   __int32         cl_int8[8];
126 typedef signed   __int32         cl_int16[16];
127 typedef unsigned __int32        cl_uint2[2];
128 typedef unsigned __int32        cl_uint4[4];
129 typedef unsigned __int32        cl_uint8[8];
130 typedef unsigned __int32        cl_uint16[16];
131
132 typedef signed   __int64         cl_long2[2];
133 typedef signed   __int64         cl_long4[4];
134 typedef signed   __int64         cl_long8[8];
135 typedef signed   __int64         cl_long16[16];
136 typedef unsigned __int64        cl_ulong2[2];
137 typedef unsigned __int64        cl_ulong4[4];
138 typedef unsigned __int64        cl_ulong8[8];
139 typedef unsigned __int64        cl_ulong16[16];
140
141 typedef float           cl_float2[2];
142 typedef float           cl_float4[4];
143 typedef float           cl_float8[8];
144 typedef float           cl_float16[16];
145
146 typedef double          cl_double2[2];
147 typedef double          cl_double4[4];
148 typedef double          cl_double8[8];
149 typedef double          cl_double16[16];
150 /* There are no vector types for half */
151
152 #else
153
154 #include <stdint.h>
155
156 /* scalar types  */
157 typedef int8_t          cl_char;
158 typedef uint8_t         cl_uchar;
159 typedef int16_t         cl_short    __attribute__((aligned(2)));
160 typedef uint16_t        cl_ushort   __attribute__((aligned(2)));
161 typedef int32_t         cl_int      __attribute__((aligned(4)));
162 typedef uint32_t        cl_uint     __attribute__((aligned(4)));
163 typedef int64_t         cl_long     __attribute__((aligned(8)));
164 typedef uint64_t        cl_ulong    __attribute__((aligned(8)));
165
166 typedef uint16_t        cl_half     __attribute__((aligned(2)));
167 typedef float           cl_float    __attribute__((aligned(4)));
168 typedef double          cl_double   __attribute__((aligned(8)));
169
170 /*
171  * Vector types
172  *
173  *  Note:   OpenCL requires that all types be naturally aligned.
174  *          This means that vector types must be naturally aligned.
175  *          For example, a vector of four floats must be aligned to
176  *          a 16 byte boundary (calculated as 4 * the natural 4-byte
177  *          alignment of the float).  The alignment qualifiers here
178  *          will only function properly if your compiler supports them
179  *          and if you don't actively work to defeat them.  For example,
180  *          in order for a cl_float4 to be 16 byte aligned in a struct,
181  *          the start of the struct must itself be 16-byte aligned.
182  *
183  *          Maintaining proper alignment is the user's responsibility.
184  */
185 typedef int8_t          cl_char2[2]     __attribute__((aligned(2)));
186 typedef int8_t          cl_char4[4]     __attribute__((aligned(4)));
187 typedef int8_t          cl_char8[8]     __attribute__((aligned(8)));
188 typedef int8_t          cl_char16[16]   __attribute__((aligned(16)));
189 typedef uint8_t         cl_uchar2[2]    __attribute__((aligned(2)));
190 typedef uint8_t         cl_uchar4[4]    __attribute__((aligned(4)));
191 typedef uint8_t         cl_uchar8[8]    __attribute__((aligned(8)));
192 typedef uint8_t         cl_uchar16[16]  __attribute__((aligned(16)));
193
194 typedef int16_t         cl_short2[2]     __attribute__((aligned(4)));
195 typedef int16_t         cl_short4[4]     __attribute__((aligned(8)));
196 typedef int16_t         cl_short8[8]     __attribute__((aligned(16)));
197 typedef int16_t         cl_short16[16]   __attribute__((aligned(32)));
198 typedef uint16_t        cl_ushort2[2]    __attribute__((aligned(4)));
199 typedef uint16_t        cl_ushort4[4]    __attribute__((aligned(8)));
200 typedef uint16_t        cl_ushort8[8]    __attribute__((aligned(16)));
201 typedef uint16_t        cl_ushort16[16]  __attribute__((aligned(32)));
202
203 typedef int32_t         cl_int2[2]      __attribute__((aligned(8)));
204 typedef int32_t         cl_int4[4]      __attribute__((aligned(16)));
205 typedef int32_t         cl_int8[8]      __attribute__((aligned(32)));
206 typedef int32_t         cl_int16[16]    __attribute__((aligned(64)));
207 typedef uint32_t        cl_uint2[2]     __attribute__((aligned(8)));
208 typedef uint32_t        cl_uint4[4]     __attribute__((aligned(16)));
209 typedef uint32_t        cl_uint8[8]     __attribute__((aligned(32)));
210 typedef uint32_t        cl_uint16[16]   __attribute__((aligned(64)));
211
212 typedef int64_t         cl_long2[2]     __attribute__((aligned(16)));
213 typedef int64_t         cl_long4[4]     __attribute__((aligned(32)));
214 typedef int64_t         cl_long8[8]     __attribute__((aligned(64)));
215 typedef int64_t         cl_long16[16]   __attribute__((aligned(128)));
216 typedef uint64_t        cl_ulong2[2]    __attribute__((aligned(16)));
217 typedef uint64_t        cl_ulong4[4]    __attribute__((aligned(32)));
218 typedef uint64_t        cl_ulong8[8]    __attribute__((aligned(64)));
219 typedef uint64_t        cl_ulong16[16]  __attribute__((aligned(128)));
220
221 typedef float           cl_float2[2]    __attribute__((aligned(8)));
222 typedef float           cl_float4[4]    __attribute__((aligned(16)));
223 typedef float           cl_float8[8]    __attribute__((aligned(32)));
224 typedef float           cl_float16[16]  __attribute__((aligned(64)));
225
226 typedef double          cl_double2[2]   __attribute__((aligned(16)));
227 typedef double          cl_double4[4]   __attribute__((aligned(32)));
228 typedef double          cl_double8[8]   __attribute__((aligned(64)));
229 typedef double          cl_double16[16] __attribute__((aligned(128)));
230
231 /* There are no vector types for half */
232
233 #endif
234
235 /******************************************************************************/
236
237 // Macro names and corresponding values defined by OpenCL
238
239 #define CL_CHAR_BIT         8
240 #define CL_SCHAR_MAX        127
241 #define CL_SCHAR_MIN        (-127-1)
242 #define CL_CHAR_MAX         CL_SCHAR_MAX
243 #define CL_CHAR_MIN         CL_SCHAR_MIN
244 #define CL_UCHAR_MAX        255
245 #define CL_SHRT_MAX         32767
246 #define CL_SHRT_MIN         (-32767-1)
247 #define CL_USHRT_MAX        65535
248 #define CL_INT_MAX          2147483647
249 #define CL_INT_MIN          (-2147483647-1)
250 #define CL_UINT_MAX         0xffffffffU
251 #define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
252 #define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
253 #define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
254
255 #define CL_FLT_DIG          6
256 #define CL_FLT_MANT_DIG     24
257 #define CL_FLT_MAX_10_EXP   +38
258 #define CL_FLT_MAX_EXP      +128
259 #define CL_FLT_MIN_10_EXP   -37
260 #define CL_FLT_MIN_EXP      -125
261 #define CL_FLT_RADIX        2
262 #if defined(_MSC_VER)
263 // MSVC doesn't understand hex floats
264 #define CL_FLT_MAX          3.402823466e+38F
265 #define CL_FLT_MIN          1.175494351e-38F
266 #define CL_FLT_EPSILON      1.192092896e-07F
267 #else
268 #define CL_FLT_MAX          0x1.fffffep127f
269 #define CL_FLT_MIN          0x1.0p-126f
270 #define CL_FLT_EPSILON      0x1.0p-23f
271 #endif
272
273 #define CL_DBL_DIG          15
274 #define CL_DBL_MANT_DIG     53
275 #define CL_DBL_MAX_10_EXP   +308
276 #define CL_DBL_MAX_EXP      +1024
277 #define CL_DBL_MIN_10_EXP   -307
278 #define CL_DBL_MIN_EXP      -1021
279 #define CL_DBL_RADIX        2
280 #if defined(_MSC_VER)
281 // MSVC doesn't understand hex floats
282 #define CL_DBL_MAX          1.7976931348623158e+308
283 #define CL_DBL_MIN          2.2250738585072014e-308
284 #define CL_DBL_EPSILON      2.2204460492503131e-016
285 #else
286 #define CL_DBL_MAX          0x1.fffffffffffffp1023
287 #define CL_DBL_MIN          0x1.0p-1022
288 #define CL_DBL_EPSILON      0x1.0p-52
289 #endif
290
291 #include <stddef.h>
292
293
294 //  CL.h contents
295 /******************************************************************************/
296
297 typedef struct _cl_platform_id *    cl_platform_id;
298 typedef struct _cl_device_id *      cl_device_id;
299 typedef struct _cl_context *        cl_context;
300 typedef struct _cl_command_queue *  cl_command_queue;
301 typedef struct _cl_mem *            cl_mem;
302 typedef struct _cl_program *        cl_program;
303 typedef struct _cl_kernel *         cl_kernel;
304 typedef struct _cl_event *          cl_event;
305 typedef struct _cl_sampler *        cl_sampler;
306
307 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. */ 
308 typedef cl_ulong            cl_bitfield;
309 typedef cl_bitfield         cl_device_type;
310 typedef cl_uint             cl_platform_info;
311 typedef cl_uint             cl_device_info;
312 typedef cl_bitfield         cl_device_address_info;
313 typedef cl_bitfield         cl_device_fp_config;
314 typedef cl_uint             cl_device_mem_cache_type;
315 typedef cl_uint             cl_device_local_mem_type;
316 typedef cl_bitfield         cl_device_exec_capabilities;
317 typedef cl_bitfield         cl_command_queue_properties;
318
319 typedef intptr_t                        cl_context_properties;
320 typedef cl_uint             cl_context_info;
321 typedef cl_uint             cl_command_queue_info;
322 typedef cl_uint             cl_channel_order;
323 typedef cl_uint             cl_channel_type;
324 typedef cl_bitfield         cl_mem_flags;
325 typedef cl_uint             cl_mem_object_type;
326 typedef cl_uint             cl_mem_info;
327 typedef cl_uint             cl_image_info;
328 typedef cl_uint             cl_addressing_mode;
329 typedef cl_uint             cl_filter_mode;
330 typedef cl_uint             cl_sampler_info;
331 typedef cl_bitfield         cl_map_flags;
332 typedef cl_uint             cl_program_info;
333 typedef cl_uint             cl_program_build_info;
334 typedef cl_int              cl_build_status;
335 typedef cl_uint             cl_kernel_info;
336 typedef cl_uint             cl_kernel_work_group_info;
337 typedef cl_uint             cl_event_info;
338 typedef cl_uint             cl_command_type;
339 typedef cl_uint             cl_profiling_info;
340
341 typedef struct _cl_image_format {
342     cl_channel_order        image_channel_order;
343     cl_channel_type         image_channel_data_type;
344 } cl_image_format;
345
346
347
348 /******************************************************************************/
349
350 // Error Codes
351 #define CL_SUCCESS                                  0
352 #define CL_DEVICE_NOT_FOUND                         -1
353 #define CL_DEVICE_NOT_AVAILABLE                     -2
354 #define CL_COMPILER_NOT_AVAILABLE                   -3
355 #define CL_MEM_OBJECT_ALLOCATION_FAILURE            -4
356 #define CL_OUT_OF_RESOURCES                         -5
357 #define CL_OUT_OF_HOST_MEMORY                       -6
358 #define CL_PROFILING_INFO_NOT_AVAILABLE             -7
359 #define CL_MEM_COPY_OVERLAP                         -8
360 #define CL_IMAGE_FORMAT_MISMATCH                    -9
361 #define CL_IMAGE_FORMAT_NOT_SUPPORTED               -10
362 #define CL_BUILD_PROGRAM_FAILURE                    -11
363 #define CL_MAP_FAILURE                              -12
364
365 #define CL_INVALID_VALUE                            -30
366 #define CL_INVALID_DEVICE_TYPE                      -31
367 #define CL_INVALID_PLATFORM                         -32
368 #define CL_INVALID_DEVICE                           -33
369 #define CL_INVALID_CONTEXT                          -34
370 #define CL_INVALID_QUEUE_PROPERTIES                 -35
371 #define CL_INVALID_COMMAND_QUEUE                    -36
372 #define CL_INVALID_HOST_PTR                         -37
373 #define CL_INVALID_MEM_OBJECT                       -38
374 #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR          -39
375 #define CL_INVALID_IMAGE_SIZE                       -40
376 #define CL_INVALID_SAMPLER                          -41
377 #define CL_INVALID_BINARY                           -42
378 #define CL_INVALID_BUILD_OPTIONS                    -43
379 #define CL_INVALID_PROGRAM                          -44
380 #define CL_INVALID_PROGRAM_EXECUTABLE               -45
381 #define CL_INVALID_KERNEL_NAME                      -46
382 #define CL_INVALID_KERNEL_DEFINITION                -47
383 #define CL_INVALID_KERNEL                           -48
384 #define CL_INVALID_ARG_INDEX                        -49
385 #define CL_INVALID_ARG_VALUE                        -50
386 #define CL_INVALID_ARG_SIZE                         -51
387 #define CL_INVALID_KERNEL_ARGS                      -52
388 #define CL_INVALID_WORK_DIMENSION                   -53
389 #define CL_INVALID_WORK_GROUP_SIZE                  -54
390 #define CL_INVALID_WORK_ITEM_SIZE                   -55
391 #define CL_INVALID_GLOBAL_OFFSET                    -56
392 #define CL_INVALID_EVENT_WAIT_LIST                  -57
393 #define CL_INVALID_EVENT                            -58
394 #define CL_INVALID_OPERATION                        -59
395 #define CL_INVALID_GL_OBJECT                        -60
396 #define CL_INVALID_BUFFER_SIZE                      -61
397 #define CL_INVALID_MIP_LEVEL                        -62
398 #define CL_INVALID_GLOBAL_WORK_SIZE                 -63
399
400 // OpenCL Version
401 #define CL_VERSION_1_0                              1
402
403 // cl_bool
404 #define CL_FALSE                                    0
405 #define CL_TRUE                                     1
406
407 // cl_platform_info
408 #define CL_PLATFORM_PROFILE                         0x0900
409 #define CL_PLATFORM_VERSION                         0x0901
410 #define CL_PLATFORM_NAME                            0x0902
411 #define CL_PLATFORM_VENDOR                          0x0903
412 #define CL_PLATFORM_EXTENSIONS                      0x0904
413
414 // cl_device_type - bitfield
415 #define CL_DEVICE_TYPE_DEFAULT                      (1 << 0)
416 #define CL_DEVICE_TYPE_CPU                          (1 << 1)
417 #define CL_DEVICE_TYPE_GPU                          (1 << 2)
418 #define CL_DEVICE_TYPE_ACCELERATOR                  (1 << 3)
419 #define CL_DEVICE_TYPE_ALL                          0xFFFFFFFF
420
421 // cl_device_info
422 #define CL_DEVICE_TYPE                              0x1000
423 #define CL_DEVICE_VENDOR_ID                         0x1001
424 #define CL_DEVICE_MAX_COMPUTE_UNITS                 0x1002
425 #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS          0x1003
426 #define CL_DEVICE_MAX_WORK_GROUP_SIZE               0x1004
427 #define CL_DEVICE_MAX_WORK_ITEM_SIZES               0x1005
428 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR       0x1006
429 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT      0x1007
430 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT        0x1008
431 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG       0x1009
432 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT      0x100A
433 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE     0x100B
434 #define CL_DEVICE_MAX_CLOCK_FREQUENCY               0x100C
435 #define CL_DEVICE_ADDRESS_BITS                      0x100D
436 #define CL_DEVICE_MAX_READ_IMAGE_ARGS               0x100E
437 #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS              0x100F
438 #define CL_DEVICE_MAX_MEM_ALLOC_SIZE                0x1010
439 #define CL_DEVICE_IMAGE2D_MAX_WIDTH                 0x1011
440 #define CL_DEVICE_IMAGE2D_MAX_HEIGHT                0x1012
441 #define CL_DEVICE_IMAGE3D_MAX_WIDTH                 0x1013
442 #define CL_DEVICE_IMAGE3D_MAX_HEIGHT                0x1014
443 #define CL_DEVICE_IMAGE3D_MAX_DEPTH                 0x1015
444 #define CL_DEVICE_IMAGE_SUPPORT                     0x1016
445 #define CL_DEVICE_MAX_PARAMETER_SIZE                0x1017
446 #define CL_DEVICE_MAX_SAMPLERS                      0x1018
447 #define CL_DEVICE_MEM_BASE_ADDR_ALIGN               0x1019
448 #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE          0x101A
449 #define CL_DEVICE_SINGLE_FP_CONFIG                  0x101B
450 #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE             0x101C
451 #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE         0x101D
452 #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE             0x101E
453 #define CL_DEVICE_GLOBAL_MEM_SIZE                   0x101F
454 #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE          0x1020
455 #define CL_DEVICE_MAX_CONSTANT_ARGS                 0x1021
456 #define CL_DEVICE_LOCAL_MEM_TYPE                    0x1022
457 #define CL_DEVICE_LOCAL_MEM_SIZE                    0x1023
458 #define CL_DEVICE_ERROR_CORRECTION_SUPPORT          0x1024
459 #define CL_DEVICE_PROFILING_TIMER_RESOLUTION        0x1025
460 #define CL_DEVICE_ENDIAN_LITTLE                     0x1026
461 #define CL_DEVICE_AVAILABLE                         0x1027
462 #define CL_DEVICE_COMPILER_AVAILABLE                0x1028
463 #define CL_DEVICE_EXECUTION_CAPABILITIES            0x1029
464 #define CL_DEVICE_QUEUE_PROPERTIES                  0x102A
465 #define CL_DEVICE_NAME                              0x102B
466 #define CL_DEVICE_VENDOR                            0x102C
467 #define CL_DRIVER_VERSION                           0x102D
468 #define CL_DEVICE_PROFILE                           0x102E
469 #define CL_DEVICE_VERSION                           0x102F
470 #define CL_DEVICE_EXTENSIONS                        0x1030
471 #define CL_DEVICE_PLATFORM                          0x1031
472 /* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */
473 /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
474 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF       0x1034
475 #define CL_DEVICE_HOST_UNIFIED_MEMORY               0x1035
476 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR          0x1036
477 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT         0x1037
478 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT           0x1038
479 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG          0x1039
480 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT         0x103A
481 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE        0x103B
482 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF          0x103C
483 #define CL_DEVICE_OPENCL_C_VERSION                  0x103D
484
485 // cl_device_fp_config - bitfield
486 #define CL_FP_DENORM                                (1 << 0)
487 #define CL_FP_INF_NAN                               (1 << 1)
488 #define CL_FP_ROUND_TO_NEAREST                      (1 << 2)
489 #define CL_FP_ROUND_TO_ZERO                         (1 << 3)
490 #define CL_FP_ROUND_TO_INF                          (1 << 4)
491 #define CL_FP_FMA                                   (1 << 5)
492
493 // cl_device_mem_cache_type
494 #define CL_NONE                                     0x0
495 #define CL_READ_ONLY_CACHE                          0x1
496 #define CL_READ_WRITE_CACHE                         0x2
497
498 // cl_device_local_mem_type
499 #define CL_LOCAL                                    0x1
500 #define CL_GLOBAL                                   0x2
501
502 // cl_device_exec_capabilities - bitfield
503 #define CL_EXEC_KERNEL                              (1 << 0)
504 #define CL_EXEC_NATIVE_KERNEL                       (1 << 1)
505
506 // cl_command_queue_properties - bitfield
507 #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE      (1 << 0)
508 #define CL_QUEUE_PROFILING_ENABLE                   (1 << 1)
509
510 // cl_context_info
511 #define CL_CONTEXT_REFERENCE_COUNT                  0x1080
512 #define CL_CONTEXT_DEVICES                          0x1081
513 #define CL_CONTEXT_PROPERTIES                       0x1082
514
515 // cl_context_properties
516 #define CL_CONTEXT_PLATFORM                         0x1084
517
518 // cl_command_queue_info
519 #define CL_QUEUE_CONTEXT                            0x1090
520 #define CL_QUEUE_DEVICE                             0x1091
521 #define CL_QUEUE_REFERENCE_COUNT                    0x1092
522 #define CL_QUEUE_PROPERTIES                         0x1093
523
524 // cl_mem_flags - bitfield
525 #define CL_MEM_READ_WRITE                           (1 << 0)
526 #define CL_MEM_WRITE_ONLY                           (1 << 1)
527 #define CL_MEM_READ_ONLY                            (1 << 2)
528 #define CL_MEM_USE_HOST_PTR                         (1 << 3)
529 #define CL_MEM_ALLOC_HOST_PTR                       (1 << 4)
530 #define CL_MEM_COPY_HOST_PTR                        (1 << 5)
531
532 // cl_channel_order
533 #define CL_R                                        0x10B0
534 #define CL_A                                        0x10B1
535 #define CL_RG                                       0x10B2
536 #define CL_RA                                       0x10B3
537 #define CL_RGB                                      0x10B4
538 #define CL_RGBA                                     0x10B5
539 #define CL_BGRA                                     0x10B6
540 #define CL_ARGB                                     0x10B7
541 #define CL_INTENSITY                                0x10B8
542 #define CL_LUMINANCE                                0x10B9
543
544 // cl_channel_type
545 #define CL_SNORM_INT8                               0x10D0
546 #define CL_SNORM_INT16                              0x10D1
547 #define CL_UNORM_INT8                               0x10D2
548 #define CL_UNORM_INT16                              0x10D3
549 #define CL_UNORM_SHORT_565                          0x10D4
550 #define CL_UNORM_SHORT_555                          0x10D5
551 #define CL_UNORM_INT_101010                         0x10D6
552 #define CL_SIGNED_INT8                              0x10D7
553 #define CL_SIGNED_INT16                             0x10D8
554 #define CL_SIGNED_INT32                             0x10D9
555 #define CL_UNSIGNED_INT8                            0x10DA
556 #define CL_UNSIGNED_INT16                           0x10DB
557 #define CL_UNSIGNED_INT32                           0x10DC
558 #define CL_HALF_FLOAT                               0x10DD
559 #define CL_FLOAT                                    0x10DE
560
561 // cl_mem_object_type
562 #define CL_MEM_OBJECT_BUFFER                        0x10F0
563 #define CL_MEM_OBJECT_IMAGE2D                       0x10F1
564 #define CL_MEM_OBJECT_IMAGE3D                       0x10F2
565
566 // cl_mem_info
567 #define CL_MEM_TYPE                                 0x1100
568 #define CL_MEM_FLAGS                                0x1101
569 #define CL_MEM_SIZE                                 0x1102
570 #define CL_MEM_HOST_PTR                             0x1103
571 #define CL_MEM_MAP_COUNT                            0x1104
572 #define CL_MEM_REFERENCE_COUNT                      0x1105
573 #define CL_MEM_CONTEXT                              0x1106
574
575 // cl_image_info
576 #define CL_IMAGE_FORMAT                             0x1110
577 #define CL_IMAGE_ELEMENT_SIZE                       0x1111
578 #define CL_IMAGE_ROW_PITCH                          0x1112
579 #define CL_IMAGE_SLICE_PITCH                        0x1113
580 #define CL_IMAGE_WIDTH                              0x1114
581 #define CL_IMAGE_HEIGHT                             0x1115
582 #define CL_IMAGE_DEPTH                              0x1116
583
584 // cl_addressing_mode
585 #define CL_ADDRESS_NONE                             0x1130
586 #define CL_ADDRESS_CLAMP_TO_EDGE                    0x1131
587 #define CL_ADDRESS_CLAMP                            0x1132
588 #define CL_ADDRESS_REPEAT                           0x1133
589
590 // cl_filter_mode
591 #define CL_FILTER_NEAREST                           0x1140
592 #define CL_FILTER_LINEAR                            0x1141
593
594 // cl_sampler_info
595 #define CL_SAMPLER_REFERENCE_COUNT                  0x1150
596 #define CL_SAMPLER_CONTEXT                          0x1151
597 #define CL_SAMPLER_NORMALIZED_COORDS                0x1152
598 #define CL_SAMPLER_ADDRESSING_MODE                  0x1153
599 #define CL_SAMPLER_FILTER_MODE                      0x1154
600
601 // cl_map_flags - bitfield
602 #define CL_MAP_READ                                 (1 << 0)
603 #define CL_MAP_WRITE                                (1 << 1)
604
605 // cl_program_info
606 #define CL_PROGRAM_REFERENCE_COUNT                  0x1160
607 #define CL_PROGRAM_CONTEXT                          0x1161
608 #define CL_PROGRAM_NUM_DEVICES                      0x1162
609 #define CL_PROGRAM_DEVICES                          0x1163
610 #define CL_PROGRAM_SOURCE                           0x1164
611 #define CL_PROGRAM_BINARY_SIZES                     0x1165
612 #define CL_PROGRAM_BINARIES                         0x1166
613
614 // cl_program_build_info
615 #define CL_PROGRAM_BUILD_STATUS                     0x1181
616 #define CL_PROGRAM_BUILD_OPTIONS                    0x1182
617 #define CL_PROGRAM_BUILD_LOG                        0x1183
618
619 // cl_build_status
620 #define CL_BUILD_SUCCESS                            0
621 #define CL_BUILD_NONE                               -1
622 #define CL_BUILD_ERROR                              -2
623 #define CL_BUILD_IN_PROGRESS                        -3
624
625 // cl_kernel_info
626 #define CL_KERNEL_FUNCTION_NAME                     0x1190
627 #define CL_KERNEL_NUM_ARGS                          0x1191
628 #define CL_KERNEL_REFERENCE_COUNT                   0x1192
629 #define CL_KERNEL_CONTEXT                           0x1193
630 #define CL_KERNEL_PROGRAM                           0x1194
631
632 // cl_kernel_work_group_info
633 #define CL_KERNEL_WORK_GROUP_SIZE                   0x11B0
634 #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE           0x11B1
635 #define CL_KERNEL_LOCAL_MEM_SIZE                    0x11B2
636
637 // cl_event_info
638 #define CL_EVENT_COMMAND_QUEUE                      0x11D0
639 #define CL_EVENT_COMMAND_TYPE                       0x11D1
640 #define CL_EVENT_REFERENCE_COUNT                    0x11D2
641 #define CL_EVENT_COMMAND_EXECUTION_STATUS           0x11D3
642
643 // cl_command_type
644 #define CL_COMMAND_NDRANGE_KERNEL                   0x11F0
645 #define CL_COMMAND_TASK                             0x11F1
646 #define CL_COMMAND_NATIVE_KERNEL                    0x11F2
647 #define CL_COMMAND_READ_BUFFER                      0x11F3
648 #define CL_COMMAND_WRITE_BUFFER                     0x11F4
649 #define CL_COMMAND_COPY_BUFFER                      0x11F5
650 #define CL_COMMAND_READ_IMAGE                       0x11F6
651 #define CL_COMMAND_WRITE_IMAGE                      0x11F7
652 #define CL_COMMAND_COPY_IMAGE                       0x11F8
653 #define CL_COMMAND_COPY_IMAGE_TO_BUFFER             0x11F9
654 #define CL_COMMAND_COPY_BUFFER_TO_IMAGE             0x11FA
655 #define CL_COMMAND_MAP_BUFFER                       0x11FB
656 #define CL_COMMAND_MAP_IMAGE                        0x11FC
657 #define CL_COMMAND_UNMAP_MEM_OBJECT                 0x11FD
658 #define CL_COMMAND_MARKER                           0x11FE
659 #define CL_COMMAND_ACQUIRE_GL_OBJECTS               0x11FF
660 #define CL_COMMAND_RELEASE_GL_OBJECTS               0x1200
661
662 // command execution status
663 #define CL_COMPLETE                                 0x0
664 #define CL_RUNNING                                  0x1
665 #define CL_SUBMITTED                                0x2
666 #define CL_QUEUED                                   0x3
667
668 // cl_profiling_info
669 #define CL_PROFILING_COMMAND_QUEUED                 0x1280
670 #define CL_PROFILING_COMMAND_SUBMIT                 0x1281
671 #define CL_PROFILING_COMMAND_START                  0x1282
672 #define CL_PROFILING_COMMAND_END                    0x1283
673
674 /********************************************************************************************************/
675
676 /********************************************************************************************************/
677
678 //  Function signature typedef's
679
680 // Platform API
681 typedef CL_API_ENTRY cl_int (CL_API_CALL *
682 PFNCLGETPLATFORMIDS)(cl_uint          /* num_entries */,
683                  cl_platform_id * /* platforms */,
684                  cl_uint *        /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
685
686 typedef CL_API_ENTRY cl_int (CL_API_CALL * 
687 PFNCLGETPLATFORMINFO)(cl_platform_id   /* platform */, 
688                   cl_platform_info /* param_name */,
689                   size_t           /* param_value_size */, 
690                   void *           /* param_value */,
691                   size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
692
693 // Device APIs
694 typedef CL_API_ENTRY cl_int (CL_API_CALL *
695 PFNCLGETDEVICEIDS)(cl_platform_id   /* platform */,
696                cl_device_type   /* device_type */, 
697                cl_uint          /* num_entries */, 
698                cl_device_id *   /* devices */, 
699                cl_uint *        /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
700
701 typedef CL_API_ENTRY cl_int (CL_API_CALL *
702 PFNCLGETDEVICEINFO)(cl_device_id    /* device */,
703                 cl_device_info  /* param_name */, 
704                 size_t          /* param_value_size */, 
705                 void *          /* param_value */,
706                 size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
707
708 // Context APIs  
709 typedef CL_API_ENTRY cl_context (CL_API_CALL *
710 PFNCLCREATECONTEXT)(const cl_context_properties * /* properties */,
711                 cl_uint                       /* num_devices */,
712                 const cl_device_id *          /* devices */,
713                 void (*pfn_notify)(const char *, const void *, size_t, void *) /* pfn_notify */,
714                 void *                        /* user_data */,
715                 cl_int *                      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
716
717 typedef CL_API_ENTRY cl_context (CL_API_CALL *
718 PFNCLCREATECONTEXTFROMTYPE)(const cl_context_properties * /* properties */,
719                         cl_device_type                /* device_type */,
720                         void (*pfn_notify)(const char *, const void *, size_t, void *) /* pfn_notify */,
721                         void *                        /* user_data */,
722                         cl_int *                      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
723
724 typedef CL_API_ENTRY cl_int (CL_API_CALL *
725 PFNCLRETAINCONTEXT)(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
726
727 typedef CL_API_ENTRY cl_int (CL_API_CALL *
728 PFNCLRELEASECONTEXT)(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
729
730 typedef CL_API_ENTRY cl_int (CL_API_CALL *
731 PFNCLGETCONTEXTINFO)(cl_context         /* context */, 
732                  cl_context_info    /* param_name */, 
733                  size_t             /* param_value_size */, 
734                  void *             /* param_value */, 
735                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
736
737 // Command Queue APIs
738 typedef CL_API_ENTRY cl_command_queue (CL_API_CALL *
739 PFNCLCREATECOMMANDQUEUE)(cl_context                     /* context */, 
740                      cl_device_id                   /* device */, 
741                      cl_command_queue_properties    /* properties */,
742                      cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
743
744 typedef CL_API_ENTRY cl_int (CL_API_CALL *
745 PFNCLRETAINCOMMANDQUEUE)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
746
747 typedef CL_API_ENTRY cl_int (CL_API_CALL *
748 PFNCLRELEASECOMMANDQUEUE)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
749
750 typedef CL_API_ENTRY cl_int (CL_API_CALL *
751 PFNCLGETCOMMANDQUEUEINFO)(cl_command_queue      /* command_queue */,
752                       cl_command_queue_info /* param_name */,
753                       size_t                /* param_value_size */,
754                       void *                /* param_value */,
755                       size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
756
757 typedef CL_API_ENTRY cl_int (CL_API_CALL *
758 PFNCLSETCOMMANDQUEUEPROPERTY)(cl_command_queue              /* command_queue */,
759                           cl_command_queue_properties   /* properties */, 
760                           cl_bool                        /* enable */,
761                           cl_command_queue_properties * /* old_properties */) CL_API_SUFFIX__VERSION_1_0;
762
763 // Memory Object APIs
764 typedef CL_API_ENTRY cl_mem (CL_API_CALL *
765 PFNCLCREATEBUFFER)(cl_context   /* context */,
766                cl_mem_flags /* flags */,
767                size_t       /* size */,
768                void *       /* host_ptr */,
769                cl_int *     /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
770
771 typedef CL_API_ENTRY cl_mem (CL_API_CALL *
772 PFNCLCREATEIMAGE2D)(cl_context              /* context */,
773                 cl_mem_flags            /* flags */,
774                 const cl_image_format * /* image_format */,
775                 size_t                  /* image_width */,
776                 size_t                  /* image_height */,
777                 size_t                  /* image_row_pitch */, 
778                 void *                  /* host_ptr */,
779                 cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
780
781 typedef CL_API_ENTRY cl_mem (CL_API_CALL *
782 PFNCLCREATEIMAGE3D)(cl_context              /* context */,
783                 cl_mem_flags            /* flags */,
784                 const cl_image_format * /* image_format */,
785                 size_t                  /* image_width */, 
786                 size_t                  /* image_height */,
787                 size_t                  /* image_depth */, 
788                 size_t                  /* image_row_pitch */, 
789                 size_t                  /* image_slice_pitch */, 
790                 void *                  /* host_ptr */,
791                 cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
792
793 typedef CL_API_ENTRY cl_int (CL_API_CALL *
794 PFNCLRETAINMEMOBJECT)(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
795
796 typedef CL_API_ENTRY cl_int (CL_API_CALL *
797 PFNCLRELEASEMEMOBJECT)(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
798
799 typedef CL_API_ENTRY cl_int (CL_API_CALL *
800 PFNCLGETSUPPORTEDIMAGEFORMATS)(cl_context           /* context */,
801                            cl_mem_flags         /* flags */,
802                            cl_mem_object_type   /* image_type */,
803                            cl_uint              /* num_entries */,
804                            cl_image_format *    /* image_formats */,
805                            cl_uint *            /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
806
807 typedef CL_API_ENTRY cl_int (CL_API_CALL *
808 PFNCLGETMEMOBJECTINFO)(cl_mem           /* memobj */,
809                    cl_mem_info      /* param_name */, 
810                    size_t           /* param_value_size */,
811                    void *           /* param_value */,
812                    size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
813
814 typedef CL_API_ENTRY cl_int (CL_API_CALL *
815 PFNCLGETIMAGEINFO)(cl_mem           /* image */,
816                cl_image_info    /* param_name */, 
817                size_t           /* param_value_size */,
818                void *           /* param_value */,
819                size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
820
821 // Sampler APIs
822 typedef CL_API_ENTRY cl_sampler (CL_API_CALL *
823 PFNCLCREATESAMPLER)(cl_context          /* context */,
824                 cl_bool             /* normalized_coords */, 
825                 cl_addressing_mode  /* addressing_mode */, 
826                 cl_filter_mode      /* filter_mode */,
827                 cl_int *            /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
828
829 typedef CL_API_ENTRY cl_int (CL_API_CALL *
830 PFNCLRETAINSAMPLER)(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
831
832 typedef CL_API_ENTRY cl_int (CL_API_CALL *
833 PFNCLRELEASESAMPLER)(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
834
835 typedef CL_API_ENTRY cl_int (CL_API_CALL *
836 PFNCLGETSAMPLERINFO)(cl_sampler         /* sampler */,
837                  cl_sampler_info    /* param_name */,
838                  size_t             /* param_value_size */,
839                  void *             /* param_value */,
840                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
841
842 // Program Object APIs
843 typedef CL_API_ENTRY cl_program (CL_API_CALL *
844 PFNCLCREATEPROGRAMWITHSOURCE)(cl_context        /* context */,
845                           cl_uint           /* count */,
846                           const char **     /* strings */,
847                           const size_t *    /* lengths */,
848                           cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
849
850 typedef CL_API_ENTRY cl_program (CL_API_CALL *
851 PFNCLCREATEPROGRAMWITHBINARY)(cl_context                     /* context */,
852                           cl_uint                        /* num_devices */,
853                           const cl_device_id *           /* device_list */,
854                           const size_t *                 /* lengths */,
855                           const unsigned char **         /* binaries */,
856                           cl_int *                       /* binary_status */,
857                           cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
858
859 typedef CL_API_ENTRY cl_int (CL_API_CALL *
860 PFNCLRETAINPROGRAM)(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
861
862 typedef CL_API_ENTRY cl_int (CL_API_CALL *
863 PFNCLRELEASEPROGRAM)(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
864
865 typedef CL_API_ENTRY cl_int (CL_API_CALL *
866 PFNCLBUILDPROGRAM)(cl_program           /* program */,
867                cl_uint              /* num_devices */,
868                const cl_device_id * /* device_list */,
869                const char *         /* options */, 
870                void (*pfn_notify)(cl_program /* program */, void * /* user_data */),
871                void *               /* user_data */) CL_API_SUFFIX__VERSION_1_0;
872
873 typedef CL_API_ENTRY cl_int (CL_API_CALL *
874 PFNCLUNLOADCOMPILER)(void) CL_API_SUFFIX__VERSION_1_0;
875
876 typedef CL_API_ENTRY cl_int (CL_API_CALL *
877 PFNCLGETPROGRAMINFO)(cl_program         /* program */,
878                  cl_program_info    /* param_name */,
879                  size_t             /* param_value_size */,
880                  void *             /* param_value */,
881                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
882
883 typedef CL_API_ENTRY cl_int (CL_API_CALL *
884 PFNCLGETPROGRAMBUILDINFO)(cl_program            /* program */,
885                       cl_device_id          /* device */,
886                       cl_program_build_info /* param_name */,
887                       size_t                /* param_value_size */,
888                       void *                /* param_value */,
889                       size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
890
891 // Kernel Object APIs
892 typedef CL_API_ENTRY cl_kernel (CL_API_CALL *
893 PFNCLCREATEKERNEL)(cl_program      /* program */,
894                const char *    /* kernel_name */,
895                cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
896
897 typedef CL_API_ENTRY cl_int (CL_API_CALL *
898 PFNCLCREATEKERNELSINPROGRAM)(cl_program     /* program */,
899                          cl_uint        /* num_kernels */,
900                          cl_kernel *    /* kernels */,
901                          cl_uint *      /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
902
903 typedef CL_API_ENTRY cl_int (CL_API_CALL *
904 PFNCLRETAINKERNEL)(cl_kernel    /* kernel */) CL_API_SUFFIX__VERSION_1_0;
905
906 typedef CL_API_ENTRY cl_int (CL_API_CALL *
907 PFNCLRELEASEKERNEL)(cl_kernel   /* kernel */) CL_API_SUFFIX__VERSION_1_0;
908
909 typedef CL_API_ENTRY cl_int (CL_API_CALL *
910 PFNCLSETKERNELARG)(cl_kernel    /* kernel */,
911                cl_uint      /* arg_index */,
912                size_t       /* arg_size */,
913                const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
914
915 typedef CL_API_ENTRY cl_int (CL_API_CALL *
916 PFNCLGETKERNELINFO)(cl_kernel       /* kernel */,
917                 cl_kernel_info  /* param_name */,
918                 size_t          /* param_value_size */,
919                 void *          /* param_value */,
920                 size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
921
922 typedef CL_API_ENTRY cl_int (CL_API_CALL *
923 PFNCLGETKERNELWORKGROUPINFO)(cl_kernel                  /* kernel */,
924                          cl_device_id               /* device */,
925                          cl_kernel_work_group_info  /* param_name */,
926                          size_t                     /* param_value_size */,
927                          void *                     /* param_value */,
928                          size_t *                   /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
929
930 // Event Object APIs
931 typedef CL_API_ENTRY cl_int (CL_API_CALL *
932 PFNCLWAITFOREVENTS)(cl_uint             /* num_events */,
933                 const cl_event *    /* event_list */) CL_API_SUFFIX__VERSION_1_0;
934
935 typedef CL_API_ENTRY cl_int (CL_API_CALL *
936 PFNCLGETEVENTINFO)(cl_event         /* event */,
937                cl_event_info    /* param_name */,
938                size_t           /* param_value_size */,
939                void *           /* param_value */,
940                size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
941
942 typedef CL_API_ENTRY cl_int (CL_API_CALL *
943 PFNCLRETAINEVENT)(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
944
945 typedef CL_API_ENTRY cl_int (CL_API_CALL *
946 PFNCLRELEASEEVENT)(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
947
948 // Profiling APIs
949 typedef CL_API_ENTRY cl_int (CL_API_CALL *
950 PFNCLGETEVENTPROFILINGINFO)(cl_event            /* event */,
951                         cl_profiling_info   /* param_name */,
952                         size_t              /* param_value_size */,
953                         void *              /* param_value */,
954                         size_t *            /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
955
956 // Flush and Finish APIs
957 typedef CL_API_ENTRY cl_int (CL_API_CALL *
958 PFNCLFLUSH)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
959
960 typedef CL_API_ENTRY cl_int (CL_API_CALL *
961 PFNCLFINISH)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
962
963 // Enqueued Commands APIs
964 typedef CL_API_ENTRY cl_int (CL_API_CALL *
965 PFNCLENQUEUEREADBUFFER)(cl_command_queue    /* command_queue */,
966                     cl_mem              /* buffer */,
967                     cl_bool             /* blocking_read */,
968                     size_t              /* offset */,
969                     size_t              /* cb */, 
970                     void *              /* ptr */,
971                     cl_uint             /* num_events_in_wait_list */,
972                     const cl_event *    /* event_wait_list */,
973                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
974
975 typedef CL_API_ENTRY cl_int (CL_API_CALL *
976 PFNCLENQUEUEWRITEBUFFER)(cl_command_queue   /* command_queue */, 
977                      cl_mem             /* buffer */, 
978                      cl_bool            /* blocking_write */, 
979                      size_t             /* offset */, 
980                      size_t             /* cb */, 
981                      const void *       /* ptr */, 
982                      cl_uint            /* num_events_in_wait_list */, 
983                      const cl_event *   /* event_wait_list */, 
984                      cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_0;
985
986 typedef CL_API_ENTRY cl_int (CL_API_CALL *
987 PFNCLENQUEUECOPYBUFFER)(cl_command_queue    /* command_queue */, 
988                     cl_mem              /* src_buffer */,
989                     cl_mem              /* dst_buffer */, 
990                     size_t              /* src_offset */,
991                     size_t              /* dst_offset */,
992                     size_t              /* cb */, 
993                     cl_uint             /* num_events_in_wait_list */,
994                     const cl_event *    /* event_wait_list */,
995                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
996
997 typedef CL_API_ENTRY cl_int (CL_API_CALL *
998 PFNCLENQUEUEREADIMAGE)(cl_command_queue     /* command_queue */,
999                    cl_mem               /* image */,
1000                    cl_bool              /* blocking_read */, 
1001                    const size_t *       /* origin[3] */,
1002                    const size_t *       /* region[3] */,
1003                    size_t               /* row_pitch */,
1004                    size_t               /* slice_pitch */, 
1005                    void *               /* ptr */,
1006                    cl_uint              /* num_events_in_wait_list */,
1007                    const cl_event *     /* event_wait_list */,
1008                    cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
1009
1010 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1011 PFNCLENQUEUEWRITEIMAGE)(cl_command_queue    /* command_queue */,
1012                     cl_mem              /* image */,
1013                     cl_bool             /* blocking_write */, 
1014                     const size_t *      /* origin[3] */,
1015                     const size_t *      /* region[3] */,
1016                     size_t              /* input_row_pitch */,
1017                     size_t              /* input_slice_pitch */, 
1018                     const void *        /* ptr */,
1019                     cl_uint             /* num_events_in_wait_list */,
1020                     const cl_event *    /* event_wait_list */,
1021                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
1022
1023 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1024 PFNCLENQUEUECOPYIMAGE)(cl_command_queue     /* command_queue */,
1025                    cl_mem               /* src_image */,
1026                    cl_mem               /* dst_image */, 
1027                    const size_t *       /* src_origin[3] */,
1028                    const size_t *       /* dst_origin[3] */,
1029                    const size_t *       /* region[3] */, 
1030                    cl_uint              /* num_events_in_wait_list */,
1031                    const cl_event *     /* event_wait_list */,
1032                    cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
1033
1034 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1035 PFNCLENQUEUECOPYIMAGETOBUFFER)(cl_command_queue /* command_queue */,
1036                            cl_mem           /* src_image */,
1037                            cl_mem           /* dst_buffer */, 
1038                            const size_t *   /* src_origin[3] */,
1039                            const size_t *   /* region[3] */, 
1040                            size_t           /* dst_offset */,
1041                            cl_uint          /* num_events_in_wait_list */,
1042                            const cl_event * /* event_wait_list */,
1043                            cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
1044
1045 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1046 PFNCLENQUEUECOPYBUFFERTOIMAGE)(cl_command_queue /* command_queue */,
1047                            cl_mem           /* src_buffer */,
1048                            cl_mem           /* dst_image */, 
1049                            size_t           /* src_offset */,
1050                            const size_t *   /* dst_origin[3] */,
1051                            const size_t *   /* region[3] */, 
1052                            cl_uint          /* num_events_in_wait_list */,
1053                            const cl_event * /* event_wait_list */,
1054                            cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
1055
1056 typedef CL_API_ENTRY void * (CL_API_CALL *
1057 PFNCLENQUEUEMAPBUFFER)(cl_command_queue /* command_queue */,
1058                    cl_mem           /* buffer */,
1059                    cl_bool          /* blocking_map */, 
1060                    cl_map_flags     /* map_flags */,
1061                    size_t           /* offset */,
1062                    size_t           /* cb */,
1063                    cl_uint          /* num_events_in_wait_list */,
1064                    const cl_event * /* event_wait_list */,
1065                    cl_event *       /* event */,
1066                    cl_int *         /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
1067
1068 typedef CL_API_ENTRY void * (CL_API_CALL *
1069 PFNCLENQUEUEMAPIMAGE)(cl_command_queue  /* command_queue */,
1070                   cl_mem            /* image */, 
1071                   cl_bool           /* blocking_map */, 
1072                   cl_map_flags      /* map_flags */, 
1073                   const size_t *    /* origin[3] */,
1074                   const size_t *    /* region[3] */,
1075                   size_t *          /* image_row_pitch */,
1076                   size_t *          /* image_slice_pitch */,
1077                   cl_uint           /* num_events_in_wait_list */,
1078                   const cl_event *  /* event_wait_list */,
1079                   cl_event *        /* event */,
1080                   cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
1081
1082 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1083 PFNCLENQUEUEUNMAPMEMOBJECT)(cl_command_queue /* command_queue */,
1084                         cl_mem           /* memobj */,
1085                         void *           /* mapped_ptr */,
1086                         cl_uint          /* num_events_in_wait_list */,
1087                         const cl_event *  /* event_wait_list */,
1088                         cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
1089
1090 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1091 PFNCLENQUEUENDRANGEKERNEL)(cl_command_queue /* command_queue */,
1092                        cl_kernel        /* kernel */,
1093                        cl_uint          /* work_dim */,
1094                        const size_t *   /* global_work_offset */,
1095                        const size_t *   /* global_work_size */,
1096                        const size_t *   /* local_work_size */,
1097                        cl_uint          /* num_events_in_wait_list */,
1098                        const cl_event * /* event_wait_list */,
1099                        cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
1100
1101 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1102 PFNCLENQUEUETASK)(cl_command_queue  /* command_queue */,
1103               cl_kernel         /* kernel */,
1104               cl_uint           /* num_events_in_wait_list */,
1105               const cl_event *  /* event_wait_list */,
1106               cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
1107
1108 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1109 PFNCLENQUEUENATIVEKERNEL)(cl_command_queue  /* command_queue */,
1110                       void (*user_func)(void *), 
1111                       void *            /* args */,
1112                       size_t            /* cb_args */, 
1113                       cl_uint           /* num_mem_objects */,
1114                       const cl_mem *    /* mem_list */,
1115                       const void **     /* args_mem_loc */,
1116                       cl_uint           /* num_events_in_wait_list */,
1117                       const cl_event *  /* event_wait_list */,
1118                       cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
1119
1120 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1121 PFNCLENQUEUEMARKER)(cl_command_queue    /* command_queue */,
1122                 cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
1123
1124 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1125 PFNCLENQUEUEWAITFOREVENTS)(cl_command_queue /* command_queue */,
1126                        cl_uint          /* num_events */,
1127                        const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
1128
1129 typedef CL_API_ENTRY cl_int (CL_API_CALL *
1130 PFNCLENQUEUEBARRIER)(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
1131
1132 // Extension function access
1133 //
1134 // Returns the extension function address for the given function name,
1135 // or NULL if a valid function can not be found.  The client must
1136 // check to make sure the address is not NULL, before using or 
1137 // calling the returned function address.
1138 //
1139 typedef CL_API_ENTRY void * (CL_API_CALL * PFNCLGETEXTENSIONFUNCTIONADDRESS)(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
1140
1141
1142 #define CLEW_STATIC
1143
1144 #ifdef CLEW_STATIC
1145 #  define CLEWAPI extern
1146 #else
1147 #  ifdef CLEW_BUILD
1148 #    define CLEWAPI extern __declspec(dllexport)
1149 #  else
1150 #    define CLEWAPI extern __declspec(dllimport)
1151 #  endif
1152 #endif
1153
1154 #if defined(_WIN32)
1155 #define CLEW_FUN_EXPORT extern
1156 #else
1157 #define CLEW_FUN_EXPORT CLEWAPI
1158 #endif
1159
1160 #define CLEW_GET_FUN(x) x
1161
1162
1163 //  Variables holding function entry points
1164 CLEW_FUN_EXPORT     PFNCLGETPLATFORMIDS                 __clewGetPlatformIDs                ;
1165 CLEW_FUN_EXPORT     PFNCLGETPLATFORMINFO                __clewGetPlatformInfo               ;
1166 CLEW_FUN_EXPORT     PFNCLGETDEVICEIDS                   __clewGetDeviceIDs                  ;
1167 CLEW_FUN_EXPORT     PFNCLGETDEVICEINFO                  __clewGetDeviceInfo                 ;
1168 CLEW_FUN_EXPORT     PFNCLCREATECONTEXT                  __clewCreateContext                 ;
1169 CLEW_FUN_EXPORT     PFNCLCREATECONTEXTFROMTYPE          __clewCreateContextFromType         ;
1170 CLEW_FUN_EXPORT     PFNCLRETAINCONTEXT                  __clewRetainContext                 ;
1171 CLEW_FUN_EXPORT     PFNCLRELEASECONTEXT                 __clewReleaseContext                ;
1172 CLEW_FUN_EXPORT     PFNCLGETCONTEXTINFO                 __clewGetContextInfo                ;
1173 CLEW_FUN_EXPORT     PFNCLCREATECOMMANDQUEUE             __clewCreateCommandQueue            ;
1174 CLEW_FUN_EXPORT     PFNCLRETAINCOMMANDQUEUE             __clewRetainCommandQueue            ;
1175 CLEW_FUN_EXPORT     PFNCLRELEASECOMMANDQUEUE            __clewReleaseCommandQueue           ;
1176 CLEW_FUN_EXPORT     PFNCLGETCOMMANDQUEUEINFO            __clewGetCommandQueueInfo           ;
1177 CLEW_FUN_EXPORT     PFNCLSETCOMMANDQUEUEPROPERTY        __clewSetCommandQueueProperty       ;
1178 CLEW_FUN_EXPORT     PFNCLCREATEBUFFER                   __clewCreateBuffer                  ;
1179 CLEW_FUN_EXPORT     PFNCLCREATEIMAGE2D                  __clewCreateImage2D                 ;
1180 CLEW_FUN_EXPORT     PFNCLCREATEIMAGE3D                  __clewCreateImage3D                 ;
1181 CLEW_FUN_EXPORT     PFNCLRETAINMEMOBJECT                __clewRetainMemObject               ;
1182 CLEW_FUN_EXPORT     PFNCLRELEASEMEMOBJECT               __clewReleaseMemObject              ;
1183 CLEW_FUN_EXPORT     PFNCLGETSUPPORTEDIMAGEFORMATS       __clewGetSupportedImageFormats      ;
1184 CLEW_FUN_EXPORT     PFNCLGETMEMOBJECTINFO               __clewGetMemObjectInfo              ;
1185 CLEW_FUN_EXPORT     PFNCLGETIMAGEINFO                   __clewGetImageInfo                  ;
1186 CLEW_FUN_EXPORT     PFNCLCREATESAMPLER                  __clewCreateSampler                 ;
1187 CLEW_FUN_EXPORT     PFNCLRETAINSAMPLER                  __clewRetainSampler                 ;
1188 CLEW_FUN_EXPORT     PFNCLRELEASESAMPLER                 __clewReleaseSampler                ;
1189 CLEW_FUN_EXPORT     PFNCLGETSAMPLERINFO                 __clewGetSamplerInfo                ;
1190 CLEW_FUN_EXPORT     PFNCLCREATEPROGRAMWITHSOURCE        __clewCreateProgramWithSource       ;
1191 CLEW_FUN_EXPORT     PFNCLCREATEPROGRAMWITHBINARY        __clewCreateProgramWithBinary       ;
1192 CLEW_FUN_EXPORT     PFNCLRETAINPROGRAM                  __clewRetainProgram                 ;
1193 CLEW_FUN_EXPORT     PFNCLRELEASEPROGRAM                 __clewReleaseProgram                ;
1194 CLEW_FUN_EXPORT     PFNCLBUILDPROGRAM                   __clewBuildProgram                  ;
1195 CLEW_FUN_EXPORT     PFNCLUNLOADCOMPILER                 __clewUnloadCompiler                ;
1196 CLEW_FUN_EXPORT     PFNCLGETPROGRAMINFO                 __clewGetProgramInfo                ;
1197 CLEW_FUN_EXPORT     PFNCLGETPROGRAMBUILDINFO            __clewGetProgramBuildInfo           ;
1198 CLEW_FUN_EXPORT     PFNCLCREATEKERNEL                   __clewCreateKernel                  ;
1199 CLEW_FUN_EXPORT     PFNCLCREATEKERNELSINPROGRAM         __clewCreateKernelsInProgram        ;
1200 CLEW_FUN_EXPORT     PFNCLRETAINKERNEL                   __clewRetainKernel                  ;
1201 CLEW_FUN_EXPORT     PFNCLRELEASEKERNEL                  __clewReleaseKernel                 ;
1202 CLEW_FUN_EXPORT     PFNCLSETKERNELARG                   __clewSetKernelArg                  ;
1203 CLEW_FUN_EXPORT     PFNCLGETKERNELINFO                  __clewGetKernelInfo                 ;
1204 CLEW_FUN_EXPORT     PFNCLGETKERNELWORKGROUPINFO         __clewGetKernelWorkGroupInfo        ;
1205 CLEW_FUN_EXPORT     PFNCLWAITFOREVENTS                  __clewWaitForEvents                 ;
1206 CLEW_FUN_EXPORT     PFNCLGETEVENTINFO                   __clewGetEventInfo                  ;
1207 CLEW_FUN_EXPORT     PFNCLRETAINEVENT                    __clewRetainEvent                   ;
1208 CLEW_FUN_EXPORT     PFNCLRELEASEEVENT                   __clewReleaseEvent                  ;
1209 CLEW_FUN_EXPORT     PFNCLGETEVENTPROFILINGINFO          __clewGetEventProfilingInfo         ;
1210 CLEW_FUN_EXPORT     PFNCLFLUSH                          __clewFlush                         ;
1211 CLEW_FUN_EXPORT     PFNCLFINISH                         __clewFinish                        ;
1212 CLEW_FUN_EXPORT     PFNCLENQUEUEREADBUFFER              __clewEnqueueReadBuffer             ;
1213 CLEW_FUN_EXPORT     PFNCLENQUEUEWRITEBUFFER             __clewEnqueueWriteBuffer            ;
1214 CLEW_FUN_EXPORT     PFNCLENQUEUECOPYBUFFER              __clewEnqueueCopyBuffer             ;
1215 CLEW_FUN_EXPORT     PFNCLENQUEUEREADIMAGE               __clewEnqueueReadImage              ;
1216 CLEW_FUN_EXPORT     PFNCLENQUEUEWRITEIMAGE              __clewEnqueueWriteImage             ;
1217 CLEW_FUN_EXPORT     PFNCLENQUEUECOPYIMAGE               __clewEnqueueCopyImage              ;
1218 CLEW_FUN_EXPORT     PFNCLENQUEUECOPYIMAGETOBUFFER       __clewEnqueueCopyImageToBuffer      ;
1219 CLEW_FUN_EXPORT     PFNCLENQUEUECOPYBUFFERTOIMAGE       __clewEnqueueCopyBufferToImage      ;
1220 CLEW_FUN_EXPORT     PFNCLENQUEUEMAPBUFFER               __clewEnqueueMapBuffer              ;
1221 CLEW_FUN_EXPORT     PFNCLENQUEUEMAPIMAGE                __clewEnqueueMapImage               ;
1222 CLEW_FUN_EXPORT     PFNCLENQUEUEUNMAPMEMOBJECT          __clewEnqueueUnmapMemObject         ;
1223 CLEW_FUN_EXPORT     PFNCLENQUEUENDRANGEKERNEL           __clewEnqueueNDRangeKernel          ;
1224 CLEW_FUN_EXPORT     PFNCLENQUEUETASK                    __clewEnqueueTask                   ;
1225 CLEW_FUN_EXPORT     PFNCLENQUEUENATIVEKERNEL            __clewEnqueueNativeKernel           ;
1226 CLEW_FUN_EXPORT     PFNCLENQUEUEMARKER                  __clewEnqueueMarker                 ;
1227 CLEW_FUN_EXPORT     PFNCLENQUEUEWAITFOREVENTS           __clewEnqueueWaitForEvents          ;
1228 CLEW_FUN_EXPORT     PFNCLENQUEUEBARRIER                 __clewEnqueueBarrier                ;
1229 CLEW_FUN_EXPORT     PFNCLGETEXTENSIONFUNCTIONADDRESS    __clewGetExtensionFunctionAddress   ;
1230
1231
1232 #define clGetPlatformIDs                CLEW_GET_FUN(__clewGetPlatformIDs                )
1233 #define clGetPlatformInfo               CLEW_GET_FUN(__clewGetPlatformInfo               )
1234 #define clGetDeviceIDs                  CLEW_GET_FUN(__clewGetDeviceIDs                  )
1235 #define clGetDeviceInfo                 CLEW_GET_FUN(__clewGetDeviceInfo                 )
1236 #define clCreateContext                 CLEW_GET_FUN(__clewCreateContext                 )
1237 #define clCreateContextFromType         CLEW_GET_FUN(__clewCreateContextFromType         )
1238 #define clRetainContext                 CLEW_GET_FUN(__clewRetainContext                 )
1239 #define clReleaseContext                CLEW_GET_FUN(__clewReleaseContext                )
1240 #define clGetContextInfo                CLEW_GET_FUN(__clewGetContextInfo                )
1241 #define clCreateCommandQueue            CLEW_GET_FUN(__clewCreateCommandQueue            )
1242 #define clRetainCommandQueue            CLEW_GET_FUN(__clewRetainCommandQueue            )
1243 #define clReleaseCommandQueue           CLEW_GET_FUN(__clewReleaseCommandQueue           )
1244 #define clGetCommandQueueInfo           CLEW_GET_FUN(__clewGetCommandQueueInfo           )
1245 #define clSetCommandQueueProperty       CLEW_GET_FUN(__clewSetCommandQueueProperty       )
1246 #define clCreateBuffer                  CLEW_GET_FUN(__clewCreateBuffer                  )
1247 #define clCreateImage2D                 CLEW_GET_FUN(__clewCreateImage2D                 )
1248 #define clCreateImage3D                 CLEW_GET_FUN(__clewCreateImage3D                 )
1249 #define clRetainMemObject               CLEW_GET_FUN(__clewRetainMemObject               )
1250 #define clReleaseMemObject              CLEW_GET_FUN(__clewReleaseMemObject              )
1251 #define clGetSupportedImageFormats      CLEW_GET_FUN(__clewGetSupportedImageFormats      )
1252 #define clGetMemObjectInfo              CLEW_GET_FUN(__clewGetMemObjectInfo              )
1253 #define clGetImageInfo                  CLEW_GET_FUN(__clewGetImageInfo                  )
1254 #define clCreateSampler                 CLEW_GET_FUN(__clewCreateSampler                 )
1255 #define clRetainSampler                 CLEW_GET_FUN(__clewRetainSampler                 )
1256 #define clReleaseSampler                CLEW_GET_FUN(__clewReleaseSampler                )
1257 #define clGetSamplerInfo                CLEW_GET_FUN(__clewGetSamplerInfo                )
1258 #define clCreateProgramWithSource       CLEW_GET_FUN(__clewCreateProgramWithSource       )
1259 #define clCreateProgramWithBinary       CLEW_GET_FUN(__clewCreateProgramWithBinary       )
1260 #define clRetainProgram                 CLEW_GET_FUN(__clewRetainProgram                 )
1261 #define clReleaseProgram                CLEW_GET_FUN(__clewReleaseProgram                )
1262 #define clBuildProgram                  CLEW_GET_FUN(__clewBuildProgram                  )
1263 #define clUnloadCompiler                CLEW_GET_FUN(__clewUnloadCompiler                )
1264 #define clGetProgramInfo                CLEW_GET_FUN(__clewGetProgramInfo                )
1265 #define clGetProgramBuildInfo           CLEW_GET_FUN(__clewGetProgramBuildInfo           )
1266 #define clCreateKernel                  CLEW_GET_FUN(__clewCreateKernel                  )
1267 #define clCreateKernelsInProgram        CLEW_GET_FUN(__clewCreateKernelsInProgram        )
1268 #define clRetainKernel                  CLEW_GET_FUN(__clewRetainKernel                  )
1269 #define clReleaseKernel                 CLEW_GET_FUN(__clewReleaseKernel                 )
1270 #define clSetKernelArg                  CLEW_GET_FUN(__clewSetKernelArg                  )
1271 #define clGetKernelInfo                 CLEW_GET_FUN(__clewGetKernelInfo                 )
1272 #define clGetKernelWorkGroupInfo        CLEW_GET_FUN(__clewGetKernelWorkGroupInfo        )
1273 #define clWaitForEvents                 CLEW_GET_FUN(__clewWaitForEvents                 )
1274 #define clGetEventInfo                  CLEW_GET_FUN(__clewGetEventInfo                  )
1275 #define clRetainEvent                   CLEW_GET_FUN(__clewRetainEvent                   )
1276 #define clReleaseEvent                  CLEW_GET_FUN(__clewReleaseEvent                  )
1277 #define clGetEventProfilingInfo         CLEW_GET_FUN(__clewGetEventProfilingInfo         )
1278 #define clFlush                         CLEW_GET_FUN(__clewFlush                         )
1279 #define clFinish                        CLEW_GET_FUN(__clewFinish                        )
1280 #define clEnqueueReadBuffer             CLEW_GET_FUN(__clewEnqueueReadBuffer             )
1281 #define clEnqueueWriteBuffer            CLEW_GET_FUN(__clewEnqueueWriteBuffer            )
1282 #define clEnqueueCopyBuffer             CLEW_GET_FUN(__clewEnqueueCopyBuffer             )
1283 #define clEnqueueReadImage              CLEW_GET_FUN(__clewEnqueueReadImage              )
1284 #define clEnqueueWriteImage             CLEW_GET_FUN(__clewEnqueueWriteImage             )
1285 #define clEnqueueCopyImage              CLEW_GET_FUN(__clewEnqueueCopyImage              )
1286 #define clEnqueueCopyImageToBuffer      CLEW_GET_FUN(__clewEnqueueCopyImageToBuffer      )
1287 #define clEnqueueCopyBufferToImage      CLEW_GET_FUN(__clewEnqueueCopyBufferToImage      )
1288 #define clEnqueueMapBuffer              CLEW_GET_FUN(__clewEnqueueMapBuffer              )
1289 #define clEnqueueMapImage               CLEW_GET_FUN(__clewEnqueueMapImage               )
1290 #define clEnqueueUnmapMemObject         CLEW_GET_FUN(__clewEnqueueUnmapMemObject         )
1291 #define clEnqueueNDRangeKernel          CLEW_GET_FUN(__clewEnqueueNDRangeKernel          )
1292 #define clEnqueueTask                   CLEW_GET_FUN(__clewEnqueueTask                   )
1293 #define clEnqueueNativeKernel           CLEW_GET_FUN(__clewEnqueueNativeKernel           )
1294 #define clEnqueueMarker                 CLEW_GET_FUN(__clewEnqueueMarker                 )
1295 #define clEnqueueWaitForEvents          CLEW_GET_FUN(__clewEnqueueWaitForEvents          )
1296 #define clEnqueueBarrier                CLEW_GET_FUN(__clewEnqueueBarrier                )
1297 #define clGetExtensionFunctionAddress   CLEW_GET_FUN(__clewGetExtensionFunctionAddress   )
1298
1299 #endif  //  CLCC_GENERATE_DOCUMENTATION
1300
1301 #define CLEW_SUCCESS                0       //!<    Success error code
1302 #define CLEW_ERROR_OPEN_FAILED      -1      //!<    Error code for failing to open the dynamic library
1303 #define CLEW_ERROR_ATEXIT_FAILED    -2      //!<    Error code for failing to queue the closing of the dynamic library to atexit()
1304
1305 int clLibraryInit(void);
1306 const char *clErrorString(cl_int error);
1307
1308 CCL_NAMESPACE_END
1309
1310 #endif /*  __UTIL_OPENCL_H__ */
1311