1af69d88dSmrg/*******************************************************************************
27ec681f3Smrg * Copyright (c) 2008-2020 The Khronos Group Inc.
3af69d88dSmrg *
47ec681f3Smrg * Licensed under the Apache License, Version 2.0 (the "License");
57ec681f3Smrg * you may not use this file except in compliance with the License.
67ec681f3Smrg * You may obtain a copy of the License at
7af69d88dSmrg *
87ec681f3Smrg *    http://www.apache.org/licenses/LICENSE-2.0
9af69d88dSmrg *
107ec681f3Smrg * Unless required by applicable law or agreed to in writing, software
117ec681f3Smrg * distributed under the License is distributed on an "AS IS" BASIS,
127ec681f3Smrg * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137ec681f3Smrg * See the License for the specific language governing permissions and
147ec681f3Smrg * limitations under the License.
15af69d88dSmrg ******************************************************************************/
16af69d88dSmrg
17af69d88dSmrg/* cl_ext.h contains OpenCL extensions which don't have external */
18af69d88dSmrg/* (OpenGL, D3D) dependencies.                                   */
19af69d88dSmrg
20af69d88dSmrg#ifndef __CL_EXT_H
21af69d88dSmrg#define __CL_EXT_H
22af69d88dSmrg
23af69d88dSmrg#ifdef __cplusplus
24af69d88dSmrgextern "C" {
25af69d88dSmrg#endif
26af69d88dSmrg
2753c12917Smaya#include <CL/cl.h>
2853c12917Smaya
2953c12917Smaya/* cl_khr_fp64 extension - no extension #define since it has no functions  */
3053c12917Smaya/* CL_DEVICE_DOUBLE_FP_CONFIG is defined in CL.h for OpenCL >= 120 */
3153c12917Smaya
3253c12917Smaya#if CL_TARGET_OPENCL_VERSION <= 110
3353c12917Smaya#define CL_DEVICE_DOUBLE_FP_CONFIG                       0x1032
34af69d88dSmrg#endif
35af69d88dSmrg
36af69d88dSmrg/* cl_khr_fp16 extension - no extension #define since it has no functions  */
37af69d88dSmrg#define CL_DEVICE_HALF_FP_CONFIG                    0x1033
38af69d88dSmrg
39af69d88dSmrg/* Memory object destruction
40af69d88dSmrg *
41af69d88dSmrg * Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
42af69d88dSmrg *
4353c12917Smaya * Registers a user callback function that will be called when the memory object is deleted and its resources
4453c12917Smaya * freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
4553c12917Smaya * stack associated with memobj. The registered user callback functions are called in the reverse order in
4653c12917Smaya * which they were registered. The user callback functions are called and then the memory object is deleted
4753c12917Smaya * and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
4853c12917Smaya * notified when the memory referenced by host_ptr, specified when the memory object is created and used as
49af69d88dSmrg * the storage bits for the memory object, can be reused or freed.
50af69d88dSmrg *
51af69d88dSmrg * The application may not call CL api's with the cl_mem object passed to the pfn_notify.
52af69d88dSmrg *
53af69d88dSmrg * Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
54af69d88dSmrg * before using.
55af69d88dSmrg */
56af69d88dSmrg#define cl_APPLE_SetMemObjectDestructor 1
5753c12917Smayacl_int  CL_API_ENTRY clSetMemObjectDestructorAPPLE(  cl_mem memobj,
5853c12917Smaya                                        void (* pfn_notify)(cl_mem memobj, void * user_data),
5953c12917Smaya                                        void * user_data)             CL_EXT_SUFFIX__VERSION_1_0;
60af69d88dSmrg
61af69d88dSmrg
62af69d88dSmrg/* Context Logging Functions
63af69d88dSmrg *
64af69d88dSmrg * The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
65af69d88dSmrg * Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
66af69d88dSmrg * before using.
67af69d88dSmrg *
6853c12917Smaya * clLogMessagesToSystemLog forwards on all log messages to the Apple System Logger
69af69d88dSmrg */
70af69d88dSmrg#define cl_APPLE_ContextLoggingFunctions 1
7153c12917Smayaextern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE(  const char * errstr,
7253c12917Smaya                                            const void * private_info,
7353c12917Smaya                                            size_t       cb,
7453c12917Smaya                                            void *       user_data)  CL_EXT_SUFFIX__VERSION_1_0;
75af69d88dSmrg
76af69d88dSmrg/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */
7753c12917Smayaextern void CL_API_ENTRY clLogMessagesToStdoutAPPLE(   const char * errstr,
7853c12917Smaya                                          const void * private_info,
7953c12917Smaya                                          size_t       cb,
8053c12917Smaya                                          void *       user_data)    CL_EXT_SUFFIX__VERSION_1_0;
81af69d88dSmrg
82af69d88dSmrg/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */
8353c12917Smayaextern void CL_API_ENTRY clLogMessagesToStderrAPPLE(   const char * errstr,
8453c12917Smaya                                          const void * private_info,
8553c12917Smaya                                          size_t       cb,
8653c12917Smaya                                          void *       user_data)    CL_EXT_SUFFIX__VERSION_1_0;
87af69d88dSmrg
88af69d88dSmrg
8953c12917Smaya/************************
9053c12917Smaya* cl_khr_icd extension *
91af69d88dSmrg************************/
92af69d88dSmrg#define cl_khr_icd 1
93af69d88dSmrg
94af69d88dSmrg/* cl_platform_info                                                        */
95af69d88dSmrg#define CL_PLATFORM_ICD_SUFFIX_KHR                  0x0920
96af69d88dSmrg
97af69d88dSmrg/* Additional Error Codes                                                  */
98af69d88dSmrg#define CL_PLATFORM_NOT_FOUND_KHR                   -1001
99af69d88dSmrg
100af69d88dSmrgextern CL_API_ENTRY cl_int CL_API_CALL
10153c12917SmayaclIcdGetPlatformIDsKHR(cl_uint          num_entries,
10253c12917Smaya                       cl_platform_id * platforms,
10353c12917Smaya                       cl_uint *        num_platforms);
10453c12917Smaya
10553c12917Smayatypedef CL_API_ENTRY cl_int
10653c12917Smaya(CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(cl_uint          num_entries,
10753c12917Smaya                                         cl_platform_id * platforms,
10853c12917Smaya                                         cl_uint *        num_platforms);
10953c12917Smaya
11053c12917Smaya
11153c12917Smaya/*******************************
11253c12917Smaya * cl_khr_il_program extension *
11353c12917Smaya *******************************/
11453c12917Smaya#define cl_khr_il_program 1
11553c12917Smaya
11653c12917Smaya/* New property to clGetDeviceInfo for retrieving supported intermediate
11753c12917Smaya * languages
11853c12917Smaya */
11953c12917Smaya#define CL_DEVICE_IL_VERSION_KHR                    0x105B
120af69d88dSmrg
12153c12917Smaya/* New property to clGetProgramInfo for retrieving for retrieving the IL of a
12253c12917Smaya * program
12353c12917Smaya */
12453c12917Smaya#define CL_PROGRAM_IL_KHR                           0x1169
12553c12917Smaya
12653c12917Smayaextern CL_API_ENTRY cl_program CL_API_CALL
12753c12917SmayaclCreateProgramWithILKHR(cl_context   context,
12853c12917Smaya                         const void * il,
12953c12917Smaya                         size_t       length,
13053c12917Smaya                         cl_int *     errcode_ret);
131af69d88dSmrg
13253c12917Smayatypedef CL_API_ENTRY cl_program
13353c12917Smaya(CL_API_CALL *clCreateProgramWithILKHR_fn)(cl_context   context,
13453c12917Smaya                                           const void * il,
13553c12917Smaya                                           size_t       length,
13653c12917Smaya                                           cl_int *     errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
137af69d88dSmrg
1387ec681f3Smrg/* Extension: cl_khr_image2d_from_buffer
139af69d88dSmrg *
1407ec681f3Smrg * This extension allows a 2D image to be created from a cl_mem buffer without
1417ec681f3Smrg * a copy. The type associated with a 2D image created from a buffer in an
1427ec681f3Smrg * OpenCL program is image2d_t. Both the sampler and sampler-less read_image
1437ec681f3Smrg * built-in functions are supported for 2D images and 2D images created from
1447ec681f3Smrg * a buffer.  Similarly, the write_image built-ins are also supported for 2D
1457ec681f3Smrg * images created from a buffer.
146af69d88dSmrg *
1477ec681f3Smrg * When the 2D image from buffer is created, the client must specify the
1487ec681f3Smrg * width, height, image format (i.e. channel order and channel data type)
1497ec681f3Smrg * and optionally the row pitch.
150af69d88dSmrg *
1517ec681f3Smrg * The pitch specified must be a multiple of
1527ec681f3Smrg * CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR pixels.
1537ec681f3Smrg * The base address of the buffer must be aligned to
1547ec681f3Smrg * CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR pixels.
155af69d88dSmrg */
15653c12917Smaya
1577ec681f3Smrg#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR              0x104A
1587ec681f3Smrg#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR       0x104B
1597ec681f3Smrg
1607ec681f3Smrg
16153c12917Smaya/**************************************
16253c12917Smaya * cl_khr_initialize_memory extension *
16353c12917Smaya **************************************/
16453c12917Smaya
16553c12917Smaya#define CL_CONTEXT_MEMORY_INITIALIZE_KHR            0x2030
16653c12917Smaya
16753c12917Smaya
168af69d88dSmrg/**************************************
169af69d88dSmrg * cl_khr_terminate_context extension *
170af69d88dSmrg **************************************/
17153c12917Smaya
1727ec681f3Smrg#define CL_CONTEXT_TERMINATED_KHR                   -1121
1737ec681f3Smrg
17453c12917Smaya#define CL_DEVICE_TERMINATE_CAPABILITY_KHR          0x2031
17553c12917Smaya#define CL_CONTEXT_TERMINATE_KHR                    0x2032
176af69d88dSmrg
177af69d88dSmrg#define cl_khr_terminate_context 1
17853c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
17953c12917SmayaclTerminateContextKHR(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
18053c12917Smaya
18153c12917Smayatypedef CL_API_ENTRY cl_int
18253c12917Smaya(CL_API_CALL *clTerminateContextKHR_fn)(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
18353c12917Smaya
184af69d88dSmrg
185af69d88dSmrg/*
186af69d88dSmrg * Extension: cl_khr_spir
187af69d88dSmrg *
18853c12917Smaya * This extension adds support to create an OpenCL program object from a
189af69d88dSmrg * Standard Portable Intermediate Representation (SPIR) instance
190af69d88dSmrg */
191af69d88dSmrg
192af69d88dSmrg#define CL_DEVICE_SPIR_VERSIONS                     0x40E0
193af69d88dSmrg#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE         0x40E1
194af69d88dSmrg
195af69d88dSmrg
19653c12917Smaya/*****************************************
19753c12917Smaya * cl_khr_create_command_queue extension *
19853c12917Smaya *****************************************/
19953c12917Smaya#define cl_khr_create_command_queue 1
20053c12917Smaya
2017ec681f3Smrgtypedef cl_properties cl_queue_properties_khr;
20253c12917Smaya
20353c12917Smayaextern CL_API_ENTRY cl_command_queue CL_API_CALL
20453c12917SmayaclCreateCommandQueueWithPropertiesKHR(cl_context context,
20553c12917Smaya                                      cl_device_id device,
20653c12917Smaya                                      const cl_queue_properties_khr* properties,
20753c12917Smaya                                      cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
20853c12917Smaya
20953c12917Smayatypedef CL_API_ENTRY cl_command_queue
21053c12917Smaya(CL_API_CALL *clCreateCommandQueueWithPropertiesKHR_fn)(cl_context context,
21153c12917Smaya                                                        cl_device_id device,
21253c12917Smaya                                                        const cl_queue_properties_khr* properties,
21353c12917Smaya                                                        cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
21453c12917Smaya
21553c12917Smaya
216af69d88dSmrg/******************************************
217af69d88dSmrg* cl_nv_device_attribute_query extension *
218af69d88dSmrg******************************************/
21953c12917Smaya
220af69d88dSmrg/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
221af69d88dSmrg#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV       0x4000
222af69d88dSmrg#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV       0x4001
223af69d88dSmrg#define CL_DEVICE_REGISTERS_PER_BLOCK_NV            0x4002
224af69d88dSmrg#define CL_DEVICE_WARP_SIZE_NV                      0x4003
225af69d88dSmrg#define CL_DEVICE_GPU_OVERLAP_NV                    0x4004
226af69d88dSmrg#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV            0x4005
227af69d88dSmrg#define CL_DEVICE_INTEGRATED_MEMORY_NV              0x4006
228af69d88dSmrg
22953c12917Smaya
230af69d88dSmrg/*********************************
231af69d88dSmrg* cl_amd_device_attribute_query *
232af69d88dSmrg*********************************/
23353c12917Smaya
2347ec681f3Smrg#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD            0x4036
2357ec681f3Smrg#define CL_DEVICE_TOPOLOGY_AMD                          0x4037
2367ec681f3Smrg#define CL_DEVICE_BOARD_NAME_AMD                        0x4038
2377ec681f3Smrg#define CL_DEVICE_GLOBAL_FREE_MEMORY_AMD                0x4039
2387ec681f3Smrg#define CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD             0x4040
2397ec681f3Smrg#define CL_DEVICE_SIMD_WIDTH_AMD                        0x4041
2407ec681f3Smrg#define CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD            0x4042
2417ec681f3Smrg#define CL_DEVICE_WAVEFRONT_WIDTH_AMD                   0x4043
2427ec681f3Smrg#define CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD               0x4044
2437ec681f3Smrg#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD          0x4045
2447ec681f3Smrg#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD     0x4046
2457ec681f3Smrg#define CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD   0x4047
2467ec681f3Smrg#define CL_DEVICE_LOCAL_MEM_BANKS_AMD                   0x4048
2477ec681f3Smrg#define CL_DEVICE_THREAD_TRACE_SUPPORTED_AMD            0x4049
2487ec681f3Smrg#define CL_DEVICE_GFXIP_MAJOR_AMD                       0x404A
2497ec681f3Smrg#define CL_DEVICE_GFXIP_MINOR_AMD                       0x404B
2507ec681f3Smrg#define CL_DEVICE_AVAILABLE_ASYNC_QUEUES_AMD            0x404C
2517ec681f3Smrg#define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_AMD         0x4030
2527ec681f3Smrg#define CL_DEVICE_MAX_WORK_GROUP_SIZE_AMD               0x4031
2537ec681f3Smrg#define CL_DEVICE_PREFERRED_CONSTANT_BUFFER_SIZE_AMD    0x4033
2547ec681f3Smrg#define CL_DEVICE_PCIE_ID_AMD                           0x4034
255af69d88dSmrg
25653c12917Smaya
257af69d88dSmrg/*********************************
258af69d88dSmrg* cl_arm_printf extension
259af69d88dSmrg*********************************/
26053c12917Smaya
261af69d88dSmrg#define CL_PRINTF_CALLBACK_ARM                      0x40B0
262af69d88dSmrg#define CL_PRINTF_BUFFERSIZE_ARM                    0x40B1
263af69d88dSmrg
26453c12917Smaya
26553c12917Smaya/***********************************
26653c12917Smaya* cl_ext_device_fission extension
26753c12917Smaya***********************************/
26853c12917Smaya#define cl_ext_device_fission   1
26953c12917Smaya
27053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
27153c12917SmayaclReleaseDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
27253c12917Smaya
27353c12917Smayatypedef CL_API_ENTRY cl_int
27453c12917Smaya(CL_API_CALL *clReleaseDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
27553c12917Smaya
27653c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
27753c12917SmayaclRetainDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
27853c12917Smaya
27953c12917Smayatypedef CL_API_ENTRY cl_int
28053c12917Smaya(CL_API_CALL *clRetainDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
28153c12917Smaya
28253c12917Smayatypedef cl_ulong  cl_device_partition_property_ext;
28353c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
28453c12917SmayaclCreateSubDevicesEXT(cl_device_id   in_device,
28553c12917Smaya                      const cl_device_partition_property_ext * properties,
28653c12917Smaya                      cl_uint        num_entries,
28753c12917Smaya                      cl_device_id * out_devices,
28853c12917Smaya                      cl_uint *      num_devices) CL_EXT_SUFFIX__VERSION_1_1;
28953c12917Smaya
29053c12917Smayatypedef CL_API_ENTRY cl_int
29153c12917Smaya(CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id   in_device,
29253c12917Smaya                                         const cl_device_partition_property_ext * properties,
29353c12917Smaya                                         cl_uint        num_entries,
29453c12917Smaya                                         cl_device_id * out_devices,
29553c12917Smaya                                         cl_uint *      num_devices) CL_EXT_SUFFIX__VERSION_1_1;
29653c12917Smaya
29753c12917Smaya/* cl_device_partition_property_ext */
29853c12917Smaya#define CL_DEVICE_PARTITION_EQUALLY_EXT             0x4050
29953c12917Smaya#define CL_DEVICE_PARTITION_BY_COUNTS_EXT           0x4051
30053c12917Smaya#define CL_DEVICE_PARTITION_BY_NAMES_EXT            0x4052
30153c12917Smaya#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT  0x4053
30253c12917Smaya
30353c12917Smaya/* clDeviceGetInfo selectors */
30453c12917Smaya#define CL_DEVICE_PARENT_DEVICE_EXT                 0x4054
30553c12917Smaya#define CL_DEVICE_PARTITION_TYPES_EXT               0x4055
30653c12917Smaya#define CL_DEVICE_AFFINITY_DOMAINS_EXT              0x4056
30753c12917Smaya#define CL_DEVICE_REFERENCE_COUNT_EXT               0x4057
30853c12917Smaya#define CL_DEVICE_PARTITION_STYLE_EXT               0x4058
30953c12917Smaya
31053c12917Smaya/* error codes */
31153c12917Smaya#define CL_DEVICE_PARTITION_FAILED_EXT              -1057
31253c12917Smaya#define CL_INVALID_PARTITION_COUNT_EXT              -1058
31353c12917Smaya#define CL_INVALID_PARTITION_NAME_EXT               -1059
31453c12917Smaya
31553c12917Smaya/* CL_AFFINITY_DOMAINs */
31653c12917Smaya#define CL_AFFINITY_DOMAIN_L1_CACHE_EXT             0x1
31753c12917Smaya#define CL_AFFINITY_DOMAIN_L2_CACHE_EXT             0x2
31853c12917Smaya#define CL_AFFINITY_DOMAIN_L3_CACHE_EXT             0x3
31953c12917Smaya#define CL_AFFINITY_DOMAIN_L4_CACHE_EXT             0x4
32053c12917Smaya#define CL_AFFINITY_DOMAIN_NUMA_EXT                 0x10
32153c12917Smaya#define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT     0x100
32253c12917Smaya
32353c12917Smaya/* cl_device_partition_property_ext list terminators */
32453c12917Smaya#define CL_PROPERTIES_LIST_END_EXT                  ((cl_device_partition_property_ext) 0)
32553c12917Smaya#define CL_PARTITION_BY_COUNTS_LIST_END_EXT         ((cl_device_partition_property_ext) 0)
32653c12917Smaya#define CL_PARTITION_BY_NAMES_LIST_END_EXT          ((cl_device_partition_property_ext) 0 - 1)
32753c12917Smaya
32853c12917Smaya
32953c12917Smaya/***********************************
33053c12917Smaya * cl_ext_migrate_memobject extension definitions
33153c12917Smaya ***********************************/
33253c12917Smaya#define cl_ext_migrate_memobject 1
33353c12917Smaya
33453c12917Smayatypedef cl_bitfield cl_mem_migration_flags_ext;
33553c12917Smaya
33653c12917Smaya#define CL_MIGRATE_MEM_OBJECT_HOST_EXT              0x1
33753c12917Smaya
33853c12917Smaya#define CL_COMMAND_MIGRATE_MEM_OBJECT_EXT           0x4040
33953c12917Smaya
34053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
34153c12917SmayaclEnqueueMigrateMemObjectEXT(cl_command_queue command_queue,
34253c12917Smaya                             cl_uint          num_mem_objects,
34353c12917Smaya                             const cl_mem *   mem_objects,
34453c12917Smaya                             cl_mem_migration_flags_ext flags,
34553c12917Smaya                             cl_uint          num_events_in_wait_list,
34653c12917Smaya                             const cl_event * event_wait_list,
34753c12917Smaya                             cl_event *       event);
34853c12917Smaya
34953c12917Smayatypedef CL_API_ENTRY cl_int
35053c12917Smaya(CL_API_CALL *clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue command_queue,
35153c12917Smaya                                               cl_uint          num_mem_objects,
35253c12917Smaya                                               const cl_mem *   mem_objects,
35353c12917Smaya                                               cl_mem_migration_flags_ext flags,
35453c12917Smaya                                               cl_uint          num_events_in_wait_list,
35553c12917Smaya                                               const cl_event * event_wait_list,
35653c12917Smaya                                               cl_event *       event);
35753c12917Smaya
358af69d88dSmrg
3597ec681f3Smrg/*********************************
3607ec681f3Smrg* cl_ext_cxx_for_opencl extension
3617ec681f3Smrg*********************************/
3627ec681f3Smrg#define cl_ext_cxx_for_opencl 1
3637ec681f3Smrg
3647ec681f3Smrg#define CL_DEVICE_CXX_FOR_OPENCL_NUMERIC_VERSION_EXT 0x4230
3657ec681f3Smrg
366af69d88dSmrg/*********************************
367af69d88dSmrg* cl_qcom_ext_host_ptr extension
368af69d88dSmrg*********************************/
36953c12917Smaya#define cl_qcom_ext_host_ptr 1
370af69d88dSmrg
371af69d88dSmrg#define CL_MEM_EXT_HOST_PTR_QCOM                  (1 << 29)
372af69d88dSmrg
37353c12917Smaya#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM   0x40A0
374af69d88dSmrg#define CL_DEVICE_PAGE_SIZE_QCOM                  0x40A1
375af69d88dSmrg#define CL_IMAGE_ROW_ALIGNMENT_QCOM               0x40A2
376af69d88dSmrg#define CL_IMAGE_SLICE_ALIGNMENT_QCOM             0x40A3
377af69d88dSmrg#define CL_MEM_HOST_UNCACHED_QCOM                 0x40A4
378af69d88dSmrg#define CL_MEM_HOST_WRITEBACK_QCOM                0x40A5
379af69d88dSmrg#define CL_MEM_HOST_WRITETHROUGH_QCOM             0x40A6
380af69d88dSmrg#define CL_MEM_HOST_WRITE_COMBINING_QCOM          0x40A7
381af69d88dSmrg
382af69d88dSmrgtypedef cl_uint                                   cl_image_pitch_info_qcom;
383af69d88dSmrg
384af69d88dSmrgextern CL_API_ENTRY cl_int CL_API_CALL
385af69d88dSmrgclGetDeviceImageInfoQCOM(cl_device_id             device,
386af69d88dSmrg                         size_t                   image_width,
387af69d88dSmrg                         size_t                   image_height,
388af69d88dSmrg                         const cl_image_format   *image_format,
389af69d88dSmrg                         cl_image_pitch_info_qcom param_name,
390af69d88dSmrg                         size_t                   param_value_size,
391af69d88dSmrg                         void                    *param_value,
392af69d88dSmrg                         size_t                  *param_value_size_ret);
393af69d88dSmrg
394af69d88dSmrgtypedef struct _cl_mem_ext_host_ptr
395af69d88dSmrg{
396af69d88dSmrg    /* Type of external memory allocation. */
397af69d88dSmrg    /* Legal values will be defined in layered extensions. */
398af69d88dSmrg    cl_uint  allocation_type;
39953c12917Smaya
40053c12917Smaya    /* Host cache policy for this external memory allocation. */
401af69d88dSmrg    cl_uint  host_cache_policy;
402af69d88dSmrg
403af69d88dSmrg} cl_mem_ext_host_ptr;
404af69d88dSmrg
40553c12917Smaya
40653c12917Smaya/*******************************************
40753c12917Smaya* cl_qcom_ext_host_ptr_iocoherent extension
40853c12917Smaya********************************************/
40953c12917Smaya
41053c12917Smaya/* Cache policy specifying io-coherence */
41153c12917Smaya#define CL_MEM_HOST_IOCOHERENT_QCOM               0x40A9
41253c12917Smaya
41353c12917Smaya
414af69d88dSmrg/*********************************
415af69d88dSmrg* cl_qcom_ion_host_ptr extension
416af69d88dSmrg*********************************/
417af69d88dSmrg
418af69d88dSmrg#define CL_MEM_ION_HOST_PTR_QCOM                  0x40A8
419af69d88dSmrg
420af69d88dSmrgtypedef struct _cl_mem_ion_host_ptr
421af69d88dSmrg{
422af69d88dSmrg    /* Type of external memory allocation. */
423af69d88dSmrg    /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
424af69d88dSmrg    cl_mem_ext_host_ptr  ext_host_ptr;
425af69d88dSmrg
426af69d88dSmrg    /* ION file descriptor */
427af69d88dSmrg    int                  ion_filedesc;
42853c12917Smaya
429af69d88dSmrg    /* Host pointer to the ION allocated memory */
430af69d88dSmrg    void*                ion_hostptr;
431af69d88dSmrg
432af69d88dSmrg} cl_mem_ion_host_ptr;
433af69d88dSmrg
43453c12917Smaya
43553c12917Smaya/*********************************
43653c12917Smaya* cl_qcom_android_native_buffer_host_ptr extension
43753c12917Smaya*********************************/
43853c12917Smaya
43953c12917Smaya#define CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM                  0x40C6
44053c12917Smaya
44153c12917Smayatypedef struct _cl_mem_android_native_buffer_host_ptr
44253c12917Smaya{
44353c12917Smaya    /* Type of external memory allocation. */
44453c12917Smaya    /* Must be CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM for Android native buffers. */
44553c12917Smaya    cl_mem_ext_host_ptr  ext_host_ptr;
44653c12917Smaya
44753c12917Smaya    /* Virtual pointer to the android native buffer */
44853c12917Smaya    void*                anb_ptr;
44953c12917Smaya
45053c12917Smaya} cl_mem_android_native_buffer_host_ptr;
45153c12917Smaya
45253c12917Smaya
45353c12917Smaya/******************************************
45453c12917Smaya * cl_img_yuv_image extension *
45553c12917Smaya ******************************************/
45653c12917Smaya
45753c12917Smaya/* Image formats used in clCreateImage */
45853c12917Smaya#define CL_NV21_IMG                                 0x40D0
45953c12917Smaya#define CL_YV12_IMG                                 0x40D1
46053c12917Smaya
46153c12917Smaya
46253c12917Smaya/******************************************
46353c12917Smaya * cl_img_cached_allocations extension *
46453c12917Smaya ******************************************/
46553c12917Smaya
46653c12917Smaya/* Flag values used by clCreateBuffer */
46753c12917Smaya#define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG          (1 << 26)
46853c12917Smaya#define CL_MEM_USE_CACHED_CPU_MEMORY_IMG            (1 << 27)
46953c12917Smaya
47053c12917Smaya
47153c12917Smaya/******************************************
47253c12917Smaya * cl_img_use_gralloc_ptr extension *
47353c12917Smaya ******************************************/
47453c12917Smaya#define cl_img_use_gralloc_ptr 1
47553c12917Smaya
47653c12917Smaya/* Flag values used by clCreateBuffer */
47753c12917Smaya#define CL_MEM_USE_GRALLOC_PTR_IMG                  (1 << 28)
47853c12917Smaya
47953c12917Smaya/* To be used by clGetEventInfo: */
48053c12917Smaya#define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG      0x40D2
48153c12917Smaya#define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG      0x40D3
48253c12917Smaya
48353c12917Smaya/* Error code from clEnqueueReleaseGrallocObjectsIMG */
48453c12917Smaya#define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG        0x40D4
48553c12917Smaya
48653c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
48753c12917SmayaclEnqueueAcquireGrallocObjectsIMG(cl_command_queue      command_queue,
48853c12917Smaya                                  cl_uint               num_objects,
48953c12917Smaya                                  const cl_mem *        mem_objects,
49053c12917Smaya                                  cl_uint               num_events_in_wait_list,
49153c12917Smaya                                  const cl_event *      event_wait_list,
49253c12917Smaya                                  cl_event *            event) CL_EXT_SUFFIX__VERSION_1_2;
49353c12917Smaya
49453c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
49553c12917SmayaclEnqueueReleaseGrallocObjectsIMG(cl_command_queue      command_queue,
49653c12917Smaya                                  cl_uint               num_objects,
49753c12917Smaya                                  const cl_mem *        mem_objects,
49853c12917Smaya                                  cl_uint               num_events_in_wait_list,
49953c12917Smaya                                  const cl_event *      event_wait_list,
50053c12917Smaya                                  cl_event *            event) CL_EXT_SUFFIX__VERSION_1_2;
50153c12917Smaya
50253c12917Smaya
50353c12917Smaya/*********************************
50453c12917Smaya* cl_khr_subgroups extension
50553c12917Smaya*********************************/
50653c12917Smaya#define cl_khr_subgroups 1
50753c12917Smaya
50853c12917Smaya#if !defined(CL_VERSION_2_1)
50953c12917Smaya/* For OpenCL 2.1 and newer, cl_kernel_sub_group_info is declared in CL.h.
51053c12917Smaya   In hindsight, there should have been a khr suffix on this type for
51153c12917Smaya   the extension, but keeping it un-suffixed to maintain backwards
51253c12917Smaya   compatibility. */
51353c12917Smayatypedef cl_uint             cl_kernel_sub_group_info;
51453c12917Smaya#endif
51553c12917Smaya
51653c12917Smaya/* cl_kernel_sub_group_info */
51753c12917Smaya#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR    0x2033
51853c12917Smaya#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR       0x2034
51953c12917Smaya
52053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
52153c12917SmayaclGetKernelSubGroupInfoKHR(cl_kernel    in_kernel,
52253c12917Smaya                           cl_device_id in_device,
52353c12917Smaya                           cl_kernel_sub_group_info param_name,
52453c12917Smaya                           size_t       input_value_size,
52553c12917Smaya                           const void * input_value,
52653c12917Smaya                           size_t       param_value_size,
52753c12917Smaya                           void *       param_value,
52853c12917Smaya                           size_t *     param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
52953c12917Smaya
53053c12917Smayatypedef CL_API_ENTRY cl_int
53153c12917Smaya(CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel    in_kernel,
53253c12917Smaya                                              cl_device_id in_device,
53353c12917Smaya                                              cl_kernel_sub_group_info param_name,
53453c12917Smaya                                              size_t       input_value_size,
53553c12917Smaya                                              const void * input_value,
53653c12917Smaya                                              size_t       param_value_size,
53753c12917Smaya                                              void *       param_value,
53853c12917Smaya                                              size_t *     param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
53953c12917Smaya
54053c12917Smaya
54153c12917Smaya/*********************************
54253c12917Smaya* cl_khr_mipmap_image extension
54353c12917Smaya*********************************/
54453c12917Smaya
54553c12917Smaya/* cl_sampler_properties */
54653c12917Smaya#define CL_SAMPLER_MIP_FILTER_MODE_KHR              0x1155
54753c12917Smaya#define CL_SAMPLER_LOD_MIN_KHR                      0x1156
54853c12917Smaya#define CL_SAMPLER_LOD_MAX_KHR                      0x1157
54953c12917Smaya
55053c12917Smaya
55153c12917Smaya/*********************************
55253c12917Smaya* cl_khr_priority_hints extension
55353c12917Smaya*********************************/
55453c12917Smaya/* This extension define is for backwards compatibility.
55553c12917Smaya   It shouldn't be required since this extension has no new functions. */
55653c12917Smaya#define cl_khr_priority_hints 1
55753c12917Smaya
55853c12917Smayatypedef cl_uint  cl_queue_priority_khr;
55953c12917Smaya
56053c12917Smaya/* cl_command_queue_properties */
56153c12917Smaya#define CL_QUEUE_PRIORITY_KHR 0x1096
56253c12917Smaya
56353c12917Smaya/* cl_queue_priority_khr */
56453c12917Smaya#define CL_QUEUE_PRIORITY_HIGH_KHR (1<<0)
56553c12917Smaya#define CL_QUEUE_PRIORITY_MED_KHR (1<<1)
56653c12917Smaya#define CL_QUEUE_PRIORITY_LOW_KHR (1<<2)
56753c12917Smaya
56853c12917Smaya
56953c12917Smaya/*********************************
57053c12917Smaya* cl_khr_throttle_hints extension
57153c12917Smaya*********************************/
57253c12917Smaya/* This extension define is for backwards compatibility.
57353c12917Smaya   It shouldn't be required since this extension has no new functions. */
57453c12917Smaya#define cl_khr_throttle_hints 1
57553c12917Smaya
57653c12917Smayatypedef cl_uint  cl_queue_throttle_khr;
57753c12917Smaya
57853c12917Smaya/* cl_command_queue_properties */
57953c12917Smaya#define CL_QUEUE_THROTTLE_KHR 0x1097
58053c12917Smaya
58153c12917Smaya/* cl_queue_throttle_khr */
58253c12917Smaya#define CL_QUEUE_THROTTLE_HIGH_KHR (1<<0)
58353c12917Smaya#define CL_QUEUE_THROTTLE_MED_KHR (1<<1)
58453c12917Smaya#define CL_QUEUE_THROTTLE_LOW_KHR (1<<2)
58553c12917Smaya
58653c12917Smaya
58753c12917Smaya/*********************************
58853c12917Smaya* cl_khr_subgroup_named_barrier
58953c12917Smaya*********************************/
59053c12917Smaya/* This extension define is for backwards compatibility.
59153c12917Smaya   It shouldn't be required since this extension has no new functions. */
59253c12917Smaya#define cl_khr_subgroup_named_barrier 1
59353c12917Smaya
59453c12917Smaya/* cl_device_info */
59553c12917Smaya#define CL_DEVICE_MAX_NAMED_BARRIER_COUNT_KHR       0x2035
59653c12917Smaya
59753c12917Smaya
5987ec681f3Smrg/*********************************
5997ec681f3Smrg* cl_khr_extended_versioning
6007ec681f3Smrg*********************************/
6017ec681f3Smrg
6027ec681f3Smrg#define cl_khr_extended_versioning 1
6037ec681f3Smrg
6047ec681f3Smrg#define CL_VERSION_MAJOR_BITS_KHR (10)
6057ec681f3Smrg#define CL_VERSION_MINOR_BITS_KHR (10)
6067ec681f3Smrg#define CL_VERSION_PATCH_BITS_KHR (12)
6077ec681f3Smrg
6087ec681f3Smrg#define CL_VERSION_MAJOR_MASK_KHR ((1 << CL_VERSION_MAJOR_BITS_KHR) - 1)
6097ec681f3Smrg#define CL_VERSION_MINOR_MASK_KHR ((1 << CL_VERSION_MINOR_BITS_KHR) - 1)
6107ec681f3Smrg#define CL_VERSION_PATCH_MASK_KHR ((1 << CL_VERSION_PATCH_BITS_KHR) - 1)
6117ec681f3Smrg
6127ec681f3Smrg#define CL_VERSION_MAJOR_KHR(version) ((version) >> (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR))
6137ec681f3Smrg#define CL_VERSION_MINOR_KHR(version) (((version) >> CL_VERSION_PATCH_BITS_KHR) & CL_VERSION_MINOR_MASK_KHR)
6147ec681f3Smrg#define CL_VERSION_PATCH_KHR(version) ((version) & CL_VERSION_PATCH_MASK_KHR)
6157ec681f3Smrg
6167ec681f3Smrg#define CL_MAKE_VERSION_KHR(major, minor, patch) \
6177ec681f3Smrg    ((((major) & CL_VERSION_MAJOR_MASK_KHR) << (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR)) | \
6187ec681f3Smrg    (((minor) &  CL_VERSION_MINOR_MASK_KHR) << CL_VERSION_PATCH_BITS_KHR) | \
6197ec681f3Smrg    ((patch) & CL_VERSION_PATCH_MASK_KHR))
6207ec681f3Smrg
6217ec681f3Smrgtypedef cl_uint cl_version_khr;
6227ec681f3Smrg
6237ec681f3Smrg#define CL_NAME_VERSION_MAX_NAME_SIZE_KHR 64
6247ec681f3Smrg
6257ec681f3Smrgtypedef struct _cl_name_version_khr
6267ec681f3Smrg{
6277ec681f3Smrg    cl_version_khr version;
6287ec681f3Smrg    char name[CL_NAME_VERSION_MAX_NAME_SIZE_KHR];
6297ec681f3Smrg} cl_name_version_khr;
6307ec681f3Smrg
6317ec681f3Smrg/* cl_platform_info */
6327ec681f3Smrg#define CL_PLATFORM_NUMERIC_VERSION_KHR                  0x0906
6337ec681f3Smrg#define CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR          0x0907
6347ec681f3Smrg
6357ec681f3Smrg/* cl_device_info */
6367ec681f3Smrg#define CL_DEVICE_NUMERIC_VERSION_KHR                    0x105E
6377ec681f3Smrg#define CL_DEVICE_OPENCL_C_NUMERIC_VERSION_KHR           0x105F
6387ec681f3Smrg#define CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR            0x1060
6397ec681f3Smrg#define CL_DEVICE_ILS_WITH_VERSION_KHR                   0x1061
6407ec681f3Smrg#define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR      0x1062
6417ec681f3Smrg
6427ec681f3Smrg
6437ec681f3Smrg/*********************************
6447ec681f3Smrg* cl_khr_device_uuid extension
6457ec681f3Smrg*********************************/
6467ec681f3Smrg#define cl_khr_device_uuid 1
6477ec681f3Smrg
6487ec681f3Smrg#define CL_UUID_SIZE_KHR 16
6497ec681f3Smrg#define CL_LUID_SIZE_KHR 8
6507ec681f3Smrg
6517ec681f3Smrg#define CL_DEVICE_UUID_KHR          0x106A
6527ec681f3Smrg#define CL_DRIVER_UUID_KHR          0x106B
6537ec681f3Smrg#define CL_DEVICE_LUID_VALID_KHR    0x106C
6547ec681f3Smrg#define CL_DEVICE_LUID_KHR          0x106D
6557ec681f3Smrg#define CL_DEVICE_NODE_MASK_KHR     0x106E
6567ec681f3Smrg
6577ec681f3Smrg
65853c12917Smaya/**********************************
65953c12917Smaya * cl_arm_import_memory extension *
66053c12917Smaya **********************************/
66153c12917Smaya#define cl_arm_import_memory 1
66253c12917Smaya
66353c12917Smayatypedef intptr_t cl_import_properties_arm;
66453c12917Smaya
66553c12917Smaya/* Default and valid proporties name for cl_arm_import_memory */
66653c12917Smaya#define CL_IMPORT_TYPE_ARM                        0x40B2
66753c12917Smaya
66853c12917Smaya/* Host process memory type default value for CL_IMPORT_TYPE_ARM property */
66953c12917Smaya#define CL_IMPORT_TYPE_HOST_ARM                   0x40B3
67053c12917Smaya
67153c12917Smaya/* DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
67253c12917Smaya#define CL_IMPORT_TYPE_DMA_BUF_ARM                0x40B4
67353c12917Smaya
6747ec681f3Smrg/* Protected memory property */
67553c12917Smaya#define CL_IMPORT_TYPE_PROTECTED_ARM              0x40B5
67653c12917Smaya
6777ec681f3Smrg/* Android hardware buffer type value for CL_IMPORT_TYPE_ARM property */
6787ec681f3Smrg#define CL_IMPORT_TYPE_ANDROID_HARDWARE_BUFFER_ARM 0x41E2
6797ec681f3Smrg
6807ec681f3Smrg/* Data consistency with host property */
6817ec681f3Smrg#define CL_IMPORT_DMA_BUF_DATA_CONSISTENCY_WITH_HOST_ARM 0x41E3
6827ec681f3Smrg
6837ec681f3Smrg/* Import memory size value to indicate a size for the whole buffer */
6847ec681f3Smrg#define CL_IMPORT_MEMORY_WHOLE_ALLOCATION_ARM SIZE_MAX
6857ec681f3Smrg
68653c12917Smaya/* This extension adds a new function that allows for direct memory import into
68753c12917Smaya * OpenCL via the clImportMemoryARM function.
68853c12917Smaya *
68953c12917Smaya * Memory imported through this interface will be mapped into the device's page
69053c12917Smaya * tables directly, providing zero copy access. It will never fall back to copy
69153c12917Smaya * operations and aliased buffers.
69253c12917Smaya *
69353c12917Smaya * Types of memory supported for import are specified as additional extension
69453c12917Smaya * strings.
69553c12917Smaya *
69653c12917Smaya * This extension produces cl_mem allocations which are compatible with all other
69753c12917Smaya * users of cl_mem in the standard API.
69853c12917Smaya *
69953c12917Smaya * This extension maps pages with the same properties as the normal buffer creation
70053c12917Smaya * function clCreateBuffer.
70153c12917Smaya */
70253c12917Smayaextern CL_API_ENTRY cl_mem CL_API_CALL
70353c12917SmayaclImportMemoryARM( cl_context context,
70453c12917Smaya                   cl_mem_flags flags,
70553c12917Smaya                   const cl_import_properties_arm *properties,
70653c12917Smaya                   void *memory,
70753c12917Smaya                   size_t size,
70853c12917Smaya                   cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
70953c12917Smaya
71053c12917Smaya
71153c12917Smaya/******************************************
71253c12917Smaya * cl_arm_shared_virtual_memory extension *
71353c12917Smaya ******************************************/
71453c12917Smaya#define cl_arm_shared_virtual_memory 1
71553c12917Smaya
71653c12917Smaya/* Used by clGetDeviceInfo */
71753c12917Smaya#define CL_DEVICE_SVM_CAPABILITIES_ARM                  0x40B6
71853c12917Smaya
71953c12917Smaya/* Used by clGetMemObjectInfo */
72053c12917Smaya#define CL_MEM_USES_SVM_POINTER_ARM                     0x40B7
72153c12917Smaya
72253c12917Smaya/* Used by clSetKernelExecInfoARM: */
72353c12917Smaya#define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM                0x40B8
72453c12917Smaya#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM   0x40B9
72553c12917Smaya
72653c12917Smaya/* To be used by clGetEventInfo: */
72753c12917Smaya#define CL_COMMAND_SVM_FREE_ARM                         0x40BA
72853c12917Smaya#define CL_COMMAND_SVM_MEMCPY_ARM                       0x40BB
72953c12917Smaya#define CL_COMMAND_SVM_MEMFILL_ARM                      0x40BC
73053c12917Smaya#define CL_COMMAND_SVM_MAP_ARM                          0x40BD
73153c12917Smaya#define CL_COMMAND_SVM_UNMAP_ARM                        0x40BE
73253c12917Smaya
73353c12917Smaya/* Flag values returned by clGetDeviceInfo with CL_DEVICE_SVM_CAPABILITIES_ARM as the param_name. */
73453c12917Smaya#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM           (1 << 0)
73553c12917Smaya#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM             (1 << 1)
73653c12917Smaya#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM             (1 << 2)
73753c12917Smaya#define CL_DEVICE_SVM_ATOMICS_ARM                       (1 << 3)
73853c12917Smaya
73953c12917Smaya/* Flag values used by clSVMAllocARM: */
74053c12917Smaya#define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM                (1 << 10)
74153c12917Smaya#define CL_MEM_SVM_ATOMICS_ARM                          (1 << 11)
74253c12917Smaya
74353c12917Smayatypedef cl_bitfield cl_svm_mem_flags_arm;
74453c12917Smayatypedef cl_uint     cl_kernel_exec_info_arm;
74553c12917Smayatypedef cl_bitfield cl_device_svm_capabilities_arm;
74653c12917Smaya
74753c12917Smayaextern CL_API_ENTRY void * CL_API_CALL
74853c12917SmayaclSVMAllocARM(cl_context       context,
74953c12917Smaya              cl_svm_mem_flags_arm flags,
75053c12917Smaya              size_t           size,
75153c12917Smaya              cl_uint          alignment) CL_EXT_SUFFIX__VERSION_1_2;
75253c12917Smaya
75353c12917Smayaextern CL_API_ENTRY void CL_API_CALL
75453c12917SmayaclSVMFreeARM(cl_context        context,
75553c12917Smaya             void *            svm_pointer) CL_EXT_SUFFIX__VERSION_1_2;
75653c12917Smaya
75753c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
75853c12917SmayaclEnqueueSVMFreeARM(cl_command_queue  command_queue,
75953c12917Smaya                    cl_uint           num_svm_pointers,
76053c12917Smaya                    void *            svm_pointers[],
76153c12917Smaya                    void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue,
76253c12917Smaya                                                       cl_uint          num_svm_pointers,
76353c12917Smaya                                                       void *           svm_pointers[],
76453c12917Smaya                                                       void *           user_data),
76553c12917Smaya                    void *            user_data,
76653c12917Smaya                    cl_uint           num_events_in_wait_list,
76753c12917Smaya                    const cl_event *  event_wait_list,
76853c12917Smaya                    cl_event *        event) CL_EXT_SUFFIX__VERSION_1_2;
76953c12917Smaya
77053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
77153c12917SmayaclEnqueueSVMMemcpyARM(cl_command_queue  command_queue,
77253c12917Smaya                      cl_bool           blocking_copy,
77353c12917Smaya                      void *            dst_ptr,
77453c12917Smaya                      const void *      src_ptr,
77553c12917Smaya                      size_t            size,
77653c12917Smaya                      cl_uint           num_events_in_wait_list,
77753c12917Smaya                      const cl_event *  event_wait_list,
77853c12917Smaya                      cl_event *        event) CL_EXT_SUFFIX__VERSION_1_2;
77953c12917Smaya
78053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
78153c12917SmayaclEnqueueSVMMemFillARM(cl_command_queue  command_queue,
78253c12917Smaya                       void *            svm_ptr,
78353c12917Smaya                       const void *      pattern,
78453c12917Smaya                       size_t            pattern_size,
78553c12917Smaya                       size_t            size,
78653c12917Smaya                       cl_uint           num_events_in_wait_list,
78753c12917Smaya                       const cl_event *  event_wait_list,
78853c12917Smaya                       cl_event *        event) CL_EXT_SUFFIX__VERSION_1_2;
78953c12917Smaya
79053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
79153c12917SmayaclEnqueueSVMMapARM(cl_command_queue  command_queue,
79253c12917Smaya                   cl_bool           blocking_map,
79353c12917Smaya                   cl_map_flags      flags,
79453c12917Smaya                   void *            svm_ptr,
79553c12917Smaya                   size_t            size,
79653c12917Smaya                   cl_uint           num_events_in_wait_list,
79753c12917Smaya                   const cl_event *  event_wait_list,
79853c12917Smaya                   cl_event *        event) CL_EXT_SUFFIX__VERSION_1_2;
79953c12917Smaya
80053c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
80153c12917SmayaclEnqueueSVMUnmapARM(cl_command_queue  command_queue,
80253c12917Smaya                     void *            svm_ptr,
80353c12917Smaya                     cl_uint           num_events_in_wait_list,
80453c12917Smaya                     const cl_event *  event_wait_list,
80553c12917Smaya                     cl_event *        event) CL_EXT_SUFFIX__VERSION_1_2;
80653c12917Smaya
80753c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
80853c12917SmayaclSetKernelArgSVMPointerARM(cl_kernel    kernel,
80953c12917Smaya                            cl_uint      arg_index,
81053c12917Smaya                            const void * arg_value) CL_EXT_SUFFIX__VERSION_1_2;
81153c12917Smaya
81253c12917Smayaextern CL_API_ENTRY cl_int CL_API_CALL
81353c12917SmayaclSetKernelExecInfoARM(cl_kernel            kernel,
81453c12917Smaya                       cl_kernel_exec_info_arm  param_name,
81553c12917Smaya                       size_t               param_value_size,
81653c12917Smaya                       const void *         param_value) CL_EXT_SUFFIX__VERSION_1_2;
81753c12917Smaya
81853c12917Smaya/********************************
81953c12917Smaya * cl_arm_get_core_id extension *
82053c12917Smaya ********************************/
82153c12917Smaya
82253c12917Smaya#ifdef CL_VERSION_1_2
82353c12917Smaya
82453c12917Smaya#define cl_arm_get_core_id 1
82553c12917Smaya
82653c12917Smaya/* Device info property for bitfield of cores present */
82753c12917Smaya#define CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM      0x40BF
82853c12917Smaya
82953c12917Smaya#endif  /* CL_VERSION_1_2 */
830af69d88dSmrg
8317ec681f3Smrg/*********************************
8327ec681f3Smrg* cl_arm_job_slot_selection
8337ec681f3Smrg*********************************/
8347ec681f3Smrg
8357ec681f3Smrg#define cl_arm_job_slot_selection 1
8367ec681f3Smrg
8377ec681f3Smrg/* cl_device_info */
8387ec681f3Smrg#define CL_DEVICE_JOB_SLOTS_ARM                   0x41E0
8397ec681f3Smrg
8407ec681f3Smrg/* cl_command_queue_properties */
8417ec681f3Smrg#define CL_QUEUE_JOB_SLOT_ARM                     0x41E1
8427ec681f3Smrg
8437ec681f3Smrg/*********************************
8447ec681f3Smrg* cl_arm_scheduling_controls
8457ec681f3Smrg*********************************/
8467ec681f3Smrg
8477ec681f3Smrg#define cl_arm_scheduling_controls 1
8487ec681f3Smrg
8497ec681f3Smrg/* cl_device_info */
8507ec681f3Smrg#define CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM          0x41E4
8517ec681f3Smrg
8527ec681f3Smrg#define CL_DEVICE_SCHEDULING_KERNEL_BATCHING_ARM               (1 << 0)
8537ec681f3Smrg#define CL_DEVICE_SCHEDULING_WORKGROUP_BATCH_SIZE_ARM          (1 << 1)
8547ec681f3Smrg#define CL_DEVICE_SCHEDULING_WORKGROUP_BATCH_SIZE_MODIFIER_ARM (1 << 2)
8557ec681f3Smrg
8567ec681f3Smrg/* cl_kernel_info */
8577ec681f3Smrg#define CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM            0x41E5
8587ec681f3Smrg#define CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM   0x41E6
8597ec681f3Smrg
8607ec681f3Smrg/* cl_queue_properties */
8617ec681f3Smrg#define CL_QUEUE_KERNEL_BATCHING_ARM                            0x41E7
8627ec681f3Smrg
863af69d88dSmrg#ifdef __cplusplus
864af69d88dSmrg}
865af69d88dSmrg#endif
866af69d88dSmrg
867af69d88dSmrg
868af69d88dSmrg#endif /* __CL_EXT_H */
869