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