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