xref: /aosp_15_r20/external/angle/include/CL/cl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 /*******************************************************************************
2  * Copyright (c) 2008-2020 The Khronos Group Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *    http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 
17 #ifndef __OPENCL_CL_H
18 #define __OPENCL_CL_H
19 
20 #include <CL/cl_version.h>
21 #include <CL/cl_platform.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /******************************************************************************/
28 
29 typedef struct _cl_platform_id *    cl_platform_id;
30 typedef struct _cl_device_id *      cl_device_id;
31 typedef struct _cl_context *        cl_context;
32 typedef struct _cl_command_queue *  cl_command_queue;
33 typedef struct _cl_mem *            cl_mem;
34 typedef struct _cl_program *        cl_program;
35 typedef struct _cl_kernel *         cl_kernel;
36 typedef struct _cl_event *          cl_event;
37 typedef struct _cl_sampler *        cl_sampler;
38 
39 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. */
40 typedef cl_ulong            cl_bitfield;
41 typedef cl_ulong            cl_properties;
42 typedef cl_bitfield         cl_device_type;
43 typedef cl_uint             cl_platform_info;
44 typedef cl_uint             cl_device_info;
45 typedef cl_bitfield         cl_device_fp_config;
46 typedef cl_uint             cl_device_mem_cache_type;
47 typedef cl_uint             cl_device_local_mem_type;
48 typedef cl_bitfield         cl_device_exec_capabilities;
49 #ifdef CL_VERSION_2_0
50 typedef cl_bitfield         cl_device_svm_capabilities;
51 #endif
52 typedef cl_bitfield         cl_command_queue_properties;
53 #ifdef CL_VERSION_1_2
54 typedef intptr_t            cl_device_partition_property;
55 typedef cl_bitfield         cl_device_affinity_domain;
56 #endif
57 
58 typedef intptr_t            cl_context_properties;
59 typedef cl_uint             cl_context_info;
60 #ifdef CL_VERSION_2_0
61 typedef cl_properties       cl_queue_properties;
62 #endif
63 typedef cl_uint             cl_command_queue_info;
64 typedef cl_uint             cl_channel_order;
65 typedef cl_uint             cl_channel_type;
66 typedef cl_bitfield         cl_mem_flags;
67 #ifdef CL_VERSION_2_0
68 typedef cl_bitfield         cl_svm_mem_flags;
69 #endif
70 typedef cl_uint             cl_mem_object_type;
71 typedef cl_uint             cl_mem_info;
72 #ifdef CL_VERSION_1_2
73 typedef cl_bitfield         cl_mem_migration_flags;
74 #endif
75 typedef cl_uint             cl_image_info;
76 #ifdef CL_VERSION_1_1
77 typedef cl_uint             cl_buffer_create_type;
78 #endif
79 typedef cl_uint             cl_addressing_mode;
80 typedef cl_uint             cl_filter_mode;
81 typedef cl_uint             cl_sampler_info;
82 typedef cl_bitfield         cl_map_flags;
83 #ifdef CL_VERSION_2_0
84 typedef intptr_t            cl_pipe_properties;
85 typedef cl_uint             cl_pipe_info;
86 #endif
87 typedef cl_uint             cl_program_info;
88 typedef cl_uint             cl_program_build_info;
89 #ifdef CL_VERSION_1_2
90 typedef cl_uint             cl_program_binary_type;
91 #endif
92 typedef cl_int              cl_build_status;
93 typedef cl_uint             cl_kernel_info;
94 #ifdef CL_VERSION_1_2
95 typedef cl_uint             cl_kernel_arg_info;
96 typedef cl_uint             cl_kernel_arg_address_qualifier;
97 typedef cl_uint             cl_kernel_arg_access_qualifier;
98 typedef cl_bitfield         cl_kernel_arg_type_qualifier;
99 #endif
100 typedef cl_uint             cl_kernel_work_group_info;
101 #ifdef CL_VERSION_2_1
102 typedef cl_uint             cl_kernel_sub_group_info;
103 #endif
104 typedef cl_uint             cl_event_info;
105 typedef cl_uint             cl_command_type;
106 typedef cl_uint             cl_profiling_info;
107 #ifdef CL_VERSION_2_0
108 typedef cl_properties       cl_sampler_properties;
109 typedef cl_uint             cl_kernel_exec_info;
110 #endif
111 #ifdef CL_VERSION_3_0
112 typedef cl_bitfield         cl_device_atomic_capabilities;
113 typedef cl_bitfield         cl_device_device_enqueue_capabilities;
114 typedef cl_uint             cl_khronos_vendor_id;
115 typedef cl_properties       cl_mem_properties;
116 typedef cl_uint             cl_version;
117 #endif
118 
119 typedef struct _cl_image_format {
120     cl_channel_order        image_channel_order;
121     cl_channel_type         image_channel_data_type;
122 } cl_image_format;
123 
124 #ifdef CL_VERSION_1_2
125 
126 typedef struct _cl_image_desc {
127     cl_mem_object_type      image_type;
128     size_t                  image_width;
129     size_t                  image_height;
130     size_t                  image_depth;
131     size_t                  image_array_size;
132     size_t                  image_row_pitch;
133     size_t                  image_slice_pitch;
134     cl_uint                 num_mip_levels;
135     cl_uint                 num_samples;
136 #ifdef CL_VERSION_2_0
137 #if defined(__GNUC__)
138     __extension__                   /* Prevents warnings about anonymous union in -pedantic builds */
139 #endif
140 #if defined(_MSC_VER) && !defined(__STDC__)
141 #pragma warning( push )
142 #pragma warning( disable : 4201 )   /* Prevents warning about nameless struct/union in /W4 builds */
143 #endif
144 #ifdef __clang__
145 #pragma clang diagnostic push
146 #pragma clang diagnostic ignored "-Wc11-extensions" /* Prevents warning about nameless union being C11 extension*/
147 #endif
148 #if defined(_MSC_VER) && defined(__STDC__)
149     /* Anonymous unions are not supported in /Za builds */
150 #else
151     union {
152 #endif
153 #endif
154       cl_mem                  buffer;
155 #ifdef CL_VERSION_2_0
156 #if defined(_MSC_VER) && defined(__STDC__)
157     /* Anonymous unions are not supported in /Za builds */
158 #else
159       cl_mem                  mem_object;
160     };
161 #endif
162 #if defined(_MSC_VER) && !defined(__STDC__)
163 #pragma warning( pop )
164 #endif
165 #ifdef __clang__
166 #pragma clang diagnostic pop
167 #endif
168 #endif
169 } cl_image_desc;
170 
171 #endif
172 
173 #ifdef CL_VERSION_1_1
174 
175 typedef struct _cl_buffer_region {
176     size_t                  origin;
177     size_t                  size;
178 } cl_buffer_region;
179 
180 #endif
181 
182 #ifdef CL_VERSION_3_0
183 
184 #define CL_NAME_VERSION_MAX_NAME_SIZE 64
185 
186 typedef struct _cl_name_version {
187     cl_version              version;
188     char                    name[CL_NAME_VERSION_MAX_NAME_SIZE];
189 } cl_name_version;
190 
191 #endif
192 
193 /******************************************************************************/
194 
195 /* Error Codes */
196 #define CL_SUCCESS                                  0
197 #define CL_DEVICE_NOT_FOUND                         -1
198 #define CL_DEVICE_NOT_AVAILABLE                     -2
199 #define CL_COMPILER_NOT_AVAILABLE                   -3
200 #define CL_MEM_OBJECT_ALLOCATION_FAILURE            -4
201 #define CL_OUT_OF_RESOURCES                         -5
202 #define CL_OUT_OF_HOST_MEMORY                       -6
203 #define CL_PROFILING_INFO_NOT_AVAILABLE             -7
204 #define CL_MEM_COPY_OVERLAP                         -8
205 #define CL_IMAGE_FORMAT_MISMATCH                    -9
206 #define CL_IMAGE_FORMAT_NOT_SUPPORTED               -10
207 #define CL_BUILD_PROGRAM_FAILURE                    -11
208 #define CL_MAP_FAILURE                              -12
209 #ifdef CL_VERSION_1_1
210 #define CL_MISALIGNED_SUB_BUFFER_OFFSET             -13
211 #define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
212 #endif
213 #ifdef CL_VERSION_1_2
214 #define CL_COMPILE_PROGRAM_FAILURE                  -15
215 #define CL_LINKER_NOT_AVAILABLE                     -16
216 #define CL_LINK_PROGRAM_FAILURE                     -17
217 #define CL_DEVICE_PARTITION_FAILED                  -18
218 #define CL_KERNEL_ARG_INFO_NOT_AVAILABLE            -19
219 #endif
220 
221 #define CL_INVALID_VALUE                            -30
222 #define CL_INVALID_DEVICE_TYPE                      -31
223 #define CL_INVALID_PLATFORM                         -32
224 #define CL_INVALID_DEVICE                           -33
225 #define CL_INVALID_CONTEXT                          -34
226 #define CL_INVALID_QUEUE_PROPERTIES                 -35
227 #define CL_INVALID_COMMAND_QUEUE                    -36
228 #define CL_INVALID_HOST_PTR                         -37
229 #define CL_INVALID_MEM_OBJECT                       -38
230 #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR          -39
231 #define CL_INVALID_IMAGE_SIZE                       -40
232 #define CL_INVALID_SAMPLER                          -41
233 #define CL_INVALID_BINARY                           -42
234 #define CL_INVALID_BUILD_OPTIONS                    -43
235 #define CL_INVALID_PROGRAM                          -44
236 #define CL_INVALID_PROGRAM_EXECUTABLE               -45
237 #define CL_INVALID_KERNEL_NAME                      -46
238 #define CL_INVALID_KERNEL_DEFINITION                -47
239 #define CL_INVALID_KERNEL                           -48
240 #define CL_INVALID_ARG_INDEX                        -49
241 #define CL_INVALID_ARG_VALUE                        -50
242 #define CL_INVALID_ARG_SIZE                         -51
243 #define CL_INVALID_KERNEL_ARGS                      -52
244 #define CL_INVALID_WORK_DIMENSION                   -53
245 #define CL_INVALID_WORK_GROUP_SIZE                  -54
246 #define CL_INVALID_WORK_ITEM_SIZE                   -55
247 #define CL_INVALID_GLOBAL_OFFSET                    -56
248 #define CL_INVALID_EVENT_WAIT_LIST                  -57
249 #define CL_INVALID_EVENT                            -58
250 #define CL_INVALID_OPERATION                        -59
251 #define CL_INVALID_GL_OBJECT                        -60
252 #define CL_INVALID_BUFFER_SIZE                      -61
253 #define CL_INVALID_MIP_LEVEL                        -62
254 #define CL_INVALID_GLOBAL_WORK_SIZE                 -63
255 #ifdef CL_VERSION_1_1
256 #define CL_INVALID_PROPERTY                         -64
257 #endif
258 #ifdef CL_VERSION_1_2
259 #define CL_INVALID_IMAGE_DESCRIPTOR                 -65
260 #define CL_INVALID_COMPILER_OPTIONS                 -66
261 #define CL_INVALID_LINKER_OPTIONS                   -67
262 #define CL_INVALID_DEVICE_PARTITION_COUNT           -68
263 #endif
264 #ifdef CL_VERSION_2_0
265 #define CL_INVALID_PIPE_SIZE                        -69
266 #define CL_INVALID_DEVICE_QUEUE                     -70
267 #endif
268 #ifdef CL_VERSION_2_2
269 #define CL_INVALID_SPEC_ID                          -71
270 #define CL_MAX_SIZE_RESTRICTION_EXCEEDED            -72
271 #endif
272 
273 
274 /* cl_bool */
275 #define CL_FALSE                                    0
276 #define CL_TRUE                                     1
277 #ifdef CL_VERSION_1_2
278 #define CL_BLOCKING                                 CL_TRUE
279 #define CL_NON_BLOCKING                             CL_FALSE
280 #endif
281 
282 /* cl_platform_info */
283 #define CL_PLATFORM_PROFILE                         0x0900
284 #define CL_PLATFORM_VERSION                         0x0901
285 #define CL_PLATFORM_NAME                            0x0902
286 #define CL_PLATFORM_VENDOR                          0x0903
287 #define CL_PLATFORM_EXTENSIONS                      0x0904
288 #ifdef CL_VERSION_2_1
289 #define CL_PLATFORM_HOST_TIMER_RESOLUTION           0x0905
290 #endif
291 #ifdef CL_VERSION_3_0
292 #define CL_PLATFORM_NUMERIC_VERSION                 0x0906
293 #define CL_PLATFORM_EXTENSIONS_WITH_VERSION         0x0907
294 #endif
295 
296 /* cl_device_type - bitfield */
297 #define CL_DEVICE_TYPE_DEFAULT                      (1 << 0)
298 #define CL_DEVICE_TYPE_CPU                          (1 << 1)
299 #define CL_DEVICE_TYPE_GPU                          (1 << 2)
300 #define CL_DEVICE_TYPE_ACCELERATOR                  (1 << 3)
301 #ifdef CL_VERSION_1_2
302 #define CL_DEVICE_TYPE_CUSTOM                       (1 << 4)
303 #endif
304 #define CL_DEVICE_TYPE_ALL                          0xFFFFFFFF
305 
306 /* cl_device_info */
307 #define CL_DEVICE_TYPE                                   0x1000
308 #define CL_DEVICE_VENDOR_ID                              0x1001
309 #define CL_DEVICE_MAX_COMPUTE_UNITS                      0x1002
310 #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS               0x1003
311 #define CL_DEVICE_MAX_WORK_GROUP_SIZE                    0x1004
312 #define CL_DEVICE_MAX_WORK_ITEM_SIZES                    0x1005
313 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR            0x1006
314 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT           0x1007
315 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT             0x1008
316 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG            0x1009
317 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT           0x100A
318 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE          0x100B
319 #define CL_DEVICE_MAX_CLOCK_FREQUENCY                    0x100C
320 #define CL_DEVICE_ADDRESS_BITS                           0x100D
321 #define CL_DEVICE_MAX_READ_IMAGE_ARGS                    0x100E
322 #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS                   0x100F
323 #define CL_DEVICE_MAX_MEM_ALLOC_SIZE                     0x1010
324 #define CL_DEVICE_IMAGE2D_MAX_WIDTH                      0x1011
325 #define CL_DEVICE_IMAGE2D_MAX_HEIGHT                     0x1012
326 #define CL_DEVICE_IMAGE3D_MAX_WIDTH                      0x1013
327 #define CL_DEVICE_IMAGE3D_MAX_HEIGHT                     0x1014
328 #define CL_DEVICE_IMAGE3D_MAX_DEPTH                      0x1015
329 #define CL_DEVICE_IMAGE_SUPPORT                          0x1016
330 #define CL_DEVICE_MAX_PARAMETER_SIZE                     0x1017
331 #define CL_DEVICE_MAX_SAMPLERS                           0x1018
332 #define CL_DEVICE_MEM_BASE_ADDR_ALIGN                    0x1019
333 #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE               0x101A
334 #define CL_DEVICE_SINGLE_FP_CONFIG                       0x101B
335 #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE                  0x101C
336 #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE              0x101D
337 #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE                  0x101E
338 #define CL_DEVICE_GLOBAL_MEM_SIZE                        0x101F
339 #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE               0x1020
340 #define CL_DEVICE_MAX_CONSTANT_ARGS                      0x1021
341 #define CL_DEVICE_LOCAL_MEM_TYPE                         0x1022
342 #define CL_DEVICE_LOCAL_MEM_SIZE                         0x1023
343 #define CL_DEVICE_ERROR_CORRECTION_SUPPORT               0x1024
344 #define CL_DEVICE_PROFILING_TIMER_RESOLUTION             0x1025
345 #define CL_DEVICE_ENDIAN_LITTLE                          0x1026
346 #define CL_DEVICE_AVAILABLE                              0x1027
347 #define CL_DEVICE_COMPILER_AVAILABLE                     0x1028
348 #define CL_DEVICE_EXECUTION_CAPABILITIES                 0x1029
349 #define CL_DEVICE_QUEUE_PROPERTIES                       0x102A    /* deprecated */
350 #ifdef CL_VERSION_2_0
351 #define CL_DEVICE_QUEUE_ON_HOST_PROPERTIES               0x102A
352 #endif
353 #define CL_DEVICE_NAME                                   0x102B
354 #define CL_DEVICE_VENDOR                                 0x102C
355 #define CL_DRIVER_VERSION                                0x102D
356 #define CL_DEVICE_PROFILE                                0x102E
357 #define CL_DEVICE_VERSION                                0x102F
358 #define CL_DEVICE_EXTENSIONS                             0x1030
359 #define CL_DEVICE_PLATFORM                               0x1031
360 #ifdef CL_VERSION_1_2
361 #define CL_DEVICE_DOUBLE_FP_CONFIG                       0x1032
362 #endif
363 /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG which is already defined in "cl_ext.h" */
364 #ifdef CL_VERSION_1_1
365 #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF            0x1034
366 #define CL_DEVICE_HOST_UNIFIED_MEMORY                    0x1035   /* deprecated */
367 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR               0x1036
368 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT              0x1037
369 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT                0x1038
370 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG               0x1039
371 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT              0x103A
372 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE             0x103B
373 #define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF               0x103C
374 #define CL_DEVICE_OPENCL_C_VERSION                       0x103D
375 #endif
376 #ifdef CL_VERSION_1_2
377 #define CL_DEVICE_LINKER_AVAILABLE                       0x103E
378 #define CL_DEVICE_BUILT_IN_KERNELS                       0x103F
379 #define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE                  0x1040
380 #define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE                   0x1041
381 #define CL_DEVICE_PARENT_DEVICE                          0x1042
382 #define CL_DEVICE_PARTITION_MAX_SUB_DEVICES              0x1043
383 #define CL_DEVICE_PARTITION_PROPERTIES                   0x1044
384 #define CL_DEVICE_PARTITION_AFFINITY_DOMAIN              0x1045
385 #define CL_DEVICE_PARTITION_TYPE                         0x1046
386 #define CL_DEVICE_REFERENCE_COUNT                        0x1047
387 #define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC            0x1048
388 #define CL_DEVICE_PRINTF_BUFFER_SIZE                     0x1049
389 #endif
390 #ifdef CL_VERSION_2_0
391 #define CL_DEVICE_IMAGE_PITCH_ALIGNMENT                  0x104A
392 #define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT           0x104B
393 #define CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS              0x104C
394 #define CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE               0x104D
395 #define CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES             0x104E
396 #define CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE         0x104F
397 #define CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE               0x1050
398 #define CL_DEVICE_MAX_ON_DEVICE_QUEUES                   0x1051
399 #define CL_DEVICE_MAX_ON_DEVICE_EVENTS                   0x1052
400 #define CL_DEVICE_SVM_CAPABILITIES                       0x1053
401 #define CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE   0x1054
402 #define CL_DEVICE_MAX_PIPE_ARGS                          0x1055
403 #define CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS           0x1056
404 #define CL_DEVICE_PIPE_MAX_PACKET_SIZE                   0x1057
405 #define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT    0x1058
406 #define CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT      0x1059
407 #define CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT       0x105A
408 #endif
409 #ifdef CL_VERSION_2_1
410 #define CL_DEVICE_IL_VERSION                             0x105B
411 #define CL_DEVICE_MAX_NUM_SUB_GROUPS                     0x105C
412 #define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D
413 #endif
414 #ifdef CL_VERSION_3_0
415 #define CL_DEVICE_NUMERIC_VERSION                        0x105E
416 #define CL_DEVICE_EXTENSIONS_WITH_VERSION                0x1060
417 #define CL_DEVICE_ILS_WITH_VERSION                       0x1061
418 #define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION          0x1062
419 #define CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES             0x1063
420 #define CL_DEVICE_ATOMIC_FENCE_CAPABILITIES              0x1064
421 #define CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT         0x1065
422 #define CL_DEVICE_OPENCL_C_ALL_VERSIONS                  0x1066
423 #define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE     0x1067
424 #define CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT 0x1068
425 #define CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT          0x1069
426 /* 0x106A to 0x106E - Reserved for upcoming KHR extension */
427 #define CL_DEVICE_OPENCL_C_FEATURES                      0x106F
428 #define CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES            0x1070
429 #define CL_DEVICE_PIPE_SUPPORT                           0x1071
430 #define CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED      0x1072
431 #endif
432 
433 /* cl_device_fp_config - bitfield */
434 #define CL_FP_DENORM                                (1 << 0)
435 #define CL_FP_INF_NAN                               (1 << 1)
436 #define CL_FP_ROUND_TO_NEAREST                      (1 << 2)
437 #define CL_FP_ROUND_TO_ZERO                         (1 << 3)
438 #define CL_FP_ROUND_TO_INF                          (1 << 4)
439 #define CL_FP_FMA                                   (1 << 5)
440 #ifdef CL_VERSION_1_1
441 #define CL_FP_SOFT_FLOAT                            (1 << 6)
442 #endif
443 #ifdef CL_VERSION_1_2
444 #define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT         (1 << 7)
445 #endif
446 
447 /* cl_device_mem_cache_type */
448 #define CL_NONE                                     0x0
449 #define CL_READ_ONLY_CACHE                          0x1
450 #define CL_READ_WRITE_CACHE                         0x2
451 
452 /* cl_device_local_mem_type */
453 #define CL_LOCAL                                    0x1
454 #define CL_GLOBAL                                   0x2
455 
456 /* cl_device_exec_capabilities - bitfield */
457 #define CL_EXEC_KERNEL                              (1 << 0)
458 #define CL_EXEC_NATIVE_KERNEL                       (1 << 1)
459 
460 /* cl_command_queue_properties - bitfield */
461 #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE      (1 << 0)
462 #define CL_QUEUE_PROFILING_ENABLE                   (1 << 1)
463 #ifdef CL_VERSION_2_0
464 #define CL_QUEUE_ON_DEVICE                          (1 << 2)
465 #define CL_QUEUE_ON_DEVICE_DEFAULT                  (1 << 3)
466 #endif
467 
468 /* cl_context_info */
469 #define CL_CONTEXT_REFERENCE_COUNT                  0x1080
470 #define CL_CONTEXT_DEVICES                          0x1081
471 #define CL_CONTEXT_PROPERTIES                       0x1082
472 #ifdef CL_VERSION_1_1
473 #define CL_CONTEXT_NUM_DEVICES                      0x1083
474 #endif
475 
476 /* cl_context_properties */
477 #define CL_CONTEXT_PLATFORM                         0x1084
478 #ifdef CL_VERSION_1_2
479 #define CL_CONTEXT_INTEROP_USER_SYNC                0x1085
480 #endif
481 
482 #ifdef CL_VERSION_1_2
483 
484 /* cl_device_partition_property */
485 #define CL_DEVICE_PARTITION_EQUALLY                 0x1086
486 #define CL_DEVICE_PARTITION_BY_COUNTS               0x1087
487 #define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END      0x0
488 #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN      0x1088
489 
490 #endif
491 
492 #ifdef CL_VERSION_1_2
493 
494 /* cl_device_affinity_domain */
495 #define CL_DEVICE_AFFINITY_DOMAIN_NUMA               (1 << 0)
496 #define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE           (1 << 1)
497 #define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE           (1 << 2)
498 #define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE           (1 << 3)
499 #define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE           (1 << 4)
500 #define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
501 
502 #endif
503 
504 #ifdef CL_VERSION_2_0
505 
506 /* cl_device_svm_capabilities */
507 #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER           (1 << 0)
508 #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER             (1 << 1)
509 #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM             (1 << 2)
510 #define CL_DEVICE_SVM_ATOMICS                       (1 << 3)
511 
512 #endif
513 
514 /* cl_command_queue_info */
515 #define CL_QUEUE_CONTEXT                            0x1090
516 #define CL_QUEUE_DEVICE                             0x1091
517 #define CL_QUEUE_REFERENCE_COUNT                    0x1092
518 #define CL_QUEUE_PROPERTIES                         0x1093
519 #ifdef CL_VERSION_2_0
520 #define CL_QUEUE_SIZE                               0x1094
521 #endif
522 #ifdef CL_VERSION_2_1
523 #define CL_QUEUE_DEVICE_DEFAULT                     0x1095
524 #endif
525 #ifdef CL_VERSION_3_0
526 #define CL_QUEUE_PROPERTIES_ARRAY                   0x1098
527 #endif
528 
529 /* cl_mem_flags and cl_svm_mem_flags - bitfield */
530 #define CL_MEM_READ_WRITE                           (1 << 0)
531 #define CL_MEM_WRITE_ONLY                           (1 << 1)
532 #define CL_MEM_READ_ONLY                            (1 << 2)
533 #define CL_MEM_USE_HOST_PTR                         (1 << 3)
534 #define CL_MEM_ALLOC_HOST_PTR                       (1 << 4)
535 #define CL_MEM_COPY_HOST_PTR                        (1 << 5)
536 /* reserved                                         (1 << 6)    */
537 #ifdef CL_VERSION_1_2
538 #define CL_MEM_HOST_WRITE_ONLY                      (1 << 7)
539 #define CL_MEM_HOST_READ_ONLY                       (1 << 8)
540 #define CL_MEM_HOST_NO_ACCESS                       (1 << 9)
541 #endif
542 #ifdef CL_VERSION_2_0
543 #define CL_MEM_SVM_FINE_GRAIN_BUFFER                (1 << 10)   /* used by cl_svm_mem_flags only */
544 #define CL_MEM_SVM_ATOMICS                          (1 << 11)   /* used by cl_svm_mem_flags only */
545 #define CL_MEM_KERNEL_READ_AND_WRITE                (1 << 12)
546 #endif
547 
548 #ifdef CL_VERSION_1_2
549 
550 /* cl_mem_migration_flags - bitfield */
551 #define CL_MIGRATE_MEM_OBJECT_HOST                  (1 << 0)
552 #define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED     (1 << 1)
553 
554 #endif
555 
556 /* cl_channel_order */
557 #define CL_R                                        0x10B0
558 #define CL_A                                        0x10B1
559 #define CL_RG                                       0x10B2
560 #define CL_RA                                       0x10B3
561 #define CL_RGB                                      0x10B4
562 #define CL_RGBA                                     0x10B5
563 #define CL_BGRA                                     0x10B6
564 #define CL_ARGB                                     0x10B7
565 #define CL_INTENSITY                                0x10B8
566 #define CL_LUMINANCE                                0x10B9
567 #ifdef CL_VERSION_1_1
568 #define CL_Rx                                       0x10BA
569 #define CL_RGx                                      0x10BB
570 #define CL_RGBx                                     0x10BC
571 #endif
572 #ifdef CL_VERSION_2_0
573 #define CL_DEPTH                                    0x10BD
574 #define CL_sRGB                                     0x10BF
575 #define CL_sRGBx                                    0x10C0
576 #define CL_sRGBA                                    0x10C1
577 #define CL_sBGRA                                    0x10C2
578 #define CL_ABGR                                     0x10C3
579 #endif
580 
581 /* cl_channel_type */
582 #define CL_SNORM_INT8                               0x10D0
583 #define CL_SNORM_INT16                              0x10D1
584 #define CL_UNORM_INT8                               0x10D2
585 #define CL_UNORM_INT16                              0x10D3
586 #define CL_UNORM_SHORT_565                          0x10D4
587 #define CL_UNORM_SHORT_555                          0x10D5
588 #define CL_UNORM_INT_101010                         0x10D6
589 #define CL_SIGNED_INT8                              0x10D7
590 #define CL_SIGNED_INT16                             0x10D8
591 #define CL_SIGNED_INT32                             0x10D9
592 #define CL_UNSIGNED_INT8                            0x10DA
593 #define CL_UNSIGNED_INT16                           0x10DB
594 #define CL_UNSIGNED_INT32                           0x10DC
595 #define CL_HALF_FLOAT                               0x10DD
596 #define CL_FLOAT                                    0x10DE
597 #ifdef CL_VERSION_2_1
598 #define CL_UNORM_INT_101010_2                       0x10E0
599 #endif
600 
601 /* cl_mem_object_type */
602 #define CL_MEM_OBJECT_BUFFER                        0x10F0
603 #define CL_MEM_OBJECT_IMAGE2D                       0x10F1
604 #define CL_MEM_OBJECT_IMAGE3D                       0x10F2
605 #ifdef CL_VERSION_1_2
606 #define CL_MEM_OBJECT_IMAGE2D_ARRAY                 0x10F3
607 #define CL_MEM_OBJECT_IMAGE1D                       0x10F4
608 #define CL_MEM_OBJECT_IMAGE1D_ARRAY                 0x10F5
609 #define CL_MEM_OBJECT_IMAGE1D_BUFFER                0x10F6
610 #endif
611 #ifdef CL_VERSION_2_0
612 #define CL_MEM_OBJECT_PIPE                          0x10F7
613 #endif
614 
615 /* cl_mem_info */
616 #define CL_MEM_TYPE                                 0x1100
617 #define CL_MEM_FLAGS                                0x1101
618 #define CL_MEM_SIZE                                 0x1102
619 #define CL_MEM_HOST_PTR                             0x1103
620 #define CL_MEM_MAP_COUNT                            0x1104
621 #define CL_MEM_REFERENCE_COUNT                      0x1105
622 #define CL_MEM_CONTEXT                              0x1106
623 #ifdef CL_VERSION_1_1
624 #define CL_MEM_ASSOCIATED_MEMOBJECT                 0x1107
625 #define CL_MEM_OFFSET                               0x1108
626 #endif
627 #ifdef CL_VERSION_2_0
628 #define CL_MEM_USES_SVM_POINTER                     0x1109
629 #endif
630 #ifdef CL_VERSION_3_0
631 #define CL_MEM_PROPERTIES                           0x110A
632 #endif
633 
634 /* cl_image_info */
635 #define CL_IMAGE_FORMAT                             0x1110
636 #define CL_IMAGE_ELEMENT_SIZE                       0x1111
637 #define CL_IMAGE_ROW_PITCH                          0x1112
638 #define CL_IMAGE_SLICE_PITCH                        0x1113
639 #define CL_IMAGE_WIDTH                              0x1114
640 #define CL_IMAGE_HEIGHT                             0x1115
641 #define CL_IMAGE_DEPTH                              0x1116
642 #ifdef CL_VERSION_1_2
643 #define CL_IMAGE_ARRAY_SIZE                         0x1117
644 #define CL_IMAGE_BUFFER                             0x1118
645 #define CL_IMAGE_NUM_MIP_LEVELS                     0x1119
646 #define CL_IMAGE_NUM_SAMPLES                        0x111A
647 #endif
648 
649 
650 /* cl_pipe_info */
651 #ifdef CL_VERSION_2_0
652 #define CL_PIPE_PACKET_SIZE                         0x1120
653 #define CL_PIPE_MAX_PACKETS                         0x1121
654 #endif
655 #ifdef CL_VERSION_3_0
656 #define CL_PIPE_PROPERTIES                          0x1122
657 #endif
658 
659 /* cl_addressing_mode */
660 #define CL_ADDRESS_NONE                             0x1130
661 #define CL_ADDRESS_CLAMP_TO_EDGE                    0x1131
662 #define CL_ADDRESS_CLAMP                            0x1132
663 #define CL_ADDRESS_REPEAT                           0x1133
664 #ifdef CL_VERSION_1_1
665 #define CL_ADDRESS_MIRRORED_REPEAT                  0x1134
666 #endif
667 
668 /* cl_filter_mode */
669 #define CL_FILTER_NEAREST                           0x1140
670 #define CL_FILTER_LINEAR                            0x1141
671 
672 /* cl_sampler_info */
673 #define CL_SAMPLER_REFERENCE_COUNT                  0x1150
674 #define CL_SAMPLER_CONTEXT                          0x1151
675 #define CL_SAMPLER_NORMALIZED_COORDS                0x1152
676 #define CL_SAMPLER_ADDRESSING_MODE                  0x1153
677 #define CL_SAMPLER_FILTER_MODE                      0x1154
678 #ifdef CL_VERSION_2_0
679 /* These enumerants are for the cl_khr_mipmap_image extension.
680    They have since been added to cl_ext.h with an appropriate
681    KHR suffix, but are left here for backwards compatibility. */
682 #define CL_SAMPLER_MIP_FILTER_MODE                  0x1155
683 #define CL_SAMPLER_LOD_MIN                          0x1156
684 #define CL_SAMPLER_LOD_MAX                          0x1157
685 #endif
686 #ifdef CL_VERSION_3_0
687 #define CL_SAMPLER_PROPERTIES                       0x1158
688 #endif
689 
690 /* cl_map_flags - bitfield */
691 #define CL_MAP_READ                                 (1 << 0)
692 #define CL_MAP_WRITE                                (1 << 1)
693 #ifdef CL_VERSION_1_2
694 #define CL_MAP_WRITE_INVALIDATE_REGION              (1 << 2)
695 #endif
696 
697 /* cl_program_info */
698 #define CL_PROGRAM_REFERENCE_COUNT                  0x1160
699 #define CL_PROGRAM_CONTEXT                          0x1161
700 #define CL_PROGRAM_NUM_DEVICES                      0x1162
701 #define CL_PROGRAM_DEVICES                          0x1163
702 #define CL_PROGRAM_SOURCE                           0x1164
703 #define CL_PROGRAM_BINARY_SIZES                     0x1165
704 #define CL_PROGRAM_BINARIES                         0x1166
705 #ifdef CL_VERSION_1_2
706 #define CL_PROGRAM_NUM_KERNELS                      0x1167
707 #define CL_PROGRAM_KERNEL_NAMES                     0x1168
708 #endif
709 #ifdef CL_VERSION_2_1
710 #define CL_PROGRAM_IL                               0x1169
711 #endif
712 #ifdef CL_VERSION_2_2
713 #define CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT       0x116A
714 #define CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT       0x116B
715 #endif
716 
717 /* cl_program_build_info */
718 #define CL_PROGRAM_BUILD_STATUS                     0x1181
719 #define CL_PROGRAM_BUILD_OPTIONS                    0x1182
720 #define CL_PROGRAM_BUILD_LOG                        0x1183
721 #ifdef CL_VERSION_1_2
722 #define CL_PROGRAM_BINARY_TYPE                      0x1184
723 #endif
724 #ifdef CL_VERSION_2_0
725 #define CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE 0x1185
726 #endif
727 
728 #ifdef CL_VERSION_1_2
729 
730 /* cl_program_binary_type */
731 #define CL_PROGRAM_BINARY_TYPE_NONE                 0x0
732 #define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT      0x1
733 #define CL_PROGRAM_BINARY_TYPE_LIBRARY              0x2
734 #define CL_PROGRAM_BINARY_TYPE_EXECUTABLE           0x4
735 
736 #endif
737 
738 /* cl_build_status */
739 #define CL_BUILD_SUCCESS                            0
740 #define CL_BUILD_NONE                               -1
741 #define CL_BUILD_ERROR                              -2
742 #define CL_BUILD_IN_PROGRESS                        -3
743 
744 /* cl_kernel_info */
745 #define CL_KERNEL_FUNCTION_NAME                     0x1190
746 #define CL_KERNEL_NUM_ARGS                          0x1191
747 #define CL_KERNEL_REFERENCE_COUNT                   0x1192
748 #define CL_KERNEL_CONTEXT                           0x1193
749 #define CL_KERNEL_PROGRAM                           0x1194
750 #ifdef CL_VERSION_1_2
751 #define CL_KERNEL_ATTRIBUTES                        0x1195
752 #endif
753 
754 #ifdef CL_VERSION_1_2
755 
756 /* cl_kernel_arg_info */
757 #define CL_KERNEL_ARG_ADDRESS_QUALIFIER             0x1196
758 #define CL_KERNEL_ARG_ACCESS_QUALIFIER              0x1197
759 #define CL_KERNEL_ARG_TYPE_NAME                     0x1198
760 #define CL_KERNEL_ARG_TYPE_QUALIFIER                0x1199
761 #define CL_KERNEL_ARG_NAME                          0x119A
762 
763 #endif
764 
765 #ifdef CL_VERSION_1_2
766 
767 /* cl_kernel_arg_address_qualifier */
768 #define CL_KERNEL_ARG_ADDRESS_GLOBAL                0x119B
769 #define CL_KERNEL_ARG_ADDRESS_LOCAL                 0x119C
770 #define CL_KERNEL_ARG_ADDRESS_CONSTANT              0x119D
771 #define CL_KERNEL_ARG_ADDRESS_PRIVATE               0x119E
772 
773 #endif
774 
775 #ifdef CL_VERSION_1_2
776 
777 /* cl_kernel_arg_access_qualifier */
778 #define CL_KERNEL_ARG_ACCESS_READ_ONLY              0x11A0
779 #define CL_KERNEL_ARG_ACCESS_WRITE_ONLY             0x11A1
780 #define CL_KERNEL_ARG_ACCESS_READ_WRITE             0x11A2
781 #define CL_KERNEL_ARG_ACCESS_NONE                   0x11A3
782 
783 #endif
784 
785 #ifdef CL_VERSION_1_2
786 
787 /* cl_kernel_arg_type_qualifier */
788 #define CL_KERNEL_ARG_TYPE_NONE                     0
789 #define CL_KERNEL_ARG_TYPE_CONST                    (1 << 0)
790 #define CL_KERNEL_ARG_TYPE_RESTRICT                 (1 << 1)
791 #define CL_KERNEL_ARG_TYPE_VOLATILE                 (1 << 2)
792 #ifdef CL_VERSION_2_0
793 #define CL_KERNEL_ARG_TYPE_PIPE                     (1 << 3)
794 #endif
795 
796 #endif
797 
798 /* cl_kernel_work_group_info */
799 #define CL_KERNEL_WORK_GROUP_SIZE                   0x11B0
800 #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE           0x11B1
801 #define CL_KERNEL_LOCAL_MEM_SIZE                    0x11B2
802 #define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
803 #define CL_KERNEL_PRIVATE_MEM_SIZE                  0x11B4
804 #ifdef CL_VERSION_1_2
805 #define CL_KERNEL_GLOBAL_WORK_SIZE                  0x11B5
806 #endif
807 
808 #ifdef CL_VERSION_2_1
809 
810 /* cl_kernel_sub_group_info */
811 #define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE    0x2033
812 #define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE       0x2034
813 #define CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT    0x11B8
814 #define CL_KERNEL_MAX_NUM_SUB_GROUPS                0x11B9
815 #define CL_KERNEL_COMPILE_NUM_SUB_GROUPS            0x11BA
816 
817 #endif
818 
819 #ifdef CL_VERSION_2_0
820 
821 /* cl_kernel_exec_info */
822 #define CL_KERNEL_EXEC_INFO_SVM_PTRS                0x11B6
823 #define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM   0x11B7
824 
825 #endif
826 
827 /* cl_event_info */
828 #define CL_EVENT_COMMAND_QUEUE                      0x11D0
829 #define CL_EVENT_COMMAND_TYPE                       0x11D1
830 #define CL_EVENT_REFERENCE_COUNT                    0x11D2
831 #define CL_EVENT_COMMAND_EXECUTION_STATUS           0x11D3
832 #ifdef CL_VERSION_1_1
833 #define CL_EVENT_CONTEXT                            0x11D4
834 #endif
835 
836 /* cl_command_type */
837 #define CL_COMMAND_NDRANGE_KERNEL                   0x11F0
838 #define CL_COMMAND_TASK                             0x11F1
839 #define CL_COMMAND_NATIVE_KERNEL                    0x11F2
840 #define CL_COMMAND_READ_BUFFER                      0x11F3
841 #define CL_COMMAND_WRITE_BUFFER                     0x11F4
842 #define CL_COMMAND_COPY_BUFFER                      0x11F5
843 #define CL_COMMAND_READ_IMAGE                       0x11F6
844 #define CL_COMMAND_WRITE_IMAGE                      0x11F7
845 #define CL_COMMAND_COPY_IMAGE                       0x11F8
846 #define CL_COMMAND_COPY_IMAGE_TO_BUFFER             0x11F9
847 #define CL_COMMAND_COPY_BUFFER_TO_IMAGE             0x11FA
848 #define CL_COMMAND_MAP_BUFFER                       0x11FB
849 #define CL_COMMAND_MAP_IMAGE                        0x11FC
850 #define CL_COMMAND_UNMAP_MEM_OBJECT                 0x11FD
851 #define CL_COMMAND_MARKER                           0x11FE
852 #define CL_COMMAND_ACQUIRE_GL_OBJECTS               0x11FF
853 #define CL_COMMAND_RELEASE_GL_OBJECTS               0x1200
854 #ifdef CL_VERSION_1_1
855 #define CL_COMMAND_READ_BUFFER_RECT                 0x1201
856 #define CL_COMMAND_WRITE_BUFFER_RECT                0x1202
857 #define CL_COMMAND_COPY_BUFFER_RECT                 0x1203
858 #define CL_COMMAND_USER                             0x1204
859 #endif
860 #ifdef CL_VERSION_1_2
861 #define CL_COMMAND_BARRIER                          0x1205
862 #define CL_COMMAND_MIGRATE_MEM_OBJECTS              0x1206
863 #define CL_COMMAND_FILL_BUFFER                      0x1207
864 #define CL_COMMAND_FILL_IMAGE                       0x1208
865 #endif
866 #ifdef CL_VERSION_2_0
867 #define CL_COMMAND_SVM_FREE                         0x1209
868 #define CL_COMMAND_SVM_MEMCPY                       0x120A
869 #define CL_COMMAND_SVM_MEMFILL                      0x120B
870 #define CL_COMMAND_SVM_MAP                          0x120C
871 #define CL_COMMAND_SVM_UNMAP                        0x120D
872 #endif
873 #ifdef CL_VERSION_3_0
874 #define CL_COMMAND_SVM_MIGRATE_MEM                  0x120E
875 #endif
876 
877 /* command execution status */
878 #define CL_COMPLETE                                 0x0
879 #define CL_RUNNING                                  0x1
880 #define CL_SUBMITTED                                0x2
881 #define CL_QUEUED                                   0x3
882 
883 /* cl_buffer_create_type */
884 #ifdef CL_VERSION_1_1
885 #define CL_BUFFER_CREATE_TYPE_REGION                0x1220
886 #endif
887 
888 /* cl_profiling_info */
889 #define CL_PROFILING_COMMAND_QUEUED                 0x1280
890 #define CL_PROFILING_COMMAND_SUBMIT                 0x1281
891 #define CL_PROFILING_COMMAND_START                  0x1282
892 #define CL_PROFILING_COMMAND_END                    0x1283
893 #ifdef CL_VERSION_2_0
894 #define CL_PROFILING_COMMAND_COMPLETE               0x1284
895 #endif
896 
897 /* cl_device_atomic_capabilities - bitfield */
898 #ifdef CL_VERSION_3_0
899 #define CL_DEVICE_ATOMIC_ORDER_RELAXED          (1 << 0)
900 #define CL_DEVICE_ATOMIC_ORDER_ACQ_REL          (1 << 1)
901 #define CL_DEVICE_ATOMIC_ORDER_SEQ_CST          (1 << 2)
902 #define CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM        (1 << 3)
903 #define CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP       (1 << 4)
904 #define CL_DEVICE_ATOMIC_SCOPE_DEVICE           (1 << 5)
905 #define CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES      (1 << 6)
906 #endif
907 
908 /* cl_device_device_enqueue_capabilities - bitfield */
909 #ifdef CL_VERSION_3_0
910 #define CL_DEVICE_QUEUE_SUPPORTED               (1 << 0)
911 #define CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT     (1 << 1)
912 #endif
913 
914 /* cl_khronos_vendor_id */
915 #define CL_KHRONOS_VENDOR_ID_CODEPLAY               0x10004
916 
917 #ifdef CL_VERSION_3_0
918 
919 /* cl_version */
920 #define CL_VERSION_MAJOR_BITS (10)
921 #define CL_VERSION_MINOR_BITS (10)
922 #define CL_VERSION_PATCH_BITS (12)
923 
924 #define CL_VERSION_MAJOR_MASK ((1 << CL_VERSION_MAJOR_BITS) - 1)
925 #define CL_VERSION_MINOR_MASK ((1 << CL_VERSION_MINOR_BITS) - 1)
926 #define CL_VERSION_PATCH_MASK ((1 << CL_VERSION_PATCH_BITS) - 1)
927 
928 #define CL_VERSION_MAJOR(version) \
929   ((version) >> (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS))
930 
931 #define CL_VERSION_MINOR(version) \
932   (((version) >> CL_VERSION_PATCH_BITS) & CL_VERSION_MINOR_MASK)
933 
934 #define CL_VERSION_PATCH(version) ((version) & CL_VERSION_PATCH_MASK)
935 
936 #define CL_MAKE_VERSION(major, minor, patch)                      \
937   ((((major) & CL_VERSION_MAJOR_MASK)                             \
938        << (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) |      \
939    (((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \
940    ((patch) & CL_VERSION_PATCH_MASK))
941 
942 #endif
943 
944 /********************************************************************************************************/
945 
946 /* CL_NO_PROTOTYPES implies CL_NO_CORE_PROTOTYPES: */
947 #if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_CORE_PROTOTYPES)
948 #define CL_NO_CORE_PROTOTYPES
949 #endif
950 
951 #if !defined(CL_NO_CORE_PROTOTYPES)
952 
953 /* Platform API */
954 extern CL_API_ENTRY cl_int CL_API_CALL
955 clGetPlatformIDs(cl_uint          num_entries,
956                  cl_platform_id * platforms,
957                  cl_uint *        num_platforms) CL_API_SUFFIX__VERSION_1_0;
958 
959 extern CL_API_ENTRY cl_int CL_API_CALL
960 clGetPlatformInfo(cl_platform_id   platform,
961                   cl_platform_info param_name,
962                   size_t           param_value_size,
963                   void *           param_value,
964                   size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
965 
966 /* Device APIs */
967 extern CL_API_ENTRY cl_int CL_API_CALL
968 clGetDeviceIDs(cl_platform_id   platform,
969                cl_device_type   device_type,
970                cl_uint          num_entries,
971                cl_device_id *   devices,
972                cl_uint *        num_devices) CL_API_SUFFIX__VERSION_1_0;
973 
974 extern CL_API_ENTRY cl_int CL_API_CALL
975 clGetDeviceInfo(cl_device_id    device,
976                 cl_device_info  param_name,
977                 size_t          param_value_size,
978                 void *          param_value,
979                 size_t *        param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
980 
981 #ifdef CL_VERSION_1_2
982 
983 extern CL_API_ENTRY cl_int CL_API_CALL
984 clCreateSubDevices(cl_device_id                         in_device,
985                    const cl_device_partition_property * properties,
986                    cl_uint                              num_devices,
987                    cl_device_id *                       out_devices,
988                    cl_uint *                            num_devices_ret) CL_API_SUFFIX__VERSION_1_2;
989 
990 extern CL_API_ENTRY cl_int CL_API_CALL
991 clRetainDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2;
992 
993 extern CL_API_ENTRY cl_int CL_API_CALL
994 clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2;
995 
996 #endif
997 
998 #ifdef CL_VERSION_2_1
999 
1000 extern CL_API_ENTRY cl_int CL_API_CALL
1001 clSetDefaultDeviceCommandQueue(cl_context           context,
1002                                cl_device_id         device,
1003                                cl_command_queue     command_queue) CL_API_SUFFIX__VERSION_2_1;
1004 
1005 extern CL_API_ENTRY cl_int CL_API_CALL
1006 clGetDeviceAndHostTimer(cl_device_id    device,
1007                         cl_ulong*       device_timestamp,
1008                         cl_ulong*       host_timestamp) CL_API_SUFFIX__VERSION_2_1;
1009 
1010 extern CL_API_ENTRY cl_int CL_API_CALL
1011 clGetHostTimer(cl_device_id device,
1012                cl_ulong *   host_timestamp) CL_API_SUFFIX__VERSION_2_1;
1013 
1014 #endif
1015 
1016 /* Context APIs */
1017 extern CL_API_ENTRY cl_context CL_API_CALL
1018 clCreateContext(const cl_context_properties * properties,
1019                 cl_uint              num_devices,
1020                 const cl_device_id * devices,
1021                 void (CL_CALLBACK * pfn_notify)(const char * errinfo,
1022                                                 const void * private_info,
1023                                                 size_t       cb,
1024                                                 void *       user_data),
1025                 void *               user_data,
1026                 cl_int *             errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1027 
1028 extern CL_API_ENTRY cl_context CL_API_CALL
1029 clCreateContextFromType(const cl_context_properties * properties,
1030                         cl_device_type      device_type,
1031                         void (CL_CALLBACK * pfn_notify)(const char * errinfo,
1032                                                         const void * private_info,
1033                                                         size_t       cb,
1034                                                         void *       user_data),
1035                         void *              user_data,
1036                         cl_int *            errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1037 
1038 extern CL_API_ENTRY cl_int CL_API_CALL
1039 clRetainContext(cl_context context) CL_API_SUFFIX__VERSION_1_0;
1040 
1041 extern CL_API_ENTRY cl_int CL_API_CALL
1042 clReleaseContext(cl_context context) CL_API_SUFFIX__VERSION_1_0;
1043 
1044 extern CL_API_ENTRY cl_int CL_API_CALL
1045 clGetContextInfo(cl_context         context,
1046                  cl_context_info    param_name,
1047                  size_t             param_value_size,
1048                  void *             param_value,
1049                  size_t *           param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1050 
1051 #ifdef CL_VERSION_3_0
1052 
1053 extern CL_API_ENTRY cl_int CL_API_CALL
1054 clSetContextDestructorCallback(cl_context         context,
1055                                void (CL_CALLBACK* pfn_notify)(cl_context context,
1056                                                               void* user_data),
1057                                void*              user_data) CL_API_SUFFIX__VERSION_3_0;
1058 
1059 #endif
1060 
1061 /* Command Queue APIs */
1062 
1063 #ifdef CL_VERSION_2_0
1064 
1065 extern CL_API_ENTRY cl_command_queue CL_API_CALL
1066 clCreateCommandQueueWithProperties(cl_context               context,
1067                                    cl_device_id             device,
1068                                    const cl_queue_properties *    properties,
1069                                    cl_int *                 errcode_ret) CL_API_SUFFIX__VERSION_2_0;
1070 
1071 #endif
1072 
1073 extern CL_API_ENTRY cl_int CL_API_CALL
1074 clRetainCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
1075 
1076 extern CL_API_ENTRY cl_int CL_API_CALL
1077 clReleaseCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
1078 
1079 extern CL_API_ENTRY cl_int CL_API_CALL
1080 clGetCommandQueueInfo(cl_command_queue      command_queue,
1081                       cl_command_queue_info param_name,
1082                       size_t                param_value_size,
1083                       void *                param_value,
1084                       size_t *              param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1085 
1086 /* Memory Object APIs */
1087 extern CL_API_ENTRY cl_mem CL_API_CALL
1088 clCreateBuffer(cl_context   context,
1089                cl_mem_flags flags,
1090                size_t       size,
1091                void *       host_ptr,
1092                cl_int *     errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1093 
1094 #ifdef CL_VERSION_1_1
1095 
1096 extern CL_API_ENTRY cl_mem CL_API_CALL
1097 clCreateSubBuffer(cl_mem                   buffer,
1098                   cl_mem_flags             flags,
1099                   cl_buffer_create_type    buffer_create_type,
1100                   const void *             buffer_create_info,
1101                   cl_int *                 errcode_ret) CL_API_SUFFIX__VERSION_1_1;
1102 
1103 #endif
1104 
1105 #ifdef CL_VERSION_1_2
1106 
1107 extern CL_API_ENTRY cl_mem CL_API_CALL
1108 clCreateImage(cl_context              context,
1109               cl_mem_flags            flags,
1110               const cl_image_format * image_format,
1111               const cl_image_desc *   image_desc,
1112               void *                  host_ptr,
1113               cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_2;
1114 
1115 #endif
1116 
1117 #ifdef CL_VERSION_2_0
1118 
1119 extern CL_API_ENTRY cl_mem CL_API_CALL
1120 clCreatePipe(cl_context                 context,
1121              cl_mem_flags               flags,
1122              cl_uint                    pipe_packet_size,
1123              cl_uint                    pipe_max_packets,
1124              const cl_pipe_properties * properties,
1125              cl_int *                   errcode_ret) CL_API_SUFFIX__VERSION_2_0;
1126 
1127 #endif
1128 
1129 #ifdef CL_VERSION_3_0
1130 
1131 extern CL_API_ENTRY cl_mem CL_API_CALL
1132 clCreateBufferWithProperties(cl_context                context,
1133                              const cl_mem_properties * properties,
1134                              cl_mem_flags              flags,
1135                              size_t                    size,
1136                              void *                    host_ptr,
1137                              cl_int *                  errcode_ret) CL_API_SUFFIX__VERSION_3_0;
1138 
1139 extern CL_API_ENTRY cl_mem CL_API_CALL
1140 clCreateImageWithProperties(cl_context                context,
1141                             const cl_mem_properties * properties,
1142                             cl_mem_flags              flags,
1143                             const cl_image_format *   image_format,
1144                             const cl_image_desc *     image_desc,
1145                             void *                    host_ptr,
1146                             cl_int *                  errcode_ret) CL_API_SUFFIX__VERSION_3_0;
1147 
1148 #endif
1149 
1150 extern CL_API_ENTRY cl_int CL_API_CALL
1151 clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
1152 
1153 extern CL_API_ENTRY cl_int CL_API_CALL
1154 clReleaseMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
1155 
1156 extern CL_API_ENTRY cl_int CL_API_CALL
1157 clGetSupportedImageFormats(cl_context           context,
1158                            cl_mem_flags         flags,
1159                            cl_mem_object_type   image_type,
1160                            cl_uint              num_entries,
1161                            cl_image_format *    image_formats,
1162                            cl_uint *            num_image_formats) CL_API_SUFFIX__VERSION_1_0;
1163 
1164 extern CL_API_ENTRY cl_int CL_API_CALL
1165 clGetMemObjectInfo(cl_mem           memobj,
1166                    cl_mem_info      param_name,
1167                    size_t           param_value_size,
1168                    void *           param_value,
1169                    size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1170 
1171 extern CL_API_ENTRY cl_int CL_API_CALL
1172 clGetImageInfo(cl_mem           image,
1173                cl_image_info    param_name,
1174                size_t           param_value_size,
1175                void *           param_value,
1176                size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1177 
1178 #ifdef CL_VERSION_2_0
1179 
1180 extern CL_API_ENTRY cl_int CL_API_CALL
1181 clGetPipeInfo(cl_mem           pipe,
1182               cl_pipe_info     param_name,
1183               size_t           param_value_size,
1184               void *           param_value,
1185               size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_2_0;
1186 
1187 #endif
1188 
1189 #ifdef CL_VERSION_1_1
1190 
1191 extern CL_API_ENTRY cl_int CL_API_CALL
1192 clSetMemObjectDestructorCallback(cl_mem memobj,
1193                                  void (CL_CALLBACK * pfn_notify)(cl_mem memobj,
1194                                                                  void * user_data),
1195                                  void * user_data) CL_API_SUFFIX__VERSION_1_1;
1196 
1197 #endif
1198 
1199 /* SVM Allocation APIs */
1200 
1201 #ifdef CL_VERSION_2_0
1202 
1203 extern CL_API_ENTRY void * CL_API_CALL
1204 clSVMAlloc(cl_context       context,
1205            cl_svm_mem_flags flags,
1206            size_t           size,
1207            cl_uint          alignment) CL_API_SUFFIX__VERSION_2_0;
1208 
1209 extern CL_API_ENTRY void CL_API_CALL
1210 clSVMFree(cl_context        context,
1211           void *            svm_pointer) CL_API_SUFFIX__VERSION_2_0;
1212 
1213 #endif
1214 
1215 /* Sampler APIs */
1216 
1217 #ifdef CL_VERSION_2_0
1218 
1219 extern CL_API_ENTRY cl_sampler CL_API_CALL
1220 clCreateSamplerWithProperties(cl_context                     context,
1221                               const cl_sampler_properties *  sampler_properties,
1222                               cl_int *                       errcode_ret) CL_API_SUFFIX__VERSION_2_0;
1223 
1224 #endif
1225 
1226 extern CL_API_ENTRY cl_int CL_API_CALL
1227 clRetainSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
1228 
1229 extern CL_API_ENTRY cl_int CL_API_CALL
1230 clReleaseSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
1231 
1232 extern CL_API_ENTRY cl_int CL_API_CALL
1233 clGetSamplerInfo(cl_sampler         sampler,
1234                  cl_sampler_info    param_name,
1235                  size_t             param_value_size,
1236                  void *             param_value,
1237                  size_t *           param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1238 
1239 /* Program Object APIs */
1240 extern CL_API_ENTRY cl_program CL_API_CALL
1241 clCreateProgramWithSource(cl_context        context,
1242                           cl_uint           count,
1243                           const char **     strings,
1244                           const size_t *    lengths,
1245                           cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1246 
1247 extern CL_API_ENTRY cl_program CL_API_CALL
1248 clCreateProgramWithBinary(cl_context                     context,
1249                           cl_uint                        num_devices,
1250                           const cl_device_id *           device_list,
1251                           const size_t *                 lengths,
1252                           const unsigned char **         binaries,
1253                           cl_int *                       binary_status,
1254                           cl_int *                       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1255 
1256 #ifdef CL_VERSION_1_2
1257 
1258 extern CL_API_ENTRY cl_program CL_API_CALL
1259 clCreateProgramWithBuiltInKernels(cl_context            context,
1260                                   cl_uint               num_devices,
1261                                   const cl_device_id *  device_list,
1262                                   const char *          kernel_names,
1263                                   cl_int *              errcode_ret) CL_API_SUFFIX__VERSION_1_2;
1264 
1265 #endif
1266 
1267 #ifdef CL_VERSION_2_1
1268 
1269 extern CL_API_ENTRY cl_program CL_API_CALL
1270 clCreateProgramWithIL(cl_context    context,
1271                      const void*    il,
1272                      size_t         length,
1273                      cl_int*        errcode_ret) CL_API_SUFFIX__VERSION_2_1;
1274 
1275 #endif
1276 
1277 extern CL_API_ENTRY cl_int CL_API_CALL
1278 clRetainProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0;
1279 
1280 extern CL_API_ENTRY cl_int CL_API_CALL
1281 clReleaseProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0;
1282 
1283 extern CL_API_ENTRY cl_int CL_API_CALL
1284 clBuildProgram(cl_program           program,
1285                cl_uint              num_devices,
1286                const cl_device_id * device_list,
1287                const char *         options,
1288                void (CL_CALLBACK *  pfn_notify)(cl_program program,
1289                                                 void * user_data),
1290                void *               user_data) CL_API_SUFFIX__VERSION_1_0;
1291 
1292 #ifdef CL_VERSION_1_2
1293 
1294 extern CL_API_ENTRY cl_int CL_API_CALL
1295 clCompileProgram(cl_program           program,
1296                  cl_uint              num_devices,
1297                  const cl_device_id * device_list,
1298                  const char *         options,
1299                  cl_uint              num_input_headers,
1300                  const cl_program *   input_headers,
1301                  const char **        header_include_names,
1302                  void (CL_CALLBACK *  pfn_notify)(cl_program program,
1303                                                   void * user_data),
1304                  void *               user_data) CL_API_SUFFIX__VERSION_1_2;
1305 
1306 extern CL_API_ENTRY cl_program CL_API_CALL
1307 clLinkProgram(cl_context           context,
1308               cl_uint              num_devices,
1309               const cl_device_id * device_list,
1310               const char *         options,
1311               cl_uint              num_input_programs,
1312               const cl_program *   input_programs,
1313               void (CL_CALLBACK *  pfn_notify)(cl_program program,
1314                                                void * user_data),
1315               void *               user_data,
1316               cl_int *             errcode_ret) CL_API_SUFFIX__VERSION_1_2;
1317 
1318 #endif
1319 
1320 #ifdef CL_VERSION_2_2
1321 
1322 extern CL_API_ENTRY CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
1323 clSetProgramReleaseCallback(cl_program          program,
1324                             void (CL_CALLBACK * pfn_notify)(cl_program program,
1325                                                             void * user_data),
1326                             void *              user_data) CL_API_SUFFIX__VERSION_2_2_DEPRECATED;
1327 
1328 extern CL_API_ENTRY cl_int CL_API_CALL
1329 clSetProgramSpecializationConstant(cl_program  program,
1330                                    cl_uint     spec_id,
1331                                    size_t      spec_size,
1332                                    const void* spec_value) CL_API_SUFFIX__VERSION_2_2;
1333 
1334 #endif
1335 
1336 #ifdef CL_VERSION_1_2
1337 
1338 extern CL_API_ENTRY cl_int CL_API_CALL
1339 clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2;
1340 
1341 #endif
1342 
1343 extern CL_API_ENTRY cl_int CL_API_CALL
1344 clGetProgramInfo(cl_program         program,
1345                  cl_program_info    param_name,
1346                  size_t             param_value_size,
1347                  void *             param_value,
1348                  size_t *           param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1349 
1350 extern CL_API_ENTRY cl_int CL_API_CALL
1351 clGetProgramBuildInfo(cl_program            program,
1352                       cl_device_id          device,
1353                       cl_program_build_info param_name,
1354                       size_t                param_value_size,
1355                       void *                param_value,
1356                       size_t *              param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1357 
1358 /* Kernel Object APIs */
1359 extern CL_API_ENTRY cl_kernel CL_API_CALL
1360 clCreateKernel(cl_program      program,
1361                const char *    kernel_name,
1362                cl_int *        errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1363 
1364 extern CL_API_ENTRY cl_int CL_API_CALL
1365 clCreateKernelsInProgram(cl_program     program,
1366                          cl_uint        num_kernels,
1367                          cl_kernel *    kernels,
1368                          cl_uint *      num_kernels_ret) CL_API_SUFFIX__VERSION_1_0;
1369 
1370 #ifdef CL_VERSION_2_1
1371 
1372 extern CL_API_ENTRY cl_kernel CL_API_CALL
1373 clCloneKernel(cl_kernel     source_kernel,
1374               cl_int*       errcode_ret) CL_API_SUFFIX__VERSION_2_1;
1375 
1376 #endif
1377 
1378 extern CL_API_ENTRY cl_int CL_API_CALL
1379 clRetainKernel(cl_kernel    kernel) CL_API_SUFFIX__VERSION_1_0;
1380 
1381 extern CL_API_ENTRY cl_int CL_API_CALL
1382 clReleaseKernel(cl_kernel   kernel) CL_API_SUFFIX__VERSION_1_0;
1383 
1384 extern CL_API_ENTRY cl_int CL_API_CALL
1385 clSetKernelArg(cl_kernel    kernel,
1386                cl_uint      arg_index,
1387                size_t       arg_size,
1388                const void * arg_value) CL_API_SUFFIX__VERSION_1_0;
1389 
1390 #ifdef CL_VERSION_2_0
1391 
1392 extern CL_API_ENTRY cl_int CL_API_CALL
1393 clSetKernelArgSVMPointer(cl_kernel    kernel,
1394                          cl_uint      arg_index,
1395                          const void * arg_value) CL_API_SUFFIX__VERSION_2_0;
1396 
1397 extern CL_API_ENTRY cl_int CL_API_CALL
1398 clSetKernelExecInfo(cl_kernel            kernel,
1399                     cl_kernel_exec_info  param_name,
1400                     size_t               param_value_size,
1401                     const void *         param_value) CL_API_SUFFIX__VERSION_2_0;
1402 
1403 #endif
1404 
1405 extern CL_API_ENTRY cl_int CL_API_CALL
1406 clGetKernelInfo(cl_kernel       kernel,
1407                 cl_kernel_info  param_name,
1408                 size_t          param_value_size,
1409                 void *          param_value,
1410                 size_t *        param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1411 
1412 #ifdef CL_VERSION_1_2
1413 
1414 extern CL_API_ENTRY cl_int CL_API_CALL
1415 clGetKernelArgInfo(cl_kernel       kernel,
1416                    cl_uint         arg_indx,
1417                    cl_kernel_arg_info  param_name,
1418                    size_t          param_value_size,
1419                    void *          param_value,
1420                    size_t *        param_value_size_ret) CL_API_SUFFIX__VERSION_1_2;
1421 
1422 #endif
1423 
1424 extern CL_API_ENTRY cl_int CL_API_CALL
1425 clGetKernelWorkGroupInfo(cl_kernel                  kernel,
1426                          cl_device_id               device,
1427                          cl_kernel_work_group_info  param_name,
1428                          size_t                     param_value_size,
1429                          void *                     param_value,
1430                          size_t *                   param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1431 
1432 #ifdef CL_VERSION_2_1
1433 
1434 extern CL_API_ENTRY cl_int CL_API_CALL
1435 clGetKernelSubGroupInfo(cl_kernel                   kernel,
1436                         cl_device_id                device,
1437                         cl_kernel_sub_group_info    param_name,
1438                         size_t                      input_value_size,
1439                         const void*                 input_value,
1440                         size_t                      param_value_size,
1441                         void*                       param_value,
1442                         size_t*                     param_value_size_ret) CL_API_SUFFIX__VERSION_2_1;
1443 
1444 #endif
1445 
1446 /* Event Object APIs */
1447 extern CL_API_ENTRY cl_int CL_API_CALL
1448 clWaitForEvents(cl_uint             num_events,
1449                 const cl_event *    event_list) CL_API_SUFFIX__VERSION_1_0;
1450 
1451 extern CL_API_ENTRY cl_int CL_API_CALL
1452 clGetEventInfo(cl_event         event,
1453                cl_event_info    param_name,
1454                size_t           param_value_size,
1455                void *           param_value,
1456                size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1457 
1458 #ifdef CL_VERSION_1_1
1459 
1460 extern CL_API_ENTRY cl_event CL_API_CALL
1461 clCreateUserEvent(cl_context    context,
1462                   cl_int *      errcode_ret) CL_API_SUFFIX__VERSION_1_1;
1463 
1464 #endif
1465 
1466 extern CL_API_ENTRY cl_int CL_API_CALL
1467 clRetainEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0;
1468 
1469 extern CL_API_ENTRY cl_int CL_API_CALL
1470 clReleaseEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0;
1471 
1472 #ifdef CL_VERSION_1_1
1473 
1474 extern CL_API_ENTRY cl_int CL_API_CALL
1475 clSetUserEventStatus(cl_event   event,
1476                      cl_int     execution_status) CL_API_SUFFIX__VERSION_1_1;
1477 
1478 extern CL_API_ENTRY cl_int CL_API_CALL
1479 clSetEventCallback(cl_event    event,
1480                    cl_int      command_exec_callback_type,
1481                    void (CL_CALLBACK * pfn_notify)(cl_event event,
1482                                                    cl_int   event_command_status,
1483                                                    void *   user_data),
1484                    void *      user_data) CL_API_SUFFIX__VERSION_1_1;
1485 
1486 #endif
1487 
1488 /* Profiling APIs */
1489 extern CL_API_ENTRY cl_int CL_API_CALL
1490 clGetEventProfilingInfo(cl_event            event,
1491                         cl_profiling_info   param_name,
1492                         size_t              param_value_size,
1493                         void *              param_value,
1494                         size_t *            param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
1495 
1496 /* Flush and Finish APIs */
1497 extern CL_API_ENTRY cl_int CL_API_CALL
1498 clFlush(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
1499 
1500 extern CL_API_ENTRY cl_int CL_API_CALL
1501 clFinish(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
1502 
1503 /* Enqueued Commands APIs */
1504 extern CL_API_ENTRY cl_int CL_API_CALL
1505 clEnqueueReadBuffer(cl_command_queue    command_queue,
1506                     cl_mem              buffer,
1507                     cl_bool             blocking_read,
1508                     size_t              offset,
1509                     size_t              size,
1510                     void *              ptr,
1511                     cl_uint             num_events_in_wait_list,
1512                     const cl_event *    event_wait_list,
1513                     cl_event *          event) CL_API_SUFFIX__VERSION_1_0;
1514 
1515 #ifdef CL_VERSION_1_1
1516 
1517 extern CL_API_ENTRY cl_int CL_API_CALL
1518 clEnqueueReadBufferRect(cl_command_queue    command_queue,
1519                         cl_mem              buffer,
1520                         cl_bool             blocking_read,
1521                         const size_t *      buffer_origin,
1522                         const size_t *      host_origin,
1523                         const size_t *      region,
1524                         size_t              buffer_row_pitch,
1525                         size_t              buffer_slice_pitch,
1526                         size_t              host_row_pitch,
1527                         size_t              host_slice_pitch,
1528                         void *              ptr,
1529                         cl_uint             num_events_in_wait_list,
1530                         const cl_event *    event_wait_list,
1531                         cl_event *          event) CL_API_SUFFIX__VERSION_1_1;
1532 
1533 #endif
1534 
1535 extern CL_API_ENTRY cl_int CL_API_CALL
1536 clEnqueueWriteBuffer(cl_command_queue   command_queue,
1537                      cl_mem             buffer,
1538                      cl_bool            blocking_write,
1539                      size_t             offset,
1540                      size_t             size,
1541                      const void *       ptr,
1542                      cl_uint            num_events_in_wait_list,
1543                      const cl_event *   event_wait_list,
1544                      cl_event *         event) CL_API_SUFFIX__VERSION_1_0;
1545 
1546 #ifdef CL_VERSION_1_1
1547 
1548 extern CL_API_ENTRY cl_int CL_API_CALL
1549 clEnqueueWriteBufferRect(cl_command_queue    command_queue,
1550                          cl_mem              buffer,
1551                          cl_bool             blocking_write,
1552                          const size_t *      buffer_origin,
1553                          const size_t *      host_origin,
1554                          const size_t *      region,
1555                          size_t              buffer_row_pitch,
1556                          size_t              buffer_slice_pitch,
1557                          size_t              host_row_pitch,
1558                          size_t              host_slice_pitch,
1559                          const void *        ptr,
1560                          cl_uint             num_events_in_wait_list,
1561                          const cl_event *    event_wait_list,
1562                          cl_event *          event) CL_API_SUFFIX__VERSION_1_1;
1563 
1564 #endif
1565 
1566 #ifdef CL_VERSION_1_2
1567 
1568 extern CL_API_ENTRY cl_int CL_API_CALL
1569 clEnqueueFillBuffer(cl_command_queue   command_queue,
1570                     cl_mem             buffer,
1571                     const void *       pattern,
1572                     size_t             pattern_size,
1573                     size_t             offset,
1574                     size_t             size,
1575                     cl_uint            num_events_in_wait_list,
1576                     const cl_event *   event_wait_list,
1577                     cl_event *         event) CL_API_SUFFIX__VERSION_1_2;
1578 
1579 #endif
1580 
1581 extern CL_API_ENTRY cl_int CL_API_CALL
1582 clEnqueueCopyBuffer(cl_command_queue    command_queue,
1583                     cl_mem              src_buffer,
1584                     cl_mem              dst_buffer,
1585                     size_t              src_offset,
1586                     size_t              dst_offset,
1587                     size_t              size,
1588                     cl_uint             num_events_in_wait_list,
1589                     const cl_event *    event_wait_list,
1590                     cl_event *          event) CL_API_SUFFIX__VERSION_1_0;
1591 
1592 #ifdef CL_VERSION_1_1
1593 
1594 extern CL_API_ENTRY cl_int CL_API_CALL
1595 clEnqueueCopyBufferRect(cl_command_queue    command_queue,
1596                         cl_mem              src_buffer,
1597                         cl_mem              dst_buffer,
1598                         const size_t *      src_origin,
1599                         const size_t *      dst_origin,
1600                         const size_t *      region,
1601                         size_t              src_row_pitch,
1602                         size_t              src_slice_pitch,
1603                         size_t              dst_row_pitch,
1604                         size_t              dst_slice_pitch,
1605                         cl_uint             num_events_in_wait_list,
1606                         const cl_event *    event_wait_list,
1607                         cl_event *          event) CL_API_SUFFIX__VERSION_1_1;
1608 
1609 #endif
1610 
1611 extern CL_API_ENTRY cl_int CL_API_CALL
1612 clEnqueueReadImage(cl_command_queue     command_queue,
1613                    cl_mem               image,
1614                    cl_bool              blocking_read,
1615                    const size_t *       origin,
1616                    const size_t *       region,
1617                    size_t               row_pitch,
1618                    size_t               slice_pitch,
1619                    void *               ptr,
1620                    cl_uint              num_events_in_wait_list,
1621                    const cl_event *     event_wait_list,
1622                    cl_event *           event) CL_API_SUFFIX__VERSION_1_0;
1623 
1624 extern CL_API_ENTRY cl_int CL_API_CALL
1625 clEnqueueWriteImage(cl_command_queue    command_queue,
1626                     cl_mem              image,
1627                     cl_bool             blocking_write,
1628                     const size_t *      origin,
1629                     const size_t *      region,
1630                     size_t              input_row_pitch,
1631                     size_t              input_slice_pitch,
1632                     const void *        ptr,
1633                     cl_uint             num_events_in_wait_list,
1634                     const cl_event *    event_wait_list,
1635                     cl_event *          event) CL_API_SUFFIX__VERSION_1_0;
1636 
1637 #ifdef CL_VERSION_1_2
1638 
1639 extern CL_API_ENTRY cl_int CL_API_CALL
1640 clEnqueueFillImage(cl_command_queue   command_queue,
1641                    cl_mem             image,
1642                    const void *       fill_color,
1643                    const size_t *     origin,
1644                    const size_t *     region,
1645                    cl_uint            num_events_in_wait_list,
1646                    const cl_event *   event_wait_list,
1647                    cl_event *         event) CL_API_SUFFIX__VERSION_1_2;
1648 
1649 #endif
1650 
1651 extern CL_API_ENTRY cl_int CL_API_CALL
1652 clEnqueueCopyImage(cl_command_queue     command_queue,
1653                    cl_mem               src_image,
1654                    cl_mem               dst_image,
1655                    const size_t *       src_origin,
1656                    const size_t *       dst_origin,
1657                    const size_t *       region,
1658                    cl_uint              num_events_in_wait_list,
1659                    const cl_event *     event_wait_list,
1660                    cl_event *           event) CL_API_SUFFIX__VERSION_1_0;
1661 
1662 extern CL_API_ENTRY cl_int CL_API_CALL
1663 clEnqueueCopyImageToBuffer(cl_command_queue command_queue,
1664                            cl_mem           src_image,
1665                            cl_mem           dst_buffer,
1666                            const size_t *   src_origin,
1667                            const size_t *   region,
1668                            size_t           dst_offset,
1669                            cl_uint          num_events_in_wait_list,
1670                            const cl_event * event_wait_list,
1671                            cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
1672 
1673 extern CL_API_ENTRY cl_int CL_API_CALL
1674 clEnqueueCopyBufferToImage(cl_command_queue command_queue,
1675                            cl_mem           src_buffer,
1676                            cl_mem           dst_image,
1677                            size_t           src_offset,
1678                            const size_t *   dst_origin,
1679                            const size_t *   region,
1680                            cl_uint          num_events_in_wait_list,
1681                            const cl_event * event_wait_list,
1682                            cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
1683 
1684 extern CL_API_ENTRY void * CL_API_CALL
1685 clEnqueueMapBuffer(cl_command_queue command_queue,
1686                    cl_mem           buffer,
1687                    cl_bool          blocking_map,
1688                    cl_map_flags     map_flags,
1689                    size_t           offset,
1690                    size_t           size,
1691                    cl_uint          num_events_in_wait_list,
1692                    const cl_event * event_wait_list,
1693                    cl_event *       event,
1694                    cl_int *         errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1695 
1696 extern CL_API_ENTRY void * CL_API_CALL
1697 clEnqueueMapImage(cl_command_queue  command_queue,
1698                   cl_mem            image,
1699                   cl_bool           blocking_map,
1700                   cl_map_flags      map_flags,
1701                   const size_t *    origin,
1702                   const size_t *    region,
1703                   size_t *          image_row_pitch,
1704                   size_t *          image_slice_pitch,
1705                   cl_uint           num_events_in_wait_list,
1706                   const cl_event *  event_wait_list,
1707                   cl_event *        event,
1708                   cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
1709 
1710 extern CL_API_ENTRY cl_int CL_API_CALL
1711 clEnqueueUnmapMemObject(cl_command_queue command_queue,
1712                         cl_mem           memobj,
1713                         void *           mapped_ptr,
1714                         cl_uint          num_events_in_wait_list,
1715                         const cl_event * event_wait_list,
1716                         cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
1717 
1718 #ifdef CL_VERSION_1_2
1719 
1720 extern CL_API_ENTRY cl_int CL_API_CALL
1721 clEnqueueMigrateMemObjects(cl_command_queue       command_queue,
1722                            cl_uint                num_mem_objects,
1723                            const cl_mem *         mem_objects,
1724                            cl_mem_migration_flags flags,
1725                            cl_uint                num_events_in_wait_list,
1726                            const cl_event *       event_wait_list,
1727                            cl_event *             event) CL_API_SUFFIX__VERSION_1_2;
1728 
1729 #endif
1730 
1731 extern CL_API_ENTRY cl_int CL_API_CALL
1732 clEnqueueNDRangeKernel(cl_command_queue command_queue,
1733                        cl_kernel        kernel,
1734                        cl_uint          work_dim,
1735                        const size_t *   global_work_offset,
1736                        const size_t *   global_work_size,
1737                        const size_t *   local_work_size,
1738                        cl_uint          num_events_in_wait_list,
1739                        const cl_event * event_wait_list,
1740                        cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
1741 
1742 extern CL_API_ENTRY cl_int CL_API_CALL
1743 clEnqueueNativeKernel(cl_command_queue  command_queue,
1744                       void (CL_CALLBACK * user_func)(void *),
1745                       void *            args,
1746                       size_t            cb_args,
1747                       cl_uint           num_mem_objects,
1748                       const cl_mem *    mem_list,
1749                       const void **     args_mem_loc,
1750                       cl_uint           num_events_in_wait_list,
1751                       const cl_event *  event_wait_list,
1752                       cl_event *        event) CL_API_SUFFIX__VERSION_1_0;
1753 
1754 #ifdef CL_VERSION_1_2
1755 
1756 extern CL_API_ENTRY cl_int CL_API_CALL
1757 clEnqueueMarkerWithWaitList(cl_command_queue  command_queue,
1758                             cl_uint           num_events_in_wait_list,
1759                             const cl_event *  event_wait_list,
1760                             cl_event *        event) CL_API_SUFFIX__VERSION_1_2;
1761 
1762 extern CL_API_ENTRY cl_int CL_API_CALL
1763 clEnqueueBarrierWithWaitList(cl_command_queue  command_queue,
1764                              cl_uint           num_events_in_wait_list,
1765                              const cl_event *  event_wait_list,
1766                              cl_event *        event) CL_API_SUFFIX__VERSION_1_2;
1767 
1768 #endif
1769 
1770 #ifdef CL_VERSION_2_0
1771 
1772 extern CL_API_ENTRY cl_int CL_API_CALL
1773 clEnqueueSVMFree(cl_command_queue  command_queue,
1774                  cl_uint           num_svm_pointers,
1775                  void *            svm_pointers[],
1776                  void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue,
1777                                                     cl_uint          num_svm_pointers,
1778                                                     void *           svm_pointers[],
1779                                                     void *           user_data),
1780                  void *            user_data,
1781                  cl_uint           num_events_in_wait_list,
1782                  const cl_event *  event_wait_list,
1783                  cl_event *        event) CL_API_SUFFIX__VERSION_2_0;
1784 
1785 extern CL_API_ENTRY cl_int CL_API_CALL
1786 clEnqueueSVMMemcpy(cl_command_queue  command_queue,
1787                    cl_bool           blocking_copy,
1788                    void *            dst_ptr,
1789                    const void *      src_ptr,
1790                    size_t            size,
1791                    cl_uint           num_events_in_wait_list,
1792                    const cl_event *  event_wait_list,
1793                    cl_event *        event) CL_API_SUFFIX__VERSION_2_0;
1794 
1795 extern CL_API_ENTRY cl_int CL_API_CALL
1796 clEnqueueSVMMemFill(cl_command_queue  command_queue,
1797                     void *            svm_ptr,
1798                     const void *      pattern,
1799                     size_t            pattern_size,
1800                     size_t            size,
1801                     cl_uint           num_events_in_wait_list,
1802                     const cl_event *  event_wait_list,
1803                     cl_event *        event) CL_API_SUFFIX__VERSION_2_0;
1804 
1805 extern CL_API_ENTRY cl_int CL_API_CALL
1806 clEnqueueSVMMap(cl_command_queue  command_queue,
1807                 cl_bool           blocking_map,
1808                 cl_map_flags      flags,
1809                 void *            svm_ptr,
1810                 size_t            size,
1811                 cl_uint           num_events_in_wait_list,
1812                 const cl_event *  event_wait_list,
1813                 cl_event *        event) CL_API_SUFFIX__VERSION_2_0;
1814 
1815 extern CL_API_ENTRY cl_int CL_API_CALL
1816 clEnqueueSVMUnmap(cl_command_queue  command_queue,
1817                   void *            svm_ptr,
1818                   cl_uint           num_events_in_wait_list,
1819                   const cl_event *  event_wait_list,
1820                   cl_event *        event) CL_API_SUFFIX__VERSION_2_0;
1821 
1822 #endif
1823 
1824 #ifdef CL_VERSION_2_1
1825 
1826 extern CL_API_ENTRY cl_int CL_API_CALL
1827 clEnqueueSVMMigrateMem(cl_command_queue         command_queue,
1828                        cl_uint                  num_svm_pointers,
1829                        const void **            svm_pointers,
1830                        const size_t *           sizes,
1831                        cl_mem_migration_flags   flags,
1832                        cl_uint                  num_events_in_wait_list,
1833                        const cl_event *         event_wait_list,
1834                        cl_event *               event) CL_API_SUFFIX__VERSION_2_1;
1835 
1836 #endif
1837 
1838 #ifdef CL_VERSION_1_2
1839 
1840 /* Extension function access
1841  *
1842  * Returns the extension function address for the given function name,
1843  * or NULL if a valid function can not be found.  The client must
1844  * check to make sure the address is not NULL, before using or
1845  * calling the returned function address.
1846  */
1847 extern CL_API_ENTRY void * CL_API_CALL
1848 clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
1849                                          const char *   func_name) CL_API_SUFFIX__VERSION_1_2;
1850 
1851 #endif
1852 
1853 #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
1854     /*
1855      *  WARNING:
1856      *     This API introduces mutable state into the OpenCL implementation. It has been REMOVED
1857      *  to better facilitate thread safety.  The 1.0 API is not thread safe. It is not tested by the
1858      *  OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
1859      *  It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
1860      *
1861      *  Software developers previously relying on this API are instructed to set the command queue
1862      *  properties when creating the queue, instead.
1863      */
1864     extern CL_API_ENTRY cl_int CL_API_CALL
1865     clSetCommandQueueProperty(cl_command_queue              command_queue,
1866                               cl_command_queue_properties   properties,
1867                               cl_bool                       enable,
1868                               cl_command_queue_properties * old_properties) CL_API_SUFFIX__VERSION_1_0_DEPRECATED;
1869 #endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
1870 
1871 /* Deprecated OpenCL 1.1 APIs */
1872 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
1873 clCreateImage2D(cl_context              context,
1874                 cl_mem_flags            flags,
1875                 const cl_image_format * image_format,
1876                 size_t                  image_width,
1877                 size_t                  image_height,
1878                 size_t                  image_row_pitch,
1879                 void *                  host_ptr,
1880                 cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1881 
1882 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
1883 clCreateImage3D(cl_context              context,
1884                 cl_mem_flags            flags,
1885                 const cl_image_format * image_format,
1886                 size_t                  image_width,
1887                 size_t                  image_height,
1888                 size_t                  image_depth,
1889                 size_t                  image_row_pitch,
1890                 size_t                  image_slice_pitch,
1891                 void *                  host_ptr,
1892                 cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1893 
1894 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1895 clEnqueueMarker(cl_command_queue    command_queue,
1896                 cl_event *          event) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1897 
1898 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1899 clEnqueueWaitForEvents(cl_command_queue  command_queue,
1900                         cl_uint          num_events,
1901                         const cl_event * event_list) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1902 
1903 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1904 clEnqueueBarrier(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1905 
1906 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1907 clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1908 
1909 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
1910 clGetExtensionFunctionAddress(const char * func_name) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
1911 
1912 /* Deprecated OpenCL 2.0 APIs */
1913 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
1914 clCreateCommandQueue(cl_context                     context,
1915                      cl_device_id                   device,
1916                      cl_command_queue_properties    properties,
1917                      cl_int *                       errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
1918 
1919 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
1920 clCreateSampler(cl_context          context,
1921                 cl_bool             normalized_coords,
1922                 cl_addressing_mode  addressing_mode,
1923                 cl_filter_mode      filter_mode,
1924                 cl_int *            errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
1925 
1926 extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
1927 clEnqueueTask(cl_command_queue  command_queue,
1928               cl_kernel         kernel,
1929               cl_uint           num_events_in_wait_list,
1930               const cl_event *  event_wait_list,
1931               cl_event *        event) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
1932 
1933 #endif /* !defined(CL_NO_CORE_PROTOTYPES) */
1934 
1935 #ifdef __cplusplus
1936 }
1937 #endif
1938 
1939 #endif  /* __OPENCL_CL_H */
1940