HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cl_ext.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2008-2018 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 /* cl_ext.h contains OpenCL extensions which don't have external */
30 /* (OpenGL, D3D) dependencies. */
31 
32 #ifndef __CL_EXT_H
33 #define __CL_EXT_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <CL/cl.h>
40 
41 /* cl_khr_fp64 extension - no extension #define since it has no functions */
42 /* CL_DEVICE_DOUBLE_FP_CONFIG is defined in CL.h for OpenCL >= 120 */
43 
44 #if CL_TARGET_OPENCL_VERSION <= 110
45 #define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
46 #endif
47 
48 /* cl_khr_fp16 extension - no extension #define since it has no functions */
49 #define CL_DEVICE_HALF_FP_CONFIG 0x1033
50 
51 /* Memory object destruction
52  *
53  * Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
54  *
55  * Registers a user callback function that will be called when the memory object is deleted and its resources
56  * freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
57  * stack associated with memobj. The registered user callback functions are called in the reverse order in
58  * which they were registered. The user callback functions are called and then the memory object is deleted
59  * and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
60  * notified when the memory referenced by host_ptr, specified when the memory object is created and used as
61  * the storage bits for the memory object, can be reused or freed.
62  *
63  * The application may not call CL api's with the cl_mem object passed to the pfn_notify.
64  *
65  * Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
66  * before using.
67  */
68 #define cl_APPLE_SetMemObjectDestructor 1
70  void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
71  void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
72 
73 
74 /* Context Logging Functions
75  *
76  * The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
77  * Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
78  * before using.
79  *
80  * clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger
81  */
82 #define cl_APPLE_ContextLoggingFunctions 1
83 extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE( const char * /* errstr */,
84  const void * /* private_info */,
85  size_t /* cb */,
86  void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
87 
88 /* clLogMessagesToStdout sends all log messages to the file descriptor stdout */
89 extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE( const char * /* errstr */,
90  const void * /* private_info */,
91  size_t /* cb */,
92  void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
93 
94 /* clLogMessagesToStderr sends all log messages to the file descriptor stderr */
95 extern void CL_API_ENTRY clLogMessagesToStderrAPPLE( const char * /* errstr */,
96  const void * /* private_info */,
97  size_t /* cb */,
98  void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
99 
100 
101 /************************
102 * cl_khr_icd extension *
103 ************************/
104 #define cl_khr_icd 1
105 
106 /* cl_platform_info */
107 #define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920
108 
109 /* Additional Error Codes */
110 #define CL_PLATFORM_NOT_FOUND_KHR -1001
111 
112 extern CL_API_ENTRY cl_int CL_API_CALL
113 clIcdGetPlatformIDsKHR(cl_uint /* num_entries */,
114  cl_platform_id * /* platforms */,
115  cl_uint * /* num_platforms */);
116 
118  cl_uint /* num_entries */,
119  cl_platform_id * /* platforms */,
120  cl_uint * /* num_platforms */);
121 
122 
123 
124 /*******************************
125  * cl_khr_il_program extension *
126  *******************************/
127 #define cl_khr_il_program 1
128 
129 /* New property to clGetDeviceInfo for retrieving supported intermediate
130  * languages
131  */
132 #define CL_DEVICE_IL_VERSION_KHR 0x105B
133 
134 /* New property to clGetProgramInfo for retrieving for retrieving the IL of a
135  * program
136  */
137 #define CL_PROGRAM_IL_KHR 0x1169
138 
141  cl_context /* context */,
142  const void * /* il */,
143  size_t /* length */,
144  cl_int * /* errcode_ret */);
145 
146 typedef CL_API_ENTRY cl_program
148  cl_context /* context */,
149  const void * /* il */,
150  size_t /* length */,
151  cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2;
152 
153 /* Extension: cl_khr_image2D_buffer
154  *
155  * This extension allows a 2D image to be created from a cl_mem buffer without a copy.
156  * The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t.
157  * Both the sampler and sampler-less read_image built-in functions are supported for 2D images
158  * and 2D images created from a buffer. Similarly, the write_image built-ins are also supported
159  * for 2D images created from a buffer.
160  *
161  * When the 2D image from buffer is created, the client must specify the width,
162  * height, image format (i.e. channel order and channel data type) and optionally the row pitch
163  *
164  * The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels.
165  * The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels.
166  */
167 
168 /**************************************
169  * cl_khr_initialize_memory extension *
170  **************************************/
171 
172 #define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x2030
173 
174 
175 /**************************************
176  * cl_khr_terminate_context extension *
177  **************************************/
178 
179 #define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x2031
180 #define CL_CONTEXT_TERMINATE_KHR 0x2032
181 
182 #define cl_khr_terminate_context 1
184 
185 typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
186 
187 
188 /*
189  * Extension: cl_khr_spir
190  *
191  * This extension adds support to create an OpenCL program object from a
192  * Standard Portable Intermediate Representation (SPIR) instance
193  */
194 
195 #define CL_DEVICE_SPIR_VERSIONS 0x40E0
196 #define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
197 
198 
199 /*****************************************
200  * cl_khr_create_command_queue extension *
201  *****************************************/
202 #define cl_khr_create_command_queue 1
203 
205 
208  cl_device_id /* device */,
209  const cl_queue_properties_khr* /* properties */,
210  cl_int* /* errcode_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
213  cl_device_id /* device */,
214  const cl_queue_properties_khr* /* properties */,
215  cl_int* /* errcode_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
216 
217 
218 /******************************************
219 * cl_nv_device_attribute_query extension *
220 ******************************************/
221 
222 /* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
223 #define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
224 #define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
225 #define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002
226 #define CL_DEVICE_WARP_SIZE_NV 0x4003
227 #define CL_DEVICE_GPU_OVERLAP_NV 0x4004
228 #define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
229 #define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
230 
231 
232 /*********************************
233 * cl_amd_device_attribute_query *
234 *********************************/
235 
236 #define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
237 
238 
239 /*********************************
240 * cl_arm_printf extension
241 *********************************/
242 
243 #define CL_PRINTF_CALLBACK_ARM 0x40B0
244 #define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
245 
246 
247 /***********************************
248 * cl_ext_device_fission extension
249 ***********************************/
250 #define cl_ext_device_fission 1
251 
252 extern CL_API_ENTRY cl_int CL_API_CALL
253 clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
254 
255 typedef CL_API_ENTRY cl_int
256 (CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
257 
258 extern CL_API_ENTRY cl_int CL_API_CALL
259 clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
260 
261 typedef CL_API_ENTRY cl_int
262 (CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
263 
265 extern CL_API_ENTRY cl_int CL_API_CALL
266 clCreateSubDevicesEXT( cl_device_id /*in_device*/,
267  const cl_device_partition_property_ext * /* properties */,
268  cl_uint /*num_entries*/,
269  cl_device_id * /*out_devices*/,
270  cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
271 
272 typedef CL_API_ENTRY cl_int
273 ( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/,
274  const cl_device_partition_property_ext * /* properties */,
275  cl_uint /*num_entries*/,
276  cl_device_id * /*out_devices*/,
277  cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
278 
279 /* cl_device_partition_property_ext */
280 #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050
281 #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
282 #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
283 #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
284 
285 /* clDeviceGetInfo selectors */
286 #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
287 #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
288 #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
289 #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
290 #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
291 
292 /* error codes */
293 #define CL_DEVICE_PARTITION_FAILED_EXT -1057
294 #define CL_INVALID_PARTITION_COUNT_EXT -1058
295 #define CL_INVALID_PARTITION_NAME_EXT -1059
296 
297 /* CL_AFFINITY_DOMAINs */
298 #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
299 #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
300 #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3
301 #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
302 #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
303 #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
304 
305 /* cl_device_partition_property_ext list terminators */
306 #define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0)
307 #define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
308 #define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
309 
310 
311 /***********************************
312  * cl_ext_migrate_memobject extension definitions
313  ***********************************/
314 #define cl_ext_migrate_memobject 1
315 
317 
318 #define CL_MIGRATE_MEM_OBJECT_HOST_EXT 0x1
319 
320 #define CL_COMMAND_MIGRATE_MEM_OBJECT_EXT 0x4040
321 
322 extern CL_API_ENTRY cl_int CL_API_CALL
324  cl_uint /* num_mem_objects */,
325  const cl_mem * /* mem_objects */,
326  cl_mem_migration_flags_ext /* flags */,
327  cl_uint /* num_events_in_wait_list */,
328  const cl_event * /* event_wait_list */,
329  cl_event * /* event */ );
330 
331 typedef CL_API_ENTRY cl_int
333  cl_uint /* num_mem_objects */,
334  const cl_mem * /* mem_objects */,
335  cl_mem_migration_flags_ext /* flags */,
336  cl_uint /* num_events_in_wait_list */,
337  const cl_event * /* event_wait_list */,
338  cl_event * /* event */ );
339 
340 
341 /*********************************
342 * cl_qcom_ext_host_ptr extension
343 *********************************/
344 #define cl_qcom_ext_host_ptr 1
345 
346 #define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29)
347 
348 #define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
349 #define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
350 #define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2
351 #define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3
352 #define CL_MEM_HOST_UNCACHED_QCOM 0x40A4
353 #define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5
354 #define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6
355 #define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7
356 
357 typedef cl_uint cl_image_pitch_info_qcom;
358 
359 extern CL_API_ENTRY cl_int CL_API_CALL
360 clGetDeviceImageInfoQCOM(cl_device_id device,
361  size_t image_width,
362  size_t image_height,
363  const cl_image_format *image_format,
364  cl_image_pitch_info_qcom param_name,
365  size_t param_value_size,
366  void *param_value,
367  size_t *param_value_size_ret);
368 
369 typedef struct _cl_mem_ext_host_ptr
370 {
371  /* Type of external memory allocation. */
372  /* Legal values will be defined in layered extensions. */
374 
375  /* Host cache policy for this external memory allocation. */
377 
379 
380 
381 /*******************************************
382 * cl_qcom_ext_host_ptr_iocoherent extension
383 ********************************************/
384 
385 /* Cache policy specifying io-coherence */
386 #define CL_MEM_HOST_IOCOHERENT_QCOM 0x40A9
387 
388 
389 /*********************************
390 * cl_qcom_ion_host_ptr extension
391 *********************************/
392 
393 #define CL_MEM_ION_HOST_PTR_QCOM 0x40A8
394 
395 typedef struct _cl_mem_ion_host_ptr
396 {
397  /* Type of external memory allocation. */
398  /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
400 
401  /* ION file descriptor */
403 
404  /* Host pointer to the ION allocated memory */
405  void* ion_hostptr;
406 
408 
409 
410 /*********************************
411 * cl_qcom_android_native_buffer_host_ptr extension
412 *********************************/
413 
414 #define CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM 0x40C6
415 
417 {
418  /* Type of external memory allocation. */
419  /* Must be CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM for Android native buffers. */
421 
422  /* Virtual pointer to the android native buffer */
423  void* anb_ptr;
424 
426 
427 
428 /******************************************
429  * cl_img_yuv_image extension *
430  ******************************************/
431 
432 /* Image formats used in clCreateImage */
433 #define CL_NV21_IMG 0x40D0
434 #define CL_YV12_IMG 0x40D1
435 
436 
437 /******************************************
438  * cl_img_cached_allocations extension *
439  ******************************************/
440 
441 /* Flag values used by clCreateBuffer */
442 #define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG (1 << 26)
443 #define CL_MEM_USE_CACHED_CPU_MEMORY_IMG (1 << 27)
444 
445 
446 /******************************************
447  * cl_img_use_gralloc_ptr extension *
448  ******************************************/
449 #define cl_img_use_gralloc_ptr 1
450 
451 /* Flag values used by clCreateBuffer */
452 #define CL_MEM_USE_GRALLOC_PTR_IMG (1 << 28)
453 
454 /* To be used by clGetEventInfo: */
455 #define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG 0x40D2
456 #define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG 0x40D3
457 
458 /* Error code from clEnqueueReleaseGrallocObjectsIMG */
459 #define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG 0x40D4
460 
461 extern CL_API_ENTRY cl_int CL_API_CALL
463  cl_uint /* num_objects */,
464  const cl_mem * /* mem_objects */,
465  cl_uint /* num_events_in_wait_list */,
466  const cl_event * /* event_wait_list */,
467  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
468 
469 extern CL_API_ENTRY cl_int CL_API_CALL
471  cl_uint /* num_objects */,
472  const cl_mem * /* mem_objects */,
473  cl_uint /* num_events_in_wait_list */,
474  const cl_event * /* event_wait_list */,
475  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
476 
477 
478 /*********************************
479 * cl_khr_subgroups extension
480 *********************************/
481 #define cl_khr_subgroups 1
482 
483 #if !defined(CL_VERSION_2_1)
484 /* For OpenCL 2.1 and newer, cl_kernel_sub_group_info is declared in CL.h.
485  In hindsight, there should have been a khr suffix on this type for
486  the extension, but keeping it un-suffixed to maintain backwards
487  compatibility. */
488 typedef cl_uint cl_kernel_sub_group_info;
489 #endif
490 
491 /* cl_kernel_sub_group_info */
492 #define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033
493 #define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034
494 
495 extern CL_API_ENTRY cl_int CL_API_CALL
496 clGetKernelSubGroupInfoKHR(cl_kernel /* in_kernel */,
497  cl_device_id /*in_device*/,
498  cl_kernel_sub_group_info /* param_name */,
499  size_t /*input_value_size*/,
500  const void * /*input_value*/,
501  size_t /*param_value_size*/,
502  void* /*param_value*/,
503  size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
504 
505 typedef CL_API_ENTRY cl_int
507  cl_device_id /*in_device*/,
508  cl_kernel_sub_group_info /* param_name */,
509  size_t /*input_value_size*/,
510  const void * /*input_value*/,
511  size_t /*param_value_size*/,
512  void* /*param_value*/,
513  size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
514 
515 
516 /*********************************
517 * cl_khr_mipmap_image extension
518 *********************************/
519 
520 /* cl_sampler_properties */
521 #define CL_SAMPLER_MIP_FILTER_MODE_KHR 0x1155
522 #define CL_SAMPLER_LOD_MIN_KHR 0x1156
523 #define CL_SAMPLER_LOD_MAX_KHR 0x1157
524 
525 
526 /*********************************
527 * cl_khr_priority_hints extension
528 *********************************/
529 /* This extension define is for backwards compatibility.
530  It shouldn't be required since this extension has no new functions. */
531 #define cl_khr_priority_hints 1
532 
533 typedef cl_uint cl_queue_priority_khr;
534 
535 /* cl_command_queue_properties */
536 #define CL_QUEUE_PRIORITY_KHR 0x1096
537 
538 /* cl_queue_priority_khr */
539 #define CL_QUEUE_PRIORITY_HIGH_KHR (1<<0)
540 #define CL_QUEUE_PRIORITY_MED_KHR (1<<1)
541 #define CL_QUEUE_PRIORITY_LOW_KHR (1<<2)
542 
543 
544 /*********************************
545 * cl_khr_throttle_hints extension
546 *********************************/
547 /* This extension define is for backwards compatibility.
548  It shouldn't be required since this extension has no new functions. */
549 #define cl_khr_throttle_hints 1
550 
551 typedef cl_uint cl_queue_throttle_khr;
552 
553 /* cl_command_queue_properties */
554 #define CL_QUEUE_THROTTLE_KHR 0x1097
555 
556 /* cl_queue_throttle_khr */
557 #define CL_QUEUE_THROTTLE_HIGH_KHR (1<<0)
558 #define CL_QUEUE_THROTTLE_MED_KHR (1<<1)
559 #define CL_QUEUE_THROTTLE_LOW_KHR (1<<2)
560 
561 
562 /*********************************
563 * cl_khr_subgroup_named_barrier
564 *********************************/
565 /* This extension define is for backwards compatibility.
566  It shouldn't be required since this extension has no new functions. */
567 #define cl_khr_subgroup_named_barrier 1
568 
569 /* cl_device_info */
570 #define CL_DEVICE_MAX_NAMED_BARRIER_COUNT_KHR 0x2035
571 
572 
573 /**********************************
574  * cl_arm_import_memory extension *
575  **********************************/
576 #define cl_arm_import_memory 1
577 
578 typedef intptr_t cl_import_properties_arm;
579 
580 /* Default and valid proporties name for cl_arm_import_memory */
581 #define CL_IMPORT_TYPE_ARM 0x40B2
582 
583 /* Host process memory type default value for CL_IMPORT_TYPE_ARM property */
584 #define CL_IMPORT_TYPE_HOST_ARM 0x40B3
585 
586 /* DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
587 #define CL_IMPORT_TYPE_DMA_BUF_ARM 0x40B4
588 
589 /* Protected DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
590 #define CL_IMPORT_TYPE_PROTECTED_ARM 0x40B5
591 
592 /* This extension adds a new function that allows for direct memory import into
593  * OpenCL via the clImportMemoryARM function.
594  *
595  * Memory imported through this interface will be mapped into the device's page
596  * tables directly, providing zero copy access. It will never fall back to copy
597  * operations and aliased buffers.
598  *
599  * Types of memory supported for import are specified as additional extension
600  * strings.
601  *
602  * This extension produces cl_mem allocations which are compatible with all other
603  * users of cl_mem in the standard API.
604  *
605  * This extension maps pages with the same properties as the normal buffer creation
606  * function clCreateBuffer.
607  */
608 extern CL_API_ENTRY cl_mem CL_API_CALL
609 clImportMemoryARM( cl_context context,
611  const cl_import_properties_arm *properties,
612  void *memory,
613  size_t size,
614  cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
615 
616 
617 /******************************************
618  * cl_arm_shared_virtual_memory extension *
619  ******************************************/
620 #define cl_arm_shared_virtual_memory 1
621 
622 /* Used by clGetDeviceInfo */
623 #define CL_DEVICE_SVM_CAPABILITIES_ARM 0x40B6
624 
625 /* Used by clGetMemObjectInfo */
626 #define CL_MEM_USES_SVM_POINTER_ARM 0x40B7
627 
628 /* Used by clSetKernelExecInfoARM: */
629 #define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM 0x40B8
630 #define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM 0x40B9
631 
632 /* To be used by clGetEventInfo: */
633 #define CL_COMMAND_SVM_FREE_ARM 0x40BA
634 #define CL_COMMAND_SVM_MEMCPY_ARM 0x40BB
635 #define CL_COMMAND_SVM_MEMFILL_ARM 0x40BC
636 #define CL_COMMAND_SVM_MAP_ARM 0x40BD
637 #define CL_COMMAND_SVM_UNMAP_ARM 0x40BE
638 
639 /* Flag values returned by clGetDeviceInfo with CL_DEVICE_SVM_CAPABILITIES_ARM as the param_name. */
640 #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM (1 << 0)
641 #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM (1 << 1)
642 #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM (1 << 2)
643 #define CL_DEVICE_SVM_ATOMICS_ARM (1 << 3)
644 
645 /* Flag values used by clSVMAllocARM: */
646 #define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM (1 << 10)
647 #define CL_MEM_SVM_ATOMICS_ARM (1 << 11)
648 
650 typedef cl_uint cl_kernel_exec_info_arm;
652 
653 extern CL_API_ENTRY void * CL_API_CALL
654 clSVMAllocARM(cl_context /* context */,
655  cl_svm_mem_flags_arm /* flags */,
656  size_t /* size */,
657  cl_uint /* alignment */) CL_EXT_SUFFIX__VERSION_1_2;
658 
659 extern CL_API_ENTRY void CL_API_CALL
660 clSVMFreeARM(cl_context /* context */,
661  void * /* svm_pointer */) CL_EXT_SUFFIX__VERSION_1_2;
662 
663 extern CL_API_ENTRY cl_int CL_API_CALL
664 clEnqueueSVMFreeARM(cl_command_queue /* command_queue */,
665  cl_uint /* num_svm_pointers */,
666  void *[] /* svm_pointers[] */,
667  void (CL_CALLBACK * /*pfn_free_func*/)(cl_command_queue /* queue */,
668  cl_uint /* num_svm_pointers */,
669  void *[] /* svm_pointers[] */,
670  void * /* user_data */),
671  void * /* user_data */,
672  cl_uint /* num_events_in_wait_list */,
673  const cl_event * /* event_wait_list */,
674  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
675 
676 extern CL_API_ENTRY cl_int CL_API_CALL
677 clEnqueueSVMMemcpyARM(cl_command_queue /* command_queue */,
678  cl_bool /* blocking_copy */,
679  void * /* dst_ptr */,
680  const void * /* src_ptr */,
681  size_t /* size */,
682  cl_uint /* num_events_in_wait_list */,
683  const cl_event * /* event_wait_list */,
684  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
685 
686 extern CL_API_ENTRY cl_int CL_API_CALL
687 clEnqueueSVMMemFillARM(cl_command_queue /* command_queue */,
688  void * /* svm_ptr */,
689  const void * /* pattern */,
690  size_t /* pattern_size */,
691  size_t /* size */,
692  cl_uint /* num_events_in_wait_list */,
693  const cl_event * /* event_wait_list */,
694  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
695 
696 extern CL_API_ENTRY cl_int CL_API_CALL
697 clEnqueueSVMMapARM(cl_command_queue /* command_queue */,
698  cl_bool /* blocking_map */,
699  cl_map_flags /* flags */,
700  void * /* svm_ptr */,
701  size_t /* size */,
702  cl_uint /* num_events_in_wait_list */,
703  const cl_event * /* event_wait_list */,
704  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
705 
706 extern CL_API_ENTRY cl_int CL_API_CALL
707 clEnqueueSVMUnmapARM(cl_command_queue /* command_queue */,
708  void * /* svm_ptr */,
709  cl_uint /* num_events_in_wait_list */,
710  const cl_event * /* event_wait_list */,
711  cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
712 
713 extern CL_API_ENTRY cl_int CL_API_CALL
714 clSetKernelArgSVMPointerARM(cl_kernel /* kernel */,
715  cl_uint /* arg_index */,
716  const void * /* arg_value */) CL_EXT_SUFFIX__VERSION_1_2;
717 extern CL_API_ENTRY cl_int CL_API_CALL
718 clSetKernelExecInfoARM(cl_kernel /* kernel */,
719  cl_kernel_exec_info_arm /* param_name */,
720  size_t /* param_value_size */,
721  const void * /* param_value */) CL_EXT_SUFFIX__VERSION_1_2;
722 
723 /********************************
724  * cl_arm_get_core_id extension *
725  ********************************/
726 
727 #ifdef CL_VERSION_1_2
728 
729 #define cl_arm_get_core_id 1
730 
731 /* Device info property for bitfield of cores present */
732 #define CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM 0x40BF
733 
734 #endif /* CL_VERSION_1_2 */
735 
736 #ifdef __cplusplus
737 }
738 #endif
739 
740 
741 #endif /* __CL_EXT_H */
struct _cl_device_id * cl_device_id
Definition: cl.h:42
CL_API_ENTRY cl_command_queue CL_API_CALL clCreateCommandQueueWithPropertiesKHR(cl_context, cl_device_id, const cl_queue_properties_khr *, cl_int *) CL_EXT_SUFFIX__VERSION_1_2
CL_API_ENTRY cl_program CL_API_CALL clCreateProgramWithILKHR(cl_context, const void *, size_t, cl_int *)
cl_uint cl_image_pitch_info_qcom
Definition: cl_ext.h:357
cl_uint cl_kernel_sub_group_info
Definition: cl_ext.h:488
struct _cl_context * cl_context
Definition: cl.h:43
cl_uint cl_queue_throttle_khr
Definition: cl_ext.h:551
CL_API_ENTRY cl_int(CL_API_CALL * clIcdGetPlatformIDsKHR_fn)(cl_uint, cl_platform_id *, cl_uint *)
Definition: cl_ext.h:117
#define CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
Definition: cl_platform.h:160
cl_ulong cl_device_partition_property_ext
Definition: cl_ext.h:264
CL_API_ENTRY cl_int CL_API_CALL clSetKernelArgSVMPointerARM(cl_kernel, cl_uint, const void *) CL_EXT_SUFFIX__VERSION_1_2
cl_bitfield cl_device_svm_capabilities_arm
Definition: cl_ext.h:651
CL_API_ENTRY cl_int CL_API_CALL clReleaseDeviceEXT(cl_device_id) CL_EXT_SUFFIX__VERSION_1_1
CL_API_ENTRY cl_int CL_API_CALL clSetKernelExecInfoARM(cl_kernel, cl_kernel_exec_info_arm, size_t, const void *) CL_EXT_SUFFIX__VERSION_1_2
#define CL_EXT_SUFFIX__VERSION_1_2
Definition: cl_platform.h:62
CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireGrallocObjectsIMG(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
CL_API_ENTRY void *CL_API_CALL clSVMAllocARM(cl_context, cl_svm_mem_flags_arm, size_t, cl_uint) CL_EXT_SUFFIX__VERSION_1_2
cl_bitfield cl_map_flags
Definition: cl.h:93
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE(cl_mem, void(*)(cl_mem, void *), void *) CL_EXT_SUFFIX__VERSION_1_0
GLbitfield flags
Definition: glcorearb.h:1595
void CL_API_ENTRY clLogMessagesToSystemLogAPPLE(const char *, const void *, size_t, void *) CL_EXT_SUFFIX__VERSION_1_0
cl_ulong cl_bitfield
Definition: cl.h:52
CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectEXT(cl_command_queue, cl_uint, const cl_mem *, cl_mem_migration_flags_ext, cl_uint, const cl_event *, cl_event *)
CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context) CL_EXT_SUFFIX__VERSION_1_2
cl_uint host_cache_policy
Definition: cl_ext.h:376
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue, cl_uint, const cl_mem *, cl_mem_migration_flags_ext, cl_uint, const cl_event *, cl_event *)
Definition: cl_ext.h:332
struct _cl_mem_ext_host_ptr cl_mem_ext_host_ptr
GLsizeiptr size
Definition: glcorearb.h:663
struct _cl_platform_id * cl_platform_id
Definition: cl.h:41
#define CL_API_ENTRY
Definition: cl_platform.h:43
cl_bitfield cl_mem_migration_flags_ext
Definition: cl_ext.h:316
CL_API_ENTRY cl_int(CL_API_CALL * clReleaseDeviceEXT_fn)(cl_device_id) CL_EXT_SUFFIX__VERSION_1_1
Definition: cl_ext.h:256
cl_bitfield cl_svm_mem_flags_arm
Definition: cl_ext.h:649
CL_API_ENTRY cl_int(CL_API_CALL * clRetainDeviceEXT_fn)(cl_device_id) CL_EXT_SUFFIX__VERSION_1_1
Definition: cl_ext.h:262
CL_API_ENTRY cl_int CL_API_CALL clGetDeviceImageInfoQCOM(cl_device_id device, size_t image_width, size_t image_height, const cl_image_format *image_format, cl_image_pitch_info_qcom param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
#define CL_CALLBACK
Definition: cl.hpp:170
CL_API_ENTRY cl_int(CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel, cl_device_id, cl_kernel_sub_group_info, size_t, const void *, size_t, void *, size_t *) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
Definition: cl_ext.h:506
CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseGrallocObjectsIMG(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
#define CL_EXT_SUFFIX__VERSION_1_1
Definition: cl_platform.h:60
intptr_t cl_import_properties_arm
Definition: cl_ext.h:578
struct _cl_kernel * cl_kernel
Definition: cl.h:47
CL_API_ENTRY cl_int CL_API_CALL clEnqueueSVMMapARM(cl_command_queue, cl_bool, cl_map_flags, void *, size_t, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
CL_API_ENTRY cl_int(CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id, const cl_device_partition_property_ext *, cl_uint, cl_device_id *, cl_uint *) CL_EXT_SUFFIX__VERSION_1_1
Definition: cl_ext.h:273
CL_API_ENTRY cl_int CL_API_CALL clCreateSubDevicesEXT(cl_device_id, const cl_device_partition_property_ext *, cl_uint, cl_device_id *, cl_uint *) CL_EXT_SUFFIX__VERSION_1_1
CL_API_ENTRY void CL_API_CALL clSVMFreeARM(cl_context, void *) CL_EXT_SUFFIX__VERSION_1_2
CL_API_ENTRY cl_int CL_API_CALL clIcdGetPlatformIDsKHR(cl_uint, cl_platform_id *, cl_uint *)
CL_API_ENTRY cl_int CL_API_CALL clRetainDeviceEXT(cl_device_id) CL_EXT_SUFFIX__VERSION_1_1
struct _cl_mem * cl_mem
Definition: cl.h:45
CL_API_ENTRY cl_int CL_API_CALL clEnqueueSVMFreeARM(cl_command_queue, cl_uint, void *[], void(CL_CALLBACK *)(cl_command_queue, cl_uint, void *[], void *), void *, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
cl_bitfield cl_queue_properties_khr
Definition: cl_ext.h:204
struct _cl_mem_android_native_buffer_host_ptr cl_mem_android_native_buffer_host_ptr
void * ion_hostptr
Definition: cl_ext.h:405
cl_mem_ext_host_ptr ext_host_ptr
Definition: cl_ext.h:420
void CL_API_ENTRY clLogMessagesToStderrAPPLE(const char *, const void *, size_t, void *) CL_EXT_SUFFIX__VERSION_1_0
struct _cl_event * cl_event
Definition: cl.h:48
struct _cl_command_queue * cl_command_queue
Definition: cl.h:44
cl_uint cl_kernel_exec_info_arm
Definition: cl_ext.h:650
cl_uint allocation_type
Definition: cl_ext.h:373
#define CL_API_CALL
Definition: cl_platform.h:44
CL_API_ENTRY cl_command_queue(CL_API_CALL * clCreateCommandQueueWithPropertiesKHR_fn)(cl_context, cl_device_id, const cl_queue_properties_khr *, cl_int *) CL_EXT_SUFFIX__VERSION_1_2
Definition: cl_ext.h:212
CL_API_ENTRY cl_program(CL_API_CALL * clCreateProgramWithILKHR_fn)(cl_context, const void *, size_t, cl_int *) CL_EXT_SUFFIX__VERSION_1_2
Definition: cl_ext.h:147
void CL_API_ENTRY clLogMessagesToStdoutAPPLE(const char *, const void *, size_t, void *) CL_EXT_SUFFIX__VERSION_1_0
struct _cl_program * cl_program
Definition: cl.h:46
CL_API_ENTRY cl_int(CL_API_CALL * clTerminateContextKHR_fn)(cl_context) CL_EXT_SUFFIX__VERSION_1_2
Definition: cl_ext.h:185
#define const
Definition: zconf.h:214
#define CL_EXT_SUFFIX__VERSION_1_0
Definition: cl_platform.h:58
CL_API_ENTRY cl_int CL_API_CALL clEnqueueSVMMemFillARM(cl_command_queue, void *, const void *, size_t, size_t, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
CL_API_ENTRY cl_int CL_API_CALL clEnqueueSVMMemcpyARM(cl_command_queue, cl_bool, void *, const void *, size_t, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
cl_mem_ext_host_ptr ext_host_ptr
Definition: cl_ext.h:399
struct _cl_mem_ion_host_ptr cl_mem_ion_host_ptr
CL_API_ENTRY cl_int CL_API_CALL clEnqueueSVMUnmapARM(cl_command_queue, void *, cl_uint, const cl_event *, cl_event *) CL_EXT_SUFFIX__VERSION_1_2
cl_uint cl_bool
Definition: cl.h:51
cl_bitfield cl_mem_flags
Definition: cl.h:77
cl_uint cl_queue_priority_khr
Definition: cl_ext.h:533
CL_API_ENTRY cl_int CL_API_CALL clGetKernelSubGroupInfoKHR(cl_kernel, cl_device_id, cl_kernel_sub_group_info, size_t, const void *, size_t, void *, size_t *) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED
CL_API_ENTRY cl_mem CL_API_CALL clImportMemoryARM(cl_context context, cl_mem_flags flags, const cl_import_properties_arm *properties, void *memory, size_t size, cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0