1 /*******************************************************************************
2  * Copyright (c) 2008-2015 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18  *    https://www.khronos.org/registry/
19  *
20  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27  ******************************************************************************/
28 
29 #ifndef __OPENCL_CL_H
30 #define __OPENCL_CL_H
31 
32 #ifdef __APPLE__
33 #include <OpenCL/cl_platform.h>
34 #else
35 #include <CL/cl_platform.h>
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /******************************************************************************/
43 
44 typedef struct _cl_platform_id *    cl_platform_id;
45 typedef struct _cl_device_id *      cl_device_id;
46 typedef struct _cl_context *        cl_context;
47 typedef struct _cl_command_queue *  cl_command_queue;
48 typedef struct _cl_mem *            cl_mem;
49 typedef struct _cl_program *        cl_program;
50 typedef struct _cl_kernel *         cl_kernel;
51 typedef struct _cl_event *          cl_event;
52 typedef struct _cl_sampler *        cl_sampler;
53 
54 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. */
55 typedef cl_ulong            cl_bitfield;
56 typedef cl_bitfield         cl_device_type;
57 typedef cl_uint             cl_platform_info;
58 typedef cl_uint             cl_device_info;
59 typedef cl_bitfield         cl_device_fp_config;
60 typedef cl_uint             cl_device_mem_cache_type;
61 typedef cl_uint             cl_device_local_mem_type;
62 typedef cl_bitfield         cl_device_exec_capabilities;
63 typedef cl_bitfield         cl_command_queue_properties;
64 typedef intptr_t            cl_device_partition_property;
65 typedef cl_bitfield         cl_device_affinity_domain;
66 
67 typedef intptr_t            cl_context_properties;
68 typedef cl_uint             cl_context_info;
69 typedef cl_uint             cl_command_queue_info;
70 typedef cl_uint             cl_channel_order;
71 typedef cl_uint             cl_channel_type;
72 typedef cl_bitfield         cl_mem_flags;
73 typedef cl_uint             cl_mem_object_type;
74 typedef cl_uint             cl_mem_info;
75 typedef cl_bitfield         cl_mem_migration_flags;
76 typedef cl_uint             cl_image_info;
77 typedef cl_uint             cl_buffer_create_type;
78 typedef cl_uint             cl_addressing_mode;
79 typedef cl_uint             cl_filter_mode;
80 typedef cl_uint             cl_sampler_info;
81 typedef cl_bitfield         cl_map_flags;
82 typedef cl_uint             cl_program_info;
83 typedef cl_uint             cl_program_build_info;
84 typedef cl_uint             cl_program_binary_type;
85 typedef cl_int              cl_build_status;
86 typedef cl_uint             cl_kernel_info;
87 typedef cl_uint             cl_kernel_arg_info;
88 typedef cl_uint             cl_kernel_arg_address_qualifier;
89 typedef cl_uint             cl_kernel_arg_access_qualifier;
90 typedef cl_bitfield         cl_kernel_arg_type_qualifier;
91 typedef cl_uint             cl_kernel_work_group_info;
92 typedef cl_uint             cl_event_info;
93 typedef cl_uint             cl_command_type;
94 typedef cl_uint             cl_profiling_info;
95 
96 
97 typedef struct _cl_image_format {
98     cl_channel_order        image_channel_order;
99     cl_channel_type         image_channel_data_type;
100 } cl_image_format;
101 
102 typedef struct _cl_image_desc {
103     cl_mem_object_type      image_type;
104     size_t                  image_width;
105     size_t                  image_height;
106     size_t                  image_depth;
107     size_t                  image_array_size;
108     size_t                  image_row_pitch;
109     size_t                  image_slice_pitch;
110     cl_uint                 num_mip_levels;
111     cl_uint                 num_samples;
112     cl_mem                  buffer;
113 } cl_image_desc;
114 
115 typedef struct _cl_buffer_region {
116     size_t                  origin;
117     size_t                  size;
118 } cl_buffer_region;
119 
120 
121 /******************************************************************************/
122 
123 /* Error Codes */
124 #define CL_SUCCESS                                  0
125 #define CL_DEVICE_NOT_FOUND                         -1
126 #define CL_DEVICE_NOT_AVAILABLE                     -2
127 #define CL_COMPILER_NOT_AVAILABLE                   -3
128 #define CL_MEM_OBJECT_ALLOCATION_FAILURE            -4
129 #define CL_OUT_OF_RESOURCES                         -5
130 #define CL_OUT_OF_HOST_MEMORY                       -6
131 #define CL_PROFILING_INFO_NOT_AVAILABLE             -7
132 #define CL_MEM_COPY_OVERLAP                         -8
133 #define CL_IMAGE_FORMAT_MISMATCH                    -9
134 #define CL_IMAGE_FORMAT_NOT_SUPPORTED               -10
135 #define CL_BUILD_PROGRAM_FAILURE                    -11
136 #define CL_MAP_FAILURE                              -12
137 #define CL_MISALIGNED_SUB_BUFFER_OFFSET             -13
138 #define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
139 #define CL_COMPILE_PROGRAM_FAILURE                  -15
140 #define CL_LINKER_NOT_AVAILABLE                     -16
141 #define CL_LINK_PROGRAM_FAILURE                     -17
142 #define CL_DEVICE_PARTITION_FAILED                  -18
143 #define CL_KERNEL_ARG_INFO_NOT_AVAILABLE            -19
144 
145 #define CL_INVALID_VALUE                            -30
146 #define CL_INVALID_DEVICE_TYPE                      -31
147 #define CL_INVALID_PLATFORM                         -32
148 #define CL_INVALID_DEVICE                           -33
149 #define CL_INVALID_CONTEXT                          -34
150 #define CL_INVALID_QUEUE_PROPERTIES                 -35
151 #define CL_INVALID_COMMAND_QUEUE                    -36
152 #define CL_INVALID_HOST_PTR                         -37
153 #define CL_INVALID_MEM_OBJECT                       -38
154 #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR          -39
155 #define CL_INVALID_IMAGE_SIZE                       -40
156 #define CL_INVALID_SAMPLER                          -41
157 #define CL_INVALID_BINARY                           -42
158 #define CL_INVALID_BUILD_OPTIONS                    -43
159 #define CL_INVALID_PROGRAM                          -44
160 #define CL_INVALID_PROGRAM_EXECUTABLE               -45
161 #define CL_INVALID_KERNEL_NAME                      -46
162 #define CL_INVALID_KERNEL_DEFINITION                -47
163 #define CL_INVALID_KERNEL                           -48
164 #define CL_INVALID_ARG_INDEX                        -49
165 #define CL_INVALID_ARG_VALUE                        -50
166 #define CL_INVALID_ARG_SIZE                         -51
167 #define CL_INVALID_KERNEL_ARGS                      -52
168 #define CL_INVALID_WORK_DIMENSION                   -53
169 #define CL_INVALID_WORK_GROUP_SIZE                  -54
170 #define CL_INVALID_WORK_ITEM_SIZE                   -55
171 #define CL_INVALID_GLOBAL_OFFSET                    -56
172 #define CL_INVALID_EVENT_WAIT_LIST                  -57
173 #define CL_INVALID_EVENT                            -58
174 #define CL_INVALID_OPERATION                        -59
175 #define CL_INVALID_GL_OBJECT                        -60
176 #define CL_INVALID_BUFFER_SIZE                      -61
177 #define CL_INVALID_MIP_LEVEL                        -62
178 #define CL_INVALID_GLOBAL_WORK_SIZE                 -63
179 #define CL_INVALID_PROPERTY                         -64
180 #define CL_INVALID_IMAGE_DESCRIPTOR                 -65
181 #define CL_INVALID_COMPILER_OPTIONS                 -66
182 #define CL_INVALID_LINKER_OPTIONS                   -67
183 #define CL_INVALID_DEVICE_PARTITION_COUNT           -68
184 
185 /* OpenCL Version */
186 #define CL_VERSION_1_0                              1
187 #define CL_VERSION_1_1                              1
188 #define CL_VERSION_1_2                              1
189 
190 /* cl_bool */
191 #define CL_FALSE                                    0
192 #define CL_TRUE                                     1
193 #define CL_BLOCKING                                 CL_TRUE
194 #define CL_NON_BLOCKING                             CL_FALSE
195 
196 /* cl_platform_info */
197 #define CL_PLATFORM_PROFILE                         0x0900
198 #define CL_PLATFORM_VERSION                         0x0901
199 #define CL_PLATFORM_NAME                            0x0902
200 #define CL_PLATFORM_VENDOR                          0x0903
201 #define CL_PLATFORM_EXTENSIONS                      0x0904
202 
203 /* cl_device_type - bitfield */
204 #define CL_DEVICE_TYPE_DEFAULT                      (1 << 0)
205 #define CL_DEVICE_TYPE_CPU                          (1 << 1)
206 #define CL_DEVICE_TYPE_GPU                          (1 << 2)
207 #define CL_DEVICE_TYPE_ACCELERATOR                  (1 << 3)
208 #define CL_DEVICE_TYPE_CUSTOM                       (1 << 4)
209 #define CL_DEVICE_TYPE_ALL                          0xFFFFFFFF
210 
211 /* cl_device_info */
212 #define CL_DEVICE_TYPE                              0x1000
213 #define CL_DEVICE_VENDOR_ID                         0x1001
214 #define CL_DEVICE_MAX_COMPUTE_UNITS                 0x1002
215 #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS          0x1003
216 #define CL_DEVICE_MAX_WORK_GROUP_SIZE               0x1004
217 #define CL_DEVICE_MAX_WORK_ITEM_SIZES               0x1005
218 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR       0x1006
219 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT      0x1007
220 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT        0x1008
221 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG       0x1009
222 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT      0x100A
223 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE     0x100B
224 #define CL_DEVICE_MAX_CLOCK_FREQUENCY               0x100C
225 #define CL_DEVICE_ADDRESS_BITS                      0x100D
226 #define CL_DEVICE_MAX_READ_IMAGE_ARGS               0x100E
227 #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS              0x100F
228 #define CL_DEVICE_MAX_MEM_ALLOC_SIZE                0x1010
229 #define CL_DEVICE_IMAGE2D_MAX_WIDTH                 0x1011
230 #define CL_DEVICE_IMAGE2D_MAX_HEIGHT                0x1012
231 #define CL_DEVICE_IMAGE3D_MAX_WIDTH                 0x1013
232 #define CL_DEVICE_IMAGE3D_MAX_HEIGHT                0x1014
233 #define CL_DEVICE_IMAGE3D_MAX_DEPTH                 0x1015
234 #define CL_DEVICE_IMAGE_SUPPORT                     0x1016
235 #define CL_DEVICE_MAX_PARAMETER_SIZE                0x1017
236 #define CL_DEVICE_MAX_SAMPLERS                      0x1018
237 #define CL_DEVICE_MEM_BASE_ADDR_ALIGN               0x1019
238 #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE          0x101A
239 #define CL_DEVICE_SINGLE_FP_CONFIG                  0x101B
240 #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE             0x101C
241 #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE         0x101D
242 #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE             0x101E
243 #define CL_DEVICE_GLOBAL_MEM_SIZE                   0x101F
244 #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE          0x1020
245 #define CL_DEVICE_MAX_CONSTANT_ARGS                 0x1021
246 #define CL_DEVICE_LOCAL_MEM_TYPE                    0x1022
247 #define CL_DEVICE_LOCAL_MEM_SIZE                    0x1023
248 #define CL_DEVICE_ERROR_CORRECTION_SUPPORT          0x1024
249 #define CL_DEVICE_PROFILING_TIMER_RESOLUTION        0x1025
250 #define CL_DEVICE_ENDIAN_LITTLE                     0x1026
251 #define CL_DEVICE_AVAILABLE                         0x1027
252 #define CL_DEVICE_COMPILER_AVAILABLE                0x1028
253 #define CL_DEVICE_EXECUTION_CAPABILITIES            0x1029
254 #define CL_DEVICE_QUEUE_PROPERTIES                  0x102A
255 #define CL_DEVICE_NAME                              0x102B
256 #define CL_DEVICE_VENDOR                            0x102C
257 #define CL_DRIVER_VERSION                           0x102D
258 #define CL_DEVICE_PROFILE                           0x102E
259 #define CL_DEVICE_VERSION                           0x102F
260 #define CL_DEVICE_EXTENSIONS                        0x1030
261 #define CL_DEVICE_PLATFORM                          0x1031
262 #define CL_DEVICE_DOUBLE_FP_CONFIG                  0x1032
263 /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
264 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF       0x1034
265 #define CL_DEVICE_HOST_UNIFIED_MEMORY               0x1035
266 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR          0x1036
267 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT         0x1037
268 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT           0x1038
269 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG          0x1039
270 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT         0x103A
271 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE        0x103B
272 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF          0x103C
273 #define CL_DEVICE_OPENCL_C_VERSION                  0x103D
274 #define CL_DEVICE_LINKER_AVAILABLE                  0x103E
275 #define CL_DEVICE_BUILT_IN_KERNELS                  0x103F
276 #define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE             0x1040
277 #define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE              0x1041
278 #define CL_DEVICE_PARENT_DEVICE                     0x1042
279 #define CL_DEVICE_PARTITION_MAX_SUB_DEVICES         0x1043
280 #define CL_DEVICE_PARTITION_PROPERTIES              0x1044
281 #define CL_DEVICE_PARTITION_AFFINITY_DOMAIN         0x1045
282 #define CL_DEVICE_PARTITION_TYPE                    0x1046
283 #define CL_DEVICE_REFERENCE_COUNT                   0x1047
284 #define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC       0x1048
285 #define CL_DEVICE_PRINTF_BUFFER_SIZE                0x1049
286 #define CL_DEVICE_IMAGE_PITCH_ALIGNMENT             0x104A
287 #define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT      0x104B
288 
289 /* cl_device_fp_config - bitfield */
290 #define CL_FP_DENORM                                (1 << 0)
291 #define CL_FP_INF_NAN                               (1 << 1)
292 #define CL_FP_ROUND_TO_NEAREST                      (1 << 2)
293 #define CL_FP_ROUND_TO_ZERO                         (1 << 3)
294 #define CL_FP_ROUND_TO_INF                          (1 << 4)
295 #define CL_FP_FMA                                   (1 << 5)
296 #define CL_FP_SOFT_FLOAT                            (1 << 6)
297 #define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT         (1 << 7)
298 
299 /* cl_device_mem_cache_type */
300 #define CL_NONE                                     0x0
301 #define CL_READ_ONLY_CACHE                          0x1
302 #define CL_READ_WRITE_CACHE                         0x2
303 
304 /* cl_device_local_mem_type */
305 #define CL_LOCAL                                    0x1
306 #define CL_GLOBAL                                   0x2
307 
308 /* cl_device_exec_capabilities - bitfield */
309 #define CL_EXEC_KERNEL                              (1 << 0)
310 #define CL_EXEC_NATIVE_KERNEL                       (1 << 1)
311 
312 /* cl_command_queue_properties - bitfield */
313 #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE      (1 << 0)
314 #define CL_QUEUE_PROFILING_ENABLE                   (1 << 1)
315 
316 /* cl_context_info  */
317 #define CL_CONTEXT_REFERENCE_COUNT                  0x1080
318 #define CL_CONTEXT_DEVICES                          0x1081
319 #define CL_CONTEXT_PROPERTIES                       0x1082
320 #define CL_CONTEXT_NUM_DEVICES                      0x1083
321 
322 /* cl_context_properties */
323 #define CL_CONTEXT_PLATFORM                         0x1084
324 #define CL_CONTEXT_INTEROP_USER_SYNC                0x1085
325 
326 /* cl_device_partition_property */
327 #define CL_DEVICE_PARTITION_EQUALLY                 0x1086
328 #define CL_DEVICE_PARTITION_BY_COUNTS               0x1087
329 #define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END      0x0
330 #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN      0x1088
331 
332 /* cl_device_affinity_domain */
333 #define CL_DEVICE_AFFINITY_DOMAIN_NUMA                     (1 << 0)
334 #define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE                 (1 << 1)
335 #define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE                 (1 << 2)
336 #define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE                 (1 << 3)
337 #define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE                 (1 << 4)
338 #define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE       (1 << 5)
339 
340 /* cl_command_queue_info */
341 #define CL_QUEUE_CONTEXT                            0x1090
342 #define CL_QUEUE_DEVICE                             0x1091
343 #define CL_QUEUE_REFERENCE_COUNT                    0x1092
344 #define CL_QUEUE_PROPERTIES                         0x1093
345 
346 /* cl_mem_flags - bitfield */
347 #define CL_MEM_READ_WRITE                           (1 << 0)
348 #define CL_MEM_WRITE_ONLY                           (1 << 1)
349 #define CL_MEM_READ_ONLY                            (1 << 2)
350 #define CL_MEM_USE_HOST_PTR                         (1 << 3)
351 #define CL_MEM_ALLOC_HOST_PTR                       (1 << 4)
352 #define CL_MEM_COPY_HOST_PTR                        (1 << 5)
353 /* reserved                                         (1 << 6)    */
354 #define CL_MEM_HOST_WRITE_ONLY                      (1 << 7)
355 #define CL_MEM_HOST_READ_ONLY                       (1 << 8)
356 #define CL_MEM_HOST_NO_ACCESS                       (1 << 9)
357 
358 /* cl_mem_migration_flags - bitfield */
359 #define CL_MIGRATE_MEM_OBJECT_HOST                  (1 << 0)
360 #define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED     (1 << 1)
361 
362 /* cl_channel_order */
363 #define CL_R                                        0x10B0
364 #define CL_A                                        0x10B1
365 #define CL_RG                                       0x10B2
366 #define CL_RA                                       0x10B3
367 #define CL_RGB                                      0x10B4
368 #define CL_RGBA                                     0x10B5
369 #define CL_BGRA                                     0x10B6
370 #define CL_ARGB                                     0x10B7
371 #define CL_INTENSITY                                0x10B8
372 #define CL_LUMINANCE                                0x10B9
373 #define CL_Rx                                       0x10BA
374 #define CL_RGx                                      0x10BB
375 #define CL_RGBx                                     0x10BC
376 #define CL_DEPTH                                    0x10BD
377 #define CL_DEPTH_STENCIL                            0x10BE
378 
379 /* cl_channel_type */
380 #define CL_SNORM_INT8                               0x10D0
381 #define CL_SNORM_INT16                              0x10D1
382 #define CL_UNORM_INT8                               0x10D2
383 #define CL_UNORM_INT16                              0x10D3
384 #define CL_UNORM_SHORT_565                          0x10D4
385 #define CL_UNORM_SHORT_555                          0x10D5
386 #define CL_UNORM_INT_101010                         0x10D6
387 #define CL_SIGNED_INT8                              0x10D7
388 #define CL_SIGNED_INT16                             0x10D8
389 #define CL_SIGNED_INT32                             0x10D9
390 #define CL_UNSIGNED_INT8                            0x10DA
391 #define CL_UNSIGNED_INT16                           0x10DB
392 #define CL_UNSIGNED_INT32                           0x10DC
393 #define CL_HALF_FLOAT                               0x10DD
394 #define CL_FLOAT                                    0x10DE
395 #define CL_UNORM_INT24                              0x10DF
396 
397 /* cl_mem_object_type */
398 #define CL_MEM_OBJECT_BUFFER                        0x10F0
399 #define CL_MEM_OBJECT_IMAGE2D                       0x10F1
400 #define CL_MEM_OBJECT_IMAGE3D                       0x10F2
401 #define CL_MEM_OBJECT_IMAGE2D_ARRAY                 0x10F3
402 #define CL_MEM_OBJECT_IMAGE1D                       0x10F4
403 #define CL_MEM_OBJECT_IMAGE1D_ARRAY                 0x10F5
404 #define CL_MEM_OBJECT_IMAGE1D_BUFFER                0x10F6
405 
406 /* cl_mem_info */
407 #define CL_MEM_TYPE                                 0x1100
408 #define CL_MEM_FLAGS                                0x1101
409 #define CL_MEM_SIZE                                 0x1102
410 #define CL_MEM_HOST_PTR                             0x1103
411 #define CL_MEM_MAP_COUNT                            0x1104
412 #define CL_MEM_REFERENCE_COUNT                      0x1105
413 #define CL_MEM_CONTEXT                              0x1106
414 #define CL_MEM_ASSOCIATED_MEMOBJECT                 0x1107
415 #define CL_MEM_OFFSET                               0x1108
416 
417 /* cl_image_info */
418 #define CL_IMAGE_FORMAT                             0x1110
419 #define CL_IMAGE_ELEMENT_SIZE                       0x1111
420 #define CL_IMAGE_ROW_PITCH                          0x1112
421 #define CL_IMAGE_SLICE_PITCH                        0x1113
422 #define CL_IMAGE_WIDTH                              0x1114
423 #define CL_IMAGE_HEIGHT                             0x1115
424 #define CL_IMAGE_DEPTH                              0x1116
425 #define CL_IMAGE_ARRAY_SIZE                         0x1117
426 #define CL_IMAGE_BUFFER                             0x1118
427 #define CL_IMAGE_NUM_MIP_LEVELS                     0x1119
428 #define CL_IMAGE_NUM_SAMPLES                        0x111A
429 
430 /* cl_addressing_mode */
431 #define CL_ADDRESS_NONE                             0x1130
432 #define CL_ADDRESS_CLAMP_TO_EDGE                    0x1131
433 #define CL_ADDRESS_CLAMP                            0x1132
434 #define CL_ADDRESS_REPEAT                           0x1133
435 #define CL_ADDRESS_MIRRORED_REPEAT                  0x1134
436 
437 /* cl_filter_mode */
438 #define CL_FILTER_NEAREST                           0x1140
439 #define CL_FILTER_LINEAR                            0x1141
440 
441 /* cl_sampler_info */
442 #define CL_SAMPLER_REFERENCE_COUNT                  0x1150
443 #define CL_SAMPLER_CONTEXT                          0x1151
444 #define CL_SAMPLER_NORMALIZED_COORDS                0x1152
445 #define CL_SAMPLER_ADDRESSING_MODE                  0x1153
446 #define CL_SAMPLER_FILTER_MODE                      0x1154
447 
448 /* cl_map_flags - bitfield */
449 #define CL_MAP_READ                                 (1 << 0)
450 #define CL_MAP_WRITE                                (1 << 1)
451 #define CL_MAP_WRITE_INVALIDATE_REGION              (1 << 2)
452 
453 /* cl_program_info */
454 #define CL_PROGRAM_REFERENCE_COUNT                  0x1160
455 #define CL_PROGRAM_CONTEXT                          0x1161
456 #define CL_PROGRAM_NUM_DEVICES                      0x1162
457 #define CL_PROGRAM_DEVICES                          0x1163
458 #define CL_PROGRAM_SOURCE                           0x1164
459 #define CL_PROGRAM_BINARY_SIZES                     0x1165
460 #define CL_PROGRAM_BINARIES                         0x1166
461 #define CL_PROGRAM_NUM_KERNELS                      0x1167
462 #define CL_PROGRAM_KERNEL_NAMES                     0x1168
463 
464 /* cl_program_build_info */
465 #define CL_PROGRAM_BUILD_STATUS                     0x1181
466 #define CL_PROGRAM_BUILD_OPTIONS                    0x1182
467 #define CL_PROGRAM_BUILD_LOG                        0x1183
468 #define CL_PROGRAM_BINARY_TYPE                      0x1184
469 
470 /* cl_program_binary_type */
471 #define CL_PROGRAM_BINARY_TYPE_NONE                 0x0
472 #define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT      0x1
473 #define CL_PROGRAM_BINARY_TYPE_LIBRARY              0x2
474 #define CL_PROGRAM_BINARY_TYPE_EXECUTABLE           0x4
475 
476 /* cl_build_status */
477 #define CL_BUILD_SUCCESS                            0
478 #define CL_BUILD_NONE                               -1
479 #define CL_BUILD_ERROR                              -2
480 #define CL_BUILD_IN_PROGRESS                        -3
481 
482 /* cl_kernel_info */
483 #define CL_KERNEL_FUNCTION_NAME                     0x1190
484 #define CL_KERNEL_NUM_ARGS                          0x1191
485 #define CL_KERNEL_REFERENCE_COUNT                   0x1192
486 #define CL_KERNEL_CONTEXT                           0x1193
487 #define CL_KERNEL_PROGRAM                           0x1194
488 #define CL_KERNEL_ATTRIBUTES                        0x1195
489 
490 /* cl_kernel_arg_info */
491 #define CL_KERNEL_ARG_ADDRESS_QUALIFIER             0x1196
492 #define CL_KERNEL_ARG_ACCESS_QUALIFIER              0x1197
493 #define CL_KERNEL_ARG_TYPE_NAME                     0x1198
494 #define CL_KERNEL_ARG_TYPE_QUALIFIER                0x1199
495 #define CL_KERNEL_ARG_NAME                          0x119A
496 
497 /* cl_kernel_arg_address_qualifier */
498 #define CL_KERNEL_ARG_ADDRESS_GLOBAL                0x119B
499 #define CL_KERNEL_ARG_ADDRESS_LOCAL                 0x119C
500 #define CL_KERNEL_ARG_ADDRESS_CONSTANT              0x119D
501 #define CL_KERNEL_ARG_ADDRESS_PRIVATE               0x119E
502 
503 /* cl_kernel_arg_access_qualifier */
504 #define CL_KERNEL_ARG_ACCESS_READ_ONLY              0x11A0
505 #define CL_KERNEL_ARG_ACCESS_WRITE_ONLY             0x11A1
506 #define CL_KERNEL_ARG_ACCESS_READ_WRITE             0x11A2
507 #define CL_KERNEL_ARG_ACCESS_NONE                   0x11A3
508 
509 /* cl_kernel_arg_type_qualifer */
510 #define CL_KERNEL_ARG_TYPE_NONE                     0
511 #define CL_KERNEL_ARG_TYPE_CONST                    (1 << 0)
512 #define CL_KERNEL_ARG_TYPE_RESTRICT                 (1 << 1)
513 #define CL_KERNEL_ARG_TYPE_VOLATILE                 (1 << 2)
514 
515 /* cl_kernel_work_group_info */
516 #define CL_KERNEL_WORK_GROUP_SIZE                   0x11B0
517 #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE           0x11B1
518 #define CL_KERNEL_LOCAL_MEM_SIZE                    0x11B2
519 #define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
520 #define CL_KERNEL_PRIVATE_MEM_SIZE                  0x11B4
521 #define CL_KERNEL_GLOBAL_WORK_SIZE                  0x11B5
522 
523 /* cl_event_info  */
524 #define CL_EVENT_COMMAND_QUEUE                      0x11D0
525 #define CL_EVENT_COMMAND_TYPE                       0x11D1
526 #define CL_EVENT_REFERENCE_COUNT                    0x11D2
527 #define CL_EVENT_COMMAND_EXECUTION_STATUS           0x11D3
528 #define CL_EVENT_CONTEXT                            0x11D4
529 
530 /* cl_command_type */
531 #define CL_COMMAND_NDRANGE_KERNEL                   0x11F0
532 #define CL_COMMAND_TASK                             0x11F1
533 #define CL_COMMAND_NATIVE_KERNEL                    0x11F2
534 #define CL_COMMAND_READ_BUFFER                      0x11F3
535 #define CL_COMMAND_WRITE_BUFFER                     0x11F4
536 #define CL_COMMAND_COPY_BUFFER                      0x11F5
537 #define CL_COMMAND_READ_IMAGE                       0x11F6
538 #define CL_COMMAND_WRITE_IMAGE                      0x11F7
539 #define CL_COMMAND_COPY_IMAGE                       0x11F8
540 #define CL_COMMAND_COPY_IMAGE_TO_BUFFER             0x11F9
541 #define CL_COMMAND_COPY_BUFFER_TO_IMAGE             0x11FA
542 #define CL_COMMAND_MAP_BUFFER                       0x11FB
543 #define CL_COMMAND_MAP_IMAGE                        0x11FC
544 #define CL_COMMAND_UNMAP_MEM_OBJECT                 0x11FD
545 #define CL_COMMAND_MARKER                           0x11FE
546 #define CL_COMMAND_ACQUIRE_GL_OBJECTS               0x11FF
547 #define CL_COMMAND_RELEASE_GL_OBJECTS               0x1200
548 #define CL_COMMAND_READ_BUFFER_RECT                 0x1201
549 #define CL_COMMAND_WRITE_BUFFER_RECT                0x1202
550 #define CL_COMMAND_COPY_BUFFER_RECT                 0x1203
551 #define CL_COMMAND_USER                             0x1204
552 #define CL_COMMAND_BARRIER                          0x1205
553 #define CL_COMMAND_MIGRATE_MEM_OBJECTS              0x1206
554 #define CL_COMMAND_FILL_BUFFER                      0x1207
555 #define CL_COMMAND_FILL_IMAGE                       0x1208
556 
557 /* command execution status */
558 #define CL_COMPLETE                                 0x0
559 #define CL_RUNNING                                  0x1
560 #define CL_SUBMITTED                                0x2
561 #define CL_QUEUED                                   0x3
562 
563 /* cl_buffer_create_type  */
564 #define CL_BUFFER_CREATE_TYPE_REGION                0x1220
565 
566 /* cl_profiling_info  */
567 #define CL_PROFILING_COMMAND_QUEUED                 0x1280
568 #define CL_PROFILING_COMMAND_SUBMIT                 0x1281
569 #define CL_PROFILING_COMMAND_START                  0x1282
570 #define CL_PROFILING_COMMAND_END                    0x1283
571 
572 /********************************************************************************************************/
573 
574 /* Platform API */
575 extern CL_API_ENTRY cl_int CL_API_CALL
576 clGetPlatformIDs(cl_uint          /* num_entries */,
577                  cl_platform_id * /* platforms */,
578                  cl_uint *        /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
579 
580 extern CL_API_ENTRY cl_int CL_API_CALL
581 clGetPlatformInfo(cl_platform_id   /* platform */,
582                   cl_platform_info /* param_name */,
583                   size_t           /* param_value_size */,
584                   void *           /* param_value */,
585                   size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
586 
587 /* Device APIs */
588 extern CL_API_ENTRY cl_int CL_API_CALL
589 clGetDeviceIDs(cl_platform_id   /* platform */,
590                cl_device_type   /* device_type */,
591                cl_uint          /* num_entries */,
592                cl_device_id *   /* devices */,
593                cl_uint *        /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
594 
595 extern CL_API_ENTRY cl_int CL_API_CALL
596 clGetDeviceInfo(cl_device_id    /* device */,
597                 cl_device_info  /* param_name */,
598                 size_t          /* param_value_size */,
599                 void *          /* param_value */,
600                 size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
601 
602 extern CL_API_ENTRY cl_int CL_API_CALL
603 clCreateSubDevices(cl_device_id                         /* in_device */,
604                    const cl_device_partition_property * /* properties */,
605                    cl_uint                              /* num_devices */,
606                    cl_device_id *                       /* out_devices */,
607                    cl_uint *                            /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2;
608 
609 extern CL_API_ENTRY cl_int CL_API_CALL
610 clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
611 
612 extern CL_API_ENTRY cl_int CL_API_CALL
613 clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
614 
615 /* Context APIs  */
616 extern CL_API_ENTRY cl_context CL_API_CALL
617 clCreateContext(const cl_context_properties * /* properties */,
618                 cl_uint                 /* num_devices */,
619                 const cl_device_id *    /* devices */,
620                 void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
621                 void *                  /* user_data */,
622                 cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
623 
624 extern CL_API_ENTRY cl_context CL_API_CALL
625 clCreateContextFromType(const cl_context_properties * /* properties */,
626                         cl_device_type          /* device_type */,
627                         void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
628                         void *                  /* user_data */,
629                         cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
630 
631 extern CL_API_ENTRY cl_int CL_API_CALL
632 clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
633 
634 extern CL_API_ENTRY cl_int CL_API_CALL
635 clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
636 
637 extern CL_API_ENTRY cl_int CL_API_CALL
638 clGetContextInfo(cl_context         /* context */,
639                  cl_context_info    /* param_name */,
640                  size_t             /* param_value_size */,
641                  void *             /* param_value */,
642                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
643 
644 /* Command Queue APIs */
645 extern CL_API_ENTRY cl_command_queue CL_API_CALL
646 clCreateCommandQueue(cl_context                     /* context */,
647                      cl_device_id                   /* device */,
648                      cl_command_queue_properties    /* properties */,
649                      cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
650 
651 extern CL_API_ENTRY cl_int CL_API_CALL
652 clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
653 
654 extern CL_API_ENTRY cl_int CL_API_CALL
655 clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
656 
657 extern CL_API_ENTRY cl_int CL_API_CALL
658 clGetCommandQueueInfo(cl_command_queue      /* command_queue */,
659                       cl_command_queue_info /* param_name */,
660                       size_t                /* param_value_size */,
661                       void *                /* param_value */,
662                       size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
663 
664 /* Memory Object APIs */
665 extern CL_API_ENTRY cl_mem CL_API_CALL
666 clCreateBuffer(cl_context   /* context */,
667                cl_mem_flags /* flags */,
668                size_t       /* size */,
669                void *       /* host_ptr */,
670                cl_int *     /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
671 
672 extern CL_API_ENTRY cl_mem CL_API_CALL
673 clCreateSubBuffer(cl_mem                   /* buffer */,
674                   cl_mem_flags             /* flags */,
675                   cl_buffer_create_type    /* buffer_create_type */,
676                   const void *             /* buffer_create_info */,
677                   cl_int *                 /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
678 
679 extern CL_API_ENTRY cl_mem CL_API_CALL
680 clCreateImage(cl_context              /* context */,
681               cl_mem_flags            /* flags */,
682               const cl_image_format * /* image_format */,
683               const cl_image_desc *   /* image_desc */,
684               void *                  /* host_ptr */,
685               cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
686 
687 extern CL_API_ENTRY cl_int CL_API_CALL
688 clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
689 
690 extern CL_API_ENTRY cl_int CL_API_CALL
691 clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
692 
693 extern CL_API_ENTRY cl_int CL_API_CALL
694 clGetSupportedImageFormats(cl_context           /* context */,
695                            cl_mem_flags         /* flags */,
696                            cl_mem_object_type   /* image_type */,
697                            cl_uint              /* num_entries */,
698                            cl_image_format *    /* image_formats */,
699                            cl_uint *            /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
700 
701 extern CL_API_ENTRY cl_int CL_API_CALL
702 clGetMemObjectInfo(cl_mem           /* memobj */,
703                    cl_mem_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 extern CL_API_ENTRY cl_int CL_API_CALL
709 clGetImageInfo(cl_mem           /* image */,
710                cl_image_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 extern CL_API_ENTRY cl_int CL_API_CALL
716 clSetMemObjectDestructorCallback(  cl_mem /* memobj */,
717                                     void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
718                                     void * /*user_data */ )             CL_API_SUFFIX__VERSION_1_1;
719 
720 /* Sampler APIs */
721 extern CL_API_ENTRY cl_sampler CL_API_CALL
722 clCreateSampler(cl_context          /* context */,
723                 cl_bool             /* normalized_coords */,
724                 cl_addressing_mode  /* addressing_mode */,
725                 cl_filter_mode      /* filter_mode */,
726                 cl_int *            /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
727 
728 extern CL_API_ENTRY cl_int CL_API_CALL
729 clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
730 
731 extern CL_API_ENTRY cl_int CL_API_CALL
732 clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
733 
734 extern CL_API_ENTRY cl_int CL_API_CALL
735 clGetSamplerInfo(cl_sampler         /* sampler */,
736                  cl_sampler_info    /* param_name */,
737                  size_t             /* param_value_size */,
738                  void *             /* param_value */,
739                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
740 
741 /* Program Object APIs  */
742 extern CL_API_ENTRY cl_program CL_API_CALL
743 clCreateProgramWithSource(cl_context        /* context */,
744                           cl_uint           /* count */,
745                           const char **     /* strings */,
746                           const size_t *    /* lengths */,
747                           cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
748 
749 extern CL_API_ENTRY cl_program CL_API_CALL
750 clCreateProgramWithBinary(cl_context                     /* context */,
751                           cl_uint                        /* num_devices */,
752                           const cl_device_id *           /* device_list */,
753                           const size_t *                 /* lengths */,
754                           const unsigned char **         /* binaries */,
755                           cl_int *                       /* binary_status */,
756                           cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
757 
758 extern CL_API_ENTRY cl_program CL_API_CALL
759 clCreateProgramWithBuiltInKernels(cl_context            /* context */,
760                                   cl_uint               /* num_devices */,
761                                   const cl_device_id *  /* device_list */,
762                                   const char *          /* kernel_names */,
763                                   cl_int *              /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
764 
765 extern CL_API_ENTRY cl_int CL_API_CALL
766 clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
767 
768 extern CL_API_ENTRY cl_int CL_API_CALL
769 clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
770 
771 extern CL_API_ENTRY cl_int CL_API_CALL
772 clBuildProgram(cl_program           /* program */,
773                cl_uint              /* num_devices */,
774                const cl_device_id * /* device_list */,
775                const char *         /* options */,
776                void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
777                void *               /* user_data */) CL_API_SUFFIX__VERSION_1_0;
778 
779 extern CL_API_ENTRY cl_int CL_API_CALL
780 clCompileProgram(cl_program           /* program */,
781                  cl_uint              /* num_devices */,
782                  const cl_device_id * /* device_list */,
783                  const char *         /* options */,
784                  cl_uint              /* num_input_headers */,
785                  const cl_program *   /* input_headers */,
786                  const char **        /* header_include_names */,
787                  void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
788                  void *               /* user_data */) CL_API_SUFFIX__VERSION_1_2;
789 
790 extern CL_API_ENTRY cl_program CL_API_CALL
791 clLinkProgram(cl_context           /* context */,
792               cl_uint              /* num_devices */,
793               const cl_device_id * /* device_list */,
794               const char *         /* options */,
795               cl_uint              /* num_input_programs */,
796               const cl_program *   /* input_programs */,
797               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
798               void *               /* user_data */,
799               cl_int *             /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2;
800 
801 
802 extern CL_API_ENTRY cl_int CL_API_CALL
803 clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2;
804 
805 extern CL_API_ENTRY cl_int CL_API_CALL
806 clGetProgramInfo(cl_program         /* program */,
807                  cl_program_info    /* param_name */,
808                  size_t             /* param_value_size */,
809                  void *             /* param_value */,
810                  size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
811 
812 extern CL_API_ENTRY cl_int CL_API_CALL
813 clGetProgramBuildInfo(cl_program            /* program */,
814                       cl_device_id          /* device */,
815                       cl_program_build_info /* param_name */,
816                       size_t                /* param_value_size */,
817                       void *                /* param_value */,
818                       size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
819 
820 /* Kernel Object APIs */
821 extern CL_API_ENTRY cl_kernel CL_API_CALL
822 clCreateKernel(cl_program      /* program */,
823                const char *    /* kernel_name */,
824                cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
825 
826 extern CL_API_ENTRY cl_int CL_API_CALL
827 clCreateKernelsInProgram(cl_program     /* program */,
828                          cl_uint        /* num_kernels */,
829                          cl_kernel *    /* kernels */,
830                          cl_uint *      /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
831 
832 extern CL_API_ENTRY cl_int CL_API_CALL
833 clRetainKernel(cl_kernel    /* kernel */) CL_API_SUFFIX__VERSION_1_0;
834 
835 extern CL_API_ENTRY cl_int CL_API_CALL
836 clReleaseKernel(cl_kernel   /* kernel */) CL_API_SUFFIX__VERSION_1_0;
837 
838 extern CL_API_ENTRY cl_int CL_API_CALL
839 clSetKernelArg(cl_kernel    /* kernel */,
840                cl_uint      /* arg_index */,
841                size_t       /* arg_size */,
842                const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
843 
844 extern CL_API_ENTRY cl_int CL_API_CALL
845 clGetKernelInfo(cl_kernel       /* kernel */,
846                 cl_kernel_info  /* param_name */,
847                 size_t          /* param_value_size */,
848                 void *          /* param_value */,
849                 size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
850 
851 extern CL_API_ENTRY cl_int CL_API_CALL
852 clGetKernelArgInfo(cl_kernel       /* kernel */,
853                    cl_uint         /* arg_indx */,
854                    cl_kernel_arg_info  /* param_name */,
855                    size_t          /* param_value_size */,
856                    void *          /* param_value */,
857                    size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
858 
859 extern CL_API_ENTRY cl_int CL_API_CALL
860 clGetKernelWorkGroupInfo(cl_kernel                  /* kernel */,
861                          cl_device_id               /* device */,
862                          cl_kernel_work_group_info  /* param_name */,
863                          size_t                     /* param_value_size */,
864                          void *                     /* param_value */,
865                          size_t *                   /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
866 
867 /* Event Object APIs */
868 extern CL_API_ENTRY cl_int CL_API_CALL
869 clWaitForEvents(cl_uint             /* num_events */,
870                 const cl_event *    /* event_list */) CL_API_SUFFIX__VERSION_1_0;
871 
872 extern CL_API_ENTRY cl_int CL_API_CALL
873 clGetEventInfo(cl_event         /* event */,
874                cl_event_info    /* param_name */,
875                size_t           /* param_value_size */,
876                void *           /* param_value */,
877                size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
878 
879 extern CL_API_ENTRY cl_event CL_API_CALL
880 clCreateUserEvent(cl_context    /* context */,
881                   cl_int *      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
882 
883 extern CL_API_ENTRY cl_int CL_API_CALL
884 clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
885 
886 extern CL_API_ENTRY cl_int CL_API_CALL
887 clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
888 
889 extern CL_API_ENTRY cl_int CL_API_CALL
890 clSetUserEventStatus(cl_event   /* event */,
891                      cl_int     /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
892 
893 extern CL_API_ENTRY cl_int CL_API_CALL
894 clSetEventCallback( cl_event    /* event */,
895                     cl_int      /* command_exec_callback_type */,
896                     void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
897                     void *      /* user_data */) CL_API_SUFFIX__VERSION_1_1;
898 
899 /* Profiling APIs */
900 extern CL_API_ENTRY cl_int CL_API_CALL
901 clGetEventProfilingInfo(cl_event            /* event */,
902                         cl_profiling_info   /* param_name */,
903                         size_t              /* param_value_size */,
904                         void *              /* param_value */,
905                         size_t *            /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
906 
907 /* Flush and Finish APIs */
908 extern CL_API_ENTRY cl_int CL_API_CALL
909 clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
910 
911 extern CL_API_ENTRY cl_int CL_API_CALL
912 clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
913 
914 /* Enqueued Commands APIs */
915 extern CL_API_ENTRY cl_int CL_API_CALL
916 clEnqueueReadBuffer(cl_command_queue    /* command_queue */,
917                     cl_mem              /* buffer */,
918                     cl_bool             /* blocking_read */,
919                     size_t              /* offset */,
920                     size_t              /* size */,
921                     void *              /* ptr */,
922                     cl_uint             /* num_events_in_wait_list */,
923                     const cl_event *    /* event_wait_list */,
924                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
925 
926 extern CL_API_ENTRY cl_int CL_API_CALL
927 clEnqueueReadBufferRect(cl_command_queue    /* command_queue */,
928                         cl_mem              /* buffer */,
929                         cl_bool             /* blocking_read */,
930                         const size_t *      /* buffer_offset */,
931                         const size_t *      /* host_offset */,
932                         const size_t *      /* region */,
933                         size_t              /* buffer_row_pitch */,
934                         size_t              /* buffer_slice_pitch */,
935                         size_t              /* host_row_pitch */,
936                         size_t              /* host_slice_pitch */,
937                         void *              /* ptr */,
938                         cl_uint             /* num_events_in_wait_list */,
939                         const cl_event *    /* event_wait_list */,
940                         cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
941 
942 extern CL_API_ENTRY cl_int CL_API_CALL
943 clEnqueueWriteBuffer(cl_command_queue   /* command_queue */,
944                      cl_mem             /* buffer */,
945                      cl_bool            /* blocking_write */,
946                      size_t             /* offset */,
947                      size_t             /* size */,
948                      const void *       /* ptr */,
949                      cl_uint            /* num_events_in_wait_list */,
950                      const cl_event *   /* event_wait_list */,
951                      cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_0;
952 
953 extern CL_API_ENTRY cl_int CL_API_CALL
954 clEnqueueWriteBufferRect(cl_command_queue    /* command_queue */,
955                          cl_mem              /* buffer */,
956                          cl_bool             /* blocking_write */,
957                          const size_t *      /* buffer_offset */,
958                          const size_t *      /* host_offset */,
959                          const size_t *      /* region */,
960                          size_t              /* buffer_row_pitch */,
961                          size_t              /* buffer_slice_pitch */,
962                          size_t              /* host_row_pitch */,
963                          size_t              /* host_slice_pitch */,
964                          const void *        /* ptr */,
965                          cl_uint             /* num_events_in_wait_list */,
966                          const cl_event *    /* event_wait_list */,
967                          cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
968 
969 extern CL_API_ENTRY cl_int CL_API_CALL
970 clEnqueueFillBuffer(cl_command_queue   /* command_queue */,
971                     cl_mem             /* buffer */,
972                     const void *       /* pattern */,
973                     size_t             /* pattern_size */,
974                     size_t             /* offset */,
975                     size_t             /* size */,
976                     cl_uint            /* num_events_in_wait_list */,
977                     const cl_event *   /* event_wait_list */,
978                     cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_2;
979 
980 extern CL_API_ENTRY cl_int CL_API_CALL
981 clEnqueueCopyBuffer(cl_command_queue    /* command_queue */,
982                     cl_mem              /* src_buffer */,
983                     cl_mem              /* dst_buffer */,
984                     size_t              /* src_offset */,
985                     size_t              /* dst_offset */,
986                     size_t              /* size */,
987                     cl_uint             /* num_events_in_wait_list */,
988                     const cl_event *    /* event_wait_list */,
989                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
990 
991 extern CL_API_ENTRY cl_int CL_API_CALL
992 clEnqueueCopyBufferRect(cl_command_queue    /* command_queue */,
993                         cl_mem              /* src_buffer */,
994                         cl_mem              /* dst_buffer */,
995                         const size_t *      /* src_origin */,
996                         const size_t *      /* dst_origin */,
997                         const size_t *      /* region */,
998                         size_t              /* src_row_pitch */,
999                         size_t              /* src_slice_pitch */,
1000                         size_t              /* dst_row_pitch */,
1001                         size_t              /* dst_slice_pitch */,
1002                         cl_uint             /* num_events_in_wait_list */,
1003                         const cl_event *    /* event_wait_list */,
1004                         cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
1005 
1006 extern CL_API_ENTRY cl_int CL_API_CALL
1007 clEnqueueReadImage(cl_command_queue     /* command_queue */,
1008                    cl_mem               /* image */,
1009                    cl_bool              /* blocking_read */,
1010                    const size_t *       /* origin[3] */,
1011                    const size_t *       /* region[3] */,
1012                    size_t               /* row_pitch */,
1013                    size_t               /* slice_pitch */,
1014                    void *               /* ptr */,
1015                    cl_uint              /* num_events_in_wait_list */,
1016                    const cl_event *     /* event_wait_list */,
1017                    cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
1018 
1019 extern CL_API_ENTRY cl_int CL_API_CALL
1020 clEnqueueWriteImage(cl_command_queue    /* command_queue */,
1021                     cl_mem              /* image */,
1022                     cl_bool             /* blocking_write */,
1023                     const size_t *      /* origin[3] */,
1024                     const size_t *      /* region[3] */,
1025                     size_t              /* input_row_pitch */,
1026                     size_t              /* input_slice_pitch */,
1027                     const void *        /* ptr */,
1028                     cl_uint             /* num_events_in_wait_list */,
1029                     const cl_event *    /* event_wait_list */,
1030                     cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
1031 
1032 extern CL_API_ENTRY cl_int CL_API_CALL
1033 clEnqueueFillImage(cl_command_queue   /* command_queue */,
1034                    cl_mem             /* image */,
1035                    const void *       /* fill_color */,
1036                    const size_t *     /* origin[3] */,
1037                    const size_t *     /* region[3] */,
1038                    cl_uint            /* num_events_in_wait_list */,
1039                    const cl_event *   /* event_wait_list */,
1040                    cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_2;
1041 
1042 extern CL_API_ENTRY cl_int CL_API_CALL
1043 clEnqueueCopyImage(cl_command_queue     /* command_queue */,
1044                    cl_mem               /* src_image */,
1045                    cl_mem               /* dst_image */,
1046                    const size_t *       /* src_origin[3] */,
1047                    const size_t *       /* dst_origin[3] */,
1048                    const size_t *       /* region[3] */,
1049                    cl_uint              /* num_events_in_wait_list */,
1050                    const cl_event *     /* event_wait_list */,
1051                    cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
1052 
1053 extern CL_API_ENTRY cl_int CL_API_CALL
1054 clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
1055                            cl_mem           /* src_image */,
1056                            cl_mem           /* dst_buffer */,
1057                            const size_t *   /* src_origin[3] */,
1058                            const size_t *   /* region[3] */,
1059                            size_t           /* dst_offset */,
1060                            cl_uint          /* num_events_in_wait_list */,
1061                            const cl_event * /* event_wait_list */,
1062                            cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
1063 
1064 extern CL_API_ENTRY cl_int CL_API_CALL
1065 clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
1066                            cl_mem           /* src_buffer */,
1067                            cl_mem           /* dst_image */,
1068                            size_t           /* src_offset */,
1069                            const size_t *   /* dst_origin[3] */,
1070                            const size_t *   /* region[3] */,
1071                            cl_uint          /* num_events_in_wait_list */,
1072                            const cl_event * /* event_wait_list */,
1073                            cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
1074 
1075 extern CL_API_ENTRY void * CL_API_CALL
1076 clEnqueueMapBuffer(cl_command_queue /* command_queue */,
1077                    cl_mem           /* buffer */,
1078                    cl_bool          /* blocking_map */,
1079                    cl_map_flags     /* map_flags */,
1080                    size_t           /* offset */,
1081                    size_t           /* size */,
1082                    cl_uint          /* num_events_in_wait_list */,
1083                    const cl_event * /* event_wait_list */,
1084                    cl_event *       /* event */,
1085                    cl_int *         /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
1086 
1087 extern CL_API_ENTRY void * CL_API_CALL
1088 clEnqueueMapImage(cl_command_queue  /* command_queue */,
1089                   cl_mem            /* image */,
1090                   cl_bool           /* blocking_map */,
1091                   cl_map_flags      /* map_flags */,
1092                   const size_t *    /* origin[3] */,
1093                   const size_t *    /* region[3] */,
1094                   size_t *          /* image_row_pitch */,
1095                   size_t *          /* image_slice_pitch */,
1096                   cl_uint           /* num_events_in_wait_list */,
1097                   const cl_event *  /* event_wait_list */,
1098                   cl_event *        /* event */,
1099                   cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
1100 
1101 extern CL_API_ENTRY cl_int CL_API_CALL
1102 clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
1103                         cl_mem           /* memobj */,
1104                         void *           /* mapped_ptr */,
1105                         cl_uint          /* num_events_in_wait_list */,
1106                         const cl_event *  /* event_wait_list */,
1107                         cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
1108 
1109 extern CL_API_ENTRY cl_int CL_API_CALL
1110 clEnqueueMigrateMemObjects(cl_command_queue       /* command_queue */,
1111                            cl_uint                /* num_mem_objects */,
1112                            const cl_mem *         /* mem_objects */,
1113                            cl_mem_migration_flags /* flags */,
1114                            cl_uint                /* num_events_in_wait_list */,
1115                            const cl_event *       /* event_wait_list */,
1116                            cl_event *             /* event */) CL_API_SUFFIX__VERSION_1_2;
1117 
1118 extern CL_API_ENTRY cl_int CL_API_CALL
1119 clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
1120                        cl_kernel        /* kernel */,
1121                        cl_uint          /* work_dim */,
1122                        const size_t *   /* global_work_offset */,
1123                        const size_t *   /* global_work_size */,
1124                        const size_t *   /* local_work_size */,
1125                        cl_uint          /* num_events_in_wait_list */,
1126                        const cl_event * /* event_wait_list */,
1127                        cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
1128 
1129 extern CL_API_ENTRY cl_int CL_API_CALL
1130 clEnqueueTask(cl_command_queue  /* command_queue */,
1131               cl_kernel         /* kernel */,
1132               cl_uint           /* num_events_in_wait_list */,
1133               const cl_event *  /* event_wait_list */,
1134               cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
1135 
1136 extern CL_API_ENTRY cl_int CL_API_CALL
1137 clEnqueueNativeKernel(cl_command_queue  /* command_queue */,
1138 					  void (CL_CALLBACK * /*user_func*/)(void *),
1139                       void *            /* args */,
1140                       size_t            /* cb_args */,
1141                       cl_uint           /* num_mem_objects */,
1142                       const cl_mem *    /* mem_list */,
1143                       const void **     /* args_mem_loc */,
1144                       cl_uint           /* num_events_in_wait_list */,
1145                       const cl_event *  /* event_wait_list */,
1146                       cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
1147 
1148 extern CL_API_ENTRY cl_int CL_API_CALL
1149 clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */,
1150                             cl_uint           /* num_events_in_wait_list */,
1151                             const cl_event *  /* event_wait_list */,
1152                             cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_2;
1153 
1154 extern CL_API_ENTRY cl_int CL_API_CALL
1155 clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */,
1156                              cl_uint           /* num_events_in_wait_list */,
1157                              const cl_event *  /* event_wait_list */,
1158                              cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_2;
1159 
1160 
1161 /* Extension function access
1162  *
1163  * Returns the extension function address for the given function name,
1164  * or NULL if a valid function can not be found.  The client must
1165  * check to make sure the address is not NULL, before using or
1166  * calling the returned function address.
1167  */
1168 extern CL_API_ENTRY void * CL_API_CALL
1169 clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
1170                                          const char *   /* func_name */) CL_API_SUFFIX__VERSION_1_2;
1171 
1172 
1173 /* Deprecated OpenCL 1.1 APIs */
1174 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
1175 clCreateImage2D(cl_context              /* context */,
1176                 cl_mem_flags            /* flags */,
1177                 const cl_image_format * /* image_format */,
1178                 size_t                  /* image_width */,
1179                 size_t                  /* image_height */,
1180                 size_t                  /* image_row_pitch */,
1181                 void *                  /* host_ptr */,
1182                 cl_int *                /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1183 
1184 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
1185 clCreateImage3D(cl_context              /* context */,
1186                 cl_mem_flags            /* flags */,
1187                 const cl_image_format * /* image_format */,
1188                 size_t                  /* image_width */,
1189                 size_t                  /* image_height */,
1190                 size_t                  /* image_depth */,
1191                 size_t                  /* image_row_pitch */,
1192                 size_t                  /* image_slice_pitch */,
1193                 void *                  /* host_ptr */,
1194                 cl_int *                /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1195 
1196 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1197 clEnqueueMarker(cl_command_queue    /* command_queue */,
1198                 cl_event *          /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1199 
1200 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1201 clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
1202                         cl_uint          /* num_events */,
1203                         const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1204 
1205 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1206 clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1207 
1208 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1209 clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1210 
1211 extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
1212 clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
1213 
1214 #ifdef __cplusplus
1215 }
1216 #endif
1217 
1218 #endif  /* __OPENCL_CL_H */
1219 
1220