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