Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2008-2019 The Khronos Group Inc. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 | * |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 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 | * |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 39 | #include <CL/cl.h> |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 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 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 | * |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 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 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 69 | cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem memobj, |
| 70 | void (* pfn_notify)(cl_mem memobj, void * user_data), |
| 71 | void * user_data) CL_EXT_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 | * |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 80 | * clLogMessagesToSystemLog forwards on all log messages to the Apple System Logger |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 81 | */ |
| 82 | #define cl_APPLE_ContextLoggingFunctions 1 |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 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; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 87 | |
| 88 | /* clLogMessagesToStdout sends all log messages to the file descriptor stdout */ |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 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; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 93 | |
| 94 | /* clLogMessagesToStderr sends all log messages to the file descriptor stderr */ |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 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; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 99 | |
| 100 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 101 | /************************ |
| 102 | * cl_khr_icd extension * |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 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 |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 113 | clIcdGetPlatformIDsKHR(cl_uint num_entries, |
| 114 | cl_platform_id * platforms, |
| 115 | cl_uint * num_platforms); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 116 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 117 | typedef CL_API_ENTRY cl_int |
| 118 | (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(cl_uint num_entries, |
| 119 | cl_platform_id * platforms, |
| 120 | cl_uint * num_platforms); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 121 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 122 | |
| 123 | /******************************* |
| 124 | * cl_khr_il_program extension * |
| 125 | *******************************/ |
| 126 | #define cl_khr_il_program 1 |
| 127 | |
| 128 | /* New property to clGetDeviceInfo for retrieving supported intermediate |
| 129 | * languages |
| 130 | */ |
| 131 | #define CL_DEVICE_IL_VERSION_KHR 0x105B |
| 132 | |
| 133 | /* New property to clGetProgramInfo for retrieving for retrieving the IL of a |
| 134 | * program |
| 135 | */ |
| 136 | #define CL_PROGRAM_IL_KHR 0x1169 |
| 137 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 138 | extern CL_API_ENTRY cl_program CL_API_CALL |
| 139 | clCreateProgramWithILKHR(cl_context context, |
| 140 | const void * il, |
| 141 | size_t length, |
| 142 | cl_int * errcode_ret); |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 143 | |
| 144 | typedef CL_API_ENTRY cl_program |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 145 | (CL_API_CALL *clCreateProgramWithILKHR_fn)(cl_context context, |
| 146 | const void * il, |
| 147 | size_t length, |
| 148 | cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 149 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 150 | /* Extension: cl_khr_image2d_from_buffer |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 151 | * |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 152 | * This extension allows a 2D image to be created from a cl_mem buffer without |
| 153 | * a copy. The type associated with a 2D image created from a buffer in an |
| 154 | * OpenCL program is image2d_t. Both the sampler and sampler-less read_image |
| 155 | * built-in functions are supported for 2D images and 2D images created from |
| 156 | * a buffer. Similarly, the write_image built-ins are also supported for 2D |
| 157 | * images created from a buffer. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 158 | * |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 159 | * When the 2D image from buffer is created, the client must specify the |
| 160 | * width, height, image format (i.e. channel order and channel data type) |
| 161 | * and optionally the row pitch. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 162 | * |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 163 | * The pitch specified must be a multiple of |
| 164 | * CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR pixels. |
| 165 | * The base address of the buffer must be aligned to |
| 166 | * CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR pixels. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 167 | */ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 168 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 169 | #define CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR 0x104A |
| 170 | #define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR 0x104B |
| 171 | |
| 172 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 173 | /************************************** |
| 174 | * cl_khr_initialize_memory extension * |
| 175 | **************************************/ |
| 176 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 177 | #define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x2030 |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 178 | |
| 179 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 180 | /************************************** |
| 181 | * cl_khr_terminate_context extension * |
| 182 | **************************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 183 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 184 | #define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x2031 |
| 185 | #define CL_CONTEXT_TERMINATE_KHR 0x2032 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 186 | |
| 187 | #define cl_khr_terminate_context 1 |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 188 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 189 | clTerminateContextKHR(cl_context context) CL_EXT_SUFFIX__VERSION_1_2; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 190 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 191 | typedef CL_API_ENTRY cl_int |
| 192 | (CL_API_CALL *clTerminateContextKHR_fn)(cl_context context) CL_EXT_SUFFIX__VERSION_1_2; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 193 | |
| 194 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 195 | /* |
| 196 | * Extension: cl_khr_spir |
| 197 | * |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 198 | * This extension adds support to create an OpenCL program object from a |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 199 | * Standard Portable Intermediate Representation (SPIR) instance |
| 200 | */ |
| 201 | |
| 202 | #define CL_DEVICE_SPIR_VERSIONS 0x40E0 |
| 203 | #define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1 |
| 204 | |
| 205 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 206 | /***************************************** |
| 207 | * cl_khr_create_command_queue extension * |
| 208 | *****************************************/ |
| 209 | #define cl_khr_create_command_queue 1 |
| 210 | |
| 211 | typedef cl_bitfield cl_queue_properties_khr; |
| 212 | |
| 213 | extern CL_API_ENTRY cl_command_queue CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 214 | clCreateCommandQueueWithPropertiesKHR(cl_context context, |
| 215 | cl_device_id device, |
| 216 | const cl_queue_properties_khr* properties, |
| 217 | cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2; |
| 218 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 219 | typedef CL_API_ENTRY cl_command_queue |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 220 | (CL_API_CALL *clCreateCommandQueueWithPropertiesKHR_fn)(cl_context context, |
| 221 | cl_device_id device, |
| 222 | const cl_queue_properties_khr* properties, |
| 223 | cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 224 | |
| 225 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 226 | /****************************************** |
| 227 | * cl_nv_device_attribute_query extension * |
| 228 | ******************************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 229 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 230 | /* cl_nv_device_attribute_query extension - no extension #define since it has no functions */ |
| 231 | #define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 |
| 232 | #define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 |
| 233 | #define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002 |
| 234 | #define CL_DEVICE_WARP_SIZE_NV 0x4003 |
| 235 | #define CL_DEVICE_GPU_OVERLAP_NV 0x4004 |
| 236 | #define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 |
| 237 | #define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 |
| 238 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 239 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 240 | /********************************* |
| 241 | * cl_amd_device_attribute_query * |
| 242 | *********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 243 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 244 | #define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036 |
| 245 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 246 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 247 | /********************************* |
| 248 | * cl_arm_printf extension |
| 249 | *********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 250 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 251 | #define CL_PRINTF_CALLBACK_ARM 0x40B0 |
| 252 | #define CL_PRINTF_BUFFERSIZE_ARM 0x40B1 |
| 253 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 254 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 255 | /*********************************** |
| 256 | * cl_ext_device_fission extension |
| 257 | ***********************************/ |
| 258 | #define cl_ext_device_fission 1 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 259 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 260 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 261 | clReleaseDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 262 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 263 | typedef CL_API_ENTRY cl_int |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 264 | (CL_API_CALL *clReleaseDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 265 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 266 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 267 | clRetainDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 268 | |
| 269 | typedef CL_API_ENTRY cl_int |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 270 | (CL_API_CALL *clRetainDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 271 | |
| 272 | typedef cl_ulong cl_device_partition_property_ext; |
| 273 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 274 | clCreateSubDevicesEXT(cl_device_id in_device, |
| 275 | const cl_device_partition_property_ext * properties, |
| 276 | cl_uint num_entries, |
| 277 | cl_device_id * out_devices, |
| 278 | cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 279 | |
| 280 | typedef CL_API_ENTRY cl_int |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 281 | (CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id in_device, |
| 282 | const cl_device_partition_property_ext * properties, |
| 283 | cl_uint num_entries, |
| 284 | cl_device_id * out_devices, |
| 285 | cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 286 | |
| 287 | /* cl_device_partition_property_ext */ |
| 288 | #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050 |
| 289 | #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051 |
| 290 | #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052 |
| 291 | #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053 |
| 292 | |
| 293 | /* clDeviceGetInfo selectors */ |
| 294 | #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054 |
| 295 | #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055 |
| 296 | #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056 |
| 297 | #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057 |
| 298 | #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058 |
| 299 | |
| 300 | /* error codes */ |
| 301 | #define CL_DEVICE_PARTITION_FAILED_EXT -1057 |
| 302 | #define CL_INVALID_PARTITION_COUNT_EXT -1058 |
| 303 | #define CL_INVALID_PARTITION_NAME_EXT -1059 |
| 304 | |
| 305 | /* CL_AFFINITY_DOMAINs */ |
| 306 | #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1 |
| 307 | #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2 |
| 308 | #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3 |
| 309 | #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4 |
| 310 | #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10 |
| 311 | #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100 |
| 312 | |
| 313 | /* cl_device_partition_property_ext list terminators */ |
| 314 | #define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0) |
| 315 | #define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0) |
| 316 | #define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1) |
| 317 | |
| 318 | |
| 319 | /*********************************** |
| 320 | * cl_ext_migrate_memobject extension definitions |
| 321 | ***********************************/ |
| 322 | #define cl_ext_migrate_memobject 1 |
| 323 | |
| 324 | typedef cl_bitfield cl_mem_migration_flags_ext; |
| 325 | |
| 326 | #define CL_MIGRATE_MEM_OBJECT_HOST_EXT 0x1 |
| 327 | |
| 328 | #define CL_COMMAND_MIGRATE_MEM_OBJECT_EXT 0x4040 |
| 329 | |
| 330 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 331 | clEnqueueMigrateMemObjectEXT(cl_command_queue command_queue, |
| 332 | cl_uint num_mem_objects, |
| 333 | const cl_mem * mem_objects, |
| 334 | cl_mem_migration_flags_ext flags, |
| 335 | cl_uint num_events_in_wait_list, |
| 336 | const cl_event * event_wait_list, |
| 337 | cl_event * event); |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 338 | |
| 339 | typedef CL_API_ENTRY cl_int |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 340 | (CL_API_CALL *clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue command_queue, |
| 341 | cl_uint num_mem_objects, |
| 342 | const cl_mem * mem_objects, |
| 343 | cl_mem_migration_flags_ext flags, |
| 344 | cl_uint num_events_in_wait_list, |
| 345 | const cl_event * event_wait_list, |
| 346 | cl_event * event); |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 347 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 348 | |
| 349 | /********************************* |
| 350 | * cl_qcom_ext_host_ptr extension |
| 351 | *********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 352 | #define cl_qcom_ext_host_ptr 1 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 353 | |
| 354 | #define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29) |
| 355 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 356 | #define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 357 | #define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1 |
| 358 | #define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2 |
| 359 | #define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3 |
| 360 | #define CL_MEM_HOST_UNCACHED_QCOM 0x40A4 |
| 361 | #define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5 |
| 362 | #define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6 |
| 363 | #define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7 |
| 364 | |
| 365 | typedef cl_uint cl_image_pitch_info_qcom; |
| 366 | |
| 367 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 368 | clGetDeviceImageInfoQCOM(cl_device_id device, |
| 369 | size_t image_width, |
| 370 | size_t image_height, |
| 371 | const cl_image_format *image_format, |
| 372 | cl_image_pitch_info_qcom param_name, |
| 373 | size_t param_value_size, |
| 374 | void *param_value, |
| 375 | size_t *param_value_size_ret); |
| 376 | |
| 377 | typedef struct _cl_mem_ext_host_ptr |
| 378 | { |
| 379 | /* Type of external memory allocation. */ |
| 380 | /* Legal values will be defined in layered extensions. */ |
| 381 | cl_uint allocation_type; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 382 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 383 | /* Host cache policy for this external memory allocation. */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 384 | cl_uint host_cache_policy; |
| 385 | |
| 386 | } cl_mem_ext_host_ptr; |
| 387 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 388 | |
| 389 | /******************************************* |
| 390 | * cl_qcom_ext_host_ptr_iocoherent extension |
| 391 | ********************************************/ |
| 392 | |
| 393 | /* Cache policy specifying io-coherence */ |
| 394 | #define CL_MEM_HOST_IOCOHERENT_QCOM 0x40A9 |
| 395 | |
| 396 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 397 | /********************************* |
| 398 | * cl_qcom_ion_host_ptr extension |
| 399 | *********************************/ |
| 400 | |
| 401 | #define CL_MEM_ION_HOST_PTR_QCOM 0x40A8 |
| 402 | |
| 403 | typedef struct _cl_mem_ion_host_ptr |
| 404 | { |
| 405 | /* Type of external memory allocation. */ |
| 406 | /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */ |
| 407 | cl_mem_ext_host_ptr ext_host_ptr; |
| 408 | |
| 409 | /* ION file descriptor */ |
| 410 | int ion_filedesc; |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 411 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 412 | /* Host pointer to the ION allocated memory */ |
| 413 | void* ion_hostptr; |
| 414 | |
| 415 | } cl_mem_ion_host_ptr; |
| 416 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 417 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 418 | /********************************* |
| 419 | * cl_qcom_android_native_buffer_host_ptr extension |
| 420 | *********************************/ |
| 421 | |
| 422 | #define CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM 0x40C6 |
| 423 | |
| 424 | typedef struct _cl_mem_android_native_buffer_host_ptr |
| 425 | { |
| 426 | /* Type of external memory allocation. */ |
| 427 | /* Must be CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM for Android native buffers. */ |
| 428 | cl_mem_ext_host_ptr ext_host_ptr; |
| 429 | |
| 430 | /* Virtual pointer to the android native buffer */ |
| 431 | void* anb_ptr; |
| 432 | |
| 433 | } cl_mem_android_native_buffer_host_ptr; |
| 434 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 435 | |
| 436 | /****************************************** |
| 437 | * cl_img_yuv_image extension * |
| 438 | ******************************************/ |
| 439 | |
| 440 | /* Image formats used in clCreateImage */ |
| 441 | #define CL_NV21_IMG 0x40D0 |
| 442 | #define CL_YV12_IMG 0x40D1 |
| 443 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 444 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 445 | /****************************************** |
| 446 | * cl_img_cached_allocations extension * |
| 447 | ******************************************/ |
| 448 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 449 | /* Flag values used by clCreateBuffer */ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 450 | #define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG (1 << 26) |
| 451 | #define CL_MEM_USE_CACHED_CPU_MEMORY_IMG (1 << 27) |
| 452 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 453 | |
| 454 | /****************************************** |
| 455 | * cl_img_use_gralloc_ptr extension * |
| 456 | ******************************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 457 | #define cl_img_use_gralloc_ptr 1 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 458 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 459 | /* Flag values used by clCreateBuffer */ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 460 | #define CL_MEM_USE_GRALLOC_PTR_IMG (1 << 28) |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 461 | |
| 462 | /* To be used by clGetEventInfo: */ |
| 463 | #define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG 0x40D2 |
| 464 | #define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG 0x40D3 |
| 465 | |
| 466 | /* Error code from clEnqueueReleaseGrallocObjectsIMG */ |
| 467 | #define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG 0x40D4 |
| 468 | |
| 469 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 470 | clEnqueueAcquireGrallocObjectsIMG(cl_command_queue command_queue, |
| 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; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 476 | |
| 477 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 478 | clEnqueueReleaseGrallocObjectsIMG(cl_command_queue command_queue, |
| 479 | cl_uint num_objects, |
| 480 | const cl_mem * mem_objects, |
| 481 | cl_uint num_events_in_wait_list, |
| 482 | const cl_event * event_wait_list, |
| 483 | cl_event * event) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 484 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 485 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 486 | /********************************* |
| 487 | * cl_khr_subgroups extension |
| 488 | *********************************/ |
| 489 | #define cl_khr_subgroups 1 |
| 490 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 491 | #if !defined(CL_VERSION_2_1) |
| 492 | /* For OpenCL 2.1 and newer, cl_kernel_sub_group_info is declared in CL.h. |
| 493 | In hindsight, there should have been a khr suffix on this type for |
| 494 | the extension, but keeping it un-suffixed to maintain backwards |
| 495 | compatibility. */ |
| 496 | typedef cl_uint cl_kernel_sub_group_info; |
| 497 | #endif |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 498 | |
| 499 | /* cl_kernel_sub_group_info */ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 500 | #define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033 |
| 501 | #define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 502 | |
| 503 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 504 | clGetKernelSubGroupInfoKHR(cl_kernel in_kernel, |
| 505 | cl_device_id in_device, |
| 506 | cl_kernel_sub_group_info param_name, |
| 507 | size_t input_value_size, |
| 508 | const void * input_value, |
| 509 | size_t param_value_size, |
| 510 | void * param_value, |
| 511 | size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 512 | |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 513 | typedef CL_API_ENTRY cl_int |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 514 | (CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel in_kernel, |
| 515 | cl_device_id in_device, |
| 516 | cl_kernel_sub_group_info param_name, |
| 517 | size_t input_value_size, |
| 518 | const void * input_value, |
| 519 | size_t param_value_size, |
| 520 | void * param_value, |
| 521 | size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED; |
| 522 | |
| 523 | |
| 524 | /********************************* |
| 525 | * cl_khr_mipmap_image extension |
| 526 | *********************************/ |
| 527 | |
| 528 | /* cl_sampler_properties */ |
| 529 | #define CL_SAMPLER_MIP_FILTER_MODE_KHR 0x1155 |
| 530 | #define CL_SAMPLER_LOD_MIN_KHR 0x1156 |
| 531 | #define CL_SAMPLER_LOD_MAX_KHR 0x1157 |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 532 | |
| 533 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 534 | /********************************* |
| 535 | * cl_khr_priority_hints extension |
| 536 | *********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 537 | /* This extension define is for backwards compatibility. |
| 538 | It shouldn't be required since this extension has no new functions. */ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 539 | #define cl_khr_priority_hints 1 |
| 540 | |
| 541 | typedef cl_uint cl_queue_priority_khr; |
| 542 | |
| 543 | /* cl_command_queue_properties */ |
| 544 | #define CL_QUEUE_PRIORITY_KHR 0x1096 |
| 545 | |
| 546 | /* cl_queue_priority_khr */ |
| 547 | #define CL_QUEUE_PRIORITY_HIGH_KHR (1<<0) |
| 548 | #define CL_QUEUE_PRIORITY_MED_KHR (1<<1) |
| 549 | #define CL_QUEUE_PRIORITY_LOW_KHR (1<<2) |
| 550 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 551 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 552 | /********************************* |
| 553 | * cl_khr_throttle_hints extension |
| 554 | *********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 555 | /* This extension define is for backwards compatibility. |
| 556 | It shouldn't be required since this extension has no new functions. */ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 557 | #define cl_khr_throttle_hints 1 |
| 558 | |
| 559 | typedef cl_uint cl_queue_throttle_khr; |
| 560 | |
| 561 | /* cl_command_queue_properties */ |
| 562 | #define CL_QUEUE_THROTTLE_KHR 0x1097 |
| 563 | |
| 564 | /* cl_queue_throttle_khr */ |
| 565 | #define CL_QUEUE_THROTTLE_HIGH_KHR (1<<0) |
| 566 | #define CL_QUEUE_THROTTLE_MED_KHR (1<<1) |
| 567 | #define CL_QUEUE_THROTTLE_LOW_KHR (1<<2) |
| 568 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 569 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 570 | /********************************* |
| 571 | * cl_khr_subgroup_named_barrier |
| 572 | *********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 573 | /* This extension define is for backwards compatibility. |
| 574 | It shouldn't be required since this extension has no new functions. */ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 575 | #define cl_khr_subgroup_named_barrier 1 |
| 576 | |
| 577 | /* cl_device_info */ |
| 578 | #define CL_DEVICE_MAX_NAMED_BARRIER_COUNT_KHR 0x2035 |
| 579 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 580 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 581 | /********************************* |
| 582 | * cl_khr_extended_versioning |
| 583 | *********************************/ |
| 584 | |
| 585 | #define CL_VERSION_MAJOR_BITS_KHR (10) |
| 586 | #define CL_VERSION_MINOR_BITS_KHR (10) |
| 587 | #define CL_VERSION_PATCH_BITS_KHR (12) |
| 588 | |
| 589 | #define CL_VERSION_MAJOR_MASK_KHR ((1 << CL_VERSION_MAJOR_BITS_KHR) - 1) |
| 590 | #define CL_VERSION_MINOR_MASK_KHR ((1 << CL_VERSION_MINOR_BITS_KHR) - 1) |
| 591 | #define CL_VERSION_PATCH_MASK_KHR ((1 << CL_VERSION_PATCH_BITS_KHR) - 1) |
| 592 | |
| 593 | #define CL_VERSION_MAJOR_KHR(version) ((version) >> (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR)) |
| 594 | #define CL_VERSION_MINOR_KHR(version) (((version) >> CL_VERSION_PATCH_BITS_KHR) & CL_VERSION_MINOR_MASK_KHR) |
| 595 | #define CL_VERSION_PATCH_KHR(version) ((version) & CL_VERSION_PATCH_MASK_KHR) |
| 596 | |
| 597 | #define CL_MAKE_VERSION_KHR(major, minor, patch) \ |
| 598 | ((((major) & CL_VERSION_MAJOR_MASK_KHR) << (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR)) | \ |
| 599 | (((minor) & CL_VERSION_MINOR_MASK_KHR) << CL_VERSION_PATCH_BITS_KHR) | \ |
| 600 | ((patch) & CL_VERSION_PATCH_MASK_KHR)) |
| 601 | |
| 602 | typedef cl_uint cl_version_khr; |
| 603 | |
| 604 | #define CL_NAME_VERSION_MAX_NAME_SIZE_KHR 64 |
| 605 | |
| 606 | typedef struct _cl_name_version_khr |
| 607 | { |
| 608 | cl_version_khr version; |
| 609 | char name[CL_NAME_VERSION_MAX_NAME_SIZE_KHR]; |
| 610 | } cl_name_version_khr; |
| 611 | |
| 612 | /* cl_platform_info */ |
| 613 | #define CL_PLATFORM_NUMERIC_VERSION_KHR 0x0906 |
| 614 | #define CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR 0x0907 |
| 615 | |
| 616 | /* cl_device_info */ |
| 617 | #define CL_DEVICE_NUMERIC_VERSION_KHR 0x105E |
| 618 | #define CL_DEVICE_OPENCL_C_NUMERIC_VERSION_KHR 0x105F |
| 619 | #define CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR 0x1060 |
| 620 | #define CL_DEVICE_ILS_WITH_VERSION_KHR 0x1061 |
| 621 | #define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR 0x1062 |
| 622 | |
| 623 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 624 | /********************************** |
| 625 | * cl_arm_import_memory extension * |
| 626 | **********************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 627 | #define cl_arm_import_memory 1 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 628 | |
| 629 | typedef intptr_t cl_import_properties_arm; |
| 630 | |
| 631 | /* Default and valid proporties name for cl_arm_import_memory */ |
| 632 | #define CL_IMPORT_TYPE_ARM 0x40B2 |
| 633 | |
| 634 | /* Host process memory type default value for CL_IMPORT_TYPE_ARM property */ |
| 635 | #define CL_IMPORT_TYPE_HOST_ARM 0x40B3 |
| 636 | |
| 637 | /* DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */ |
| 638 | #define CL_IMPORT_TYPE_DMA_BUF_ARM 0x40B4 |
| 639 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 640 | /* Protected memory property */ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 641 | #define CL_IMPORT_TYPE_PROTECTED_ARM 0x40B5 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 642 | |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 643 | /* Android hardware buffer type value for CL_IMPORT_TYPE_ARM property */ |
| 644 | #define CL_IMPORT_TYPE_ANDROID_HARDWARE_BUFFER_ARM 0x41E2 |
| 645 | |
| 646 | /* Data consistency with host property */ |
| 647 | #define CL_IMPORT_DMA_BUF_DATA_CONSISTENCY_WITH_HOST_ARM 0x41E3 |
| 648 | |
| 649 | /* Import memory size value to indicate a size for the whole buffer */ |
| 650 | #define CL_IMPORT_MEMORY_WHOLE_ALLOCATION_ARM SIZE_MAX |
| 651 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 652 | /* This extension adds a new function that allows for direct memory import into |
| 653 | * OpenCL via the clImportMemoryARM function. |
| 654 | * |
| 655 | * Memory imported through this interface will be mapped into the device's page |
| 656 | * tables directly, providing zero copy access. It will never fall back to copy |
| 657 | * operations and aliased buffers. |
| 658 | * |
| 659 | * Types of memory supported for import are specified as additional extension |
| 660 | * strings. |
| 661 | * |
| 662 | * This extension produces cl_mem allocations which are compatible with all other |
| 663 | * users of cl_mem in the standard API. |
| 664 | * |
| 665 | * This extension maps pages with the same properties as the normal buffer creation |
| 666 | * function clCreateBuffer. |
| 667 | */ |
| 668 | extern CL_API_ENTRY cl_mem CL_API_CALL |
| 669 | clImportMemoryARM( cl_context context, |
| 670 | cl_mem_flags flags, |
| 671 | const cl_import_properties_arm *properties, |
| 672 | void *memory, |
| 673 | size_t size, |
| 674 | cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0; |
| 675 | |
| 676 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 677 | /****************************************** |
| 678 | * cl_arm_shared_virtual_memory extension * |
| 679 | ******************************************/ |
Anthony Barbier | 8b2fdc9 | 2018-08-09 11:42:38 +0100 | [diff] [blame] | 680 | #define cl_arm_shared_virtual_memory 1 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 681 | |
| 682 | /* Used by clGetDeviceInfo */ |
| 683 | #define CL_DEVICE_SVM_CAPABILITIES_ARM 0x40B6 |
| 684 | |
| 685 | /* Used by clGetMemObjectInfo */ |
| 686 | #define CL_MEM_USES_SVM_POINTER_ARM 0x40B7 |
| 687 | |
| 688 | /* Used by clSetKernelExecInfoARM: */ |
| 689 | #define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM 0x40B8 |
| 690 | #define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM 0x40B9 |
| 691 | |
| 692 | /* To be used by clGetEventInfo: */ |
| 693 | #define CL_COMMAND_SVM_FREE_ARM 0x40BA |
| 694 | #define CL_COMMAND_SVM_MEMCPY_ARM 0x40BB |
| 695 | #define CL_COMMAND_SVM_MEMFILL_ARM 0x40BC |
| 696 | #define CL_COMMAND_SVM_MAP_ARM 0x40BD |
| 697 | #define CL_COMMAND_SVM_UNMAP_ARM 0x40BE |
| 698 | |
| 699 | /* Flag values returned by clGetDeviceInfo with CL_DEVICE_SVM_CAPABILITIES_ARM as the param_name. */ |
| 700 | #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM (1 << 0) |
| 701 | #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM (1 << 1) |
| 702 | #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM (1 << 2) |
| 703 | #define CL_DEVICE_SVM_ATOMICS_ARM (1 << 3) |
| 704 | |
| 705 | /* Flag values used by clSVMAllocARM: */ |
| 706 | #define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM (1 << 10) |
| 707 | #define CL_MEM_SVM_ATOMICS_ARM (1 << 11) |
| 708 | |
| 709 | typedef cl_bitfield cl_svm_mem_flags_arm; |
| 710 | typedef cl_uint cl_kernel_exec_info_arm; |
| 711 | typedef cl_bitfield cl_device_svm_capabilities_arm; |
| 712 | |
| 713 | extern CL_API_ENTRY void * CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 714 | clSVMAllocARM(cl_context context, |
| 715 | cl_svm_mem_flags_arm flags, |
| 716 | size_t size, |
| 717 | cl_uint alignment) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 718 | |
| 719 | extern CL_API_ENTRY void CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 720 | clSVMFreeARM(cl_context context, |
| 721 | void * svm_pointer) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 722 | |
| 723 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 724 | clEnqueueSVMFreeARM(cl_command_queue command_queue, |
| 725 | cl_uint num_svm_pointers, |
| 726 | void * svm_pointers[], |
| 727 | void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue, |
| 728 | cl_uint num_svm_pointers, |
| 729 | void * svm_pointers[], |
| 730 | void * user_data), |
| 731 | void * user_data, |
| 732 | cl_uint num_events_in_wait_list, |
| 733 | const cl_event * event_wait_list, |
| 734 | cl_event * event) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 735 | |
| 736 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 737 | clEnqueueSVMMemcpyARM(cl_command_queue command_queue, |
| 738 | cl_bool blocking_copy, |
| 739 | void * dst_ptr, |
| 740 | const void * src_ptr, |
| 741 | size_t size, |
| 742 | cl_uint num_events_in_wait_list, |
| 743 | const cl_event * event_wait_list, |
| 744 | cl_event * event) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 745 | |
| 746 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 747 | clEnqueueSVMMemFillARM(cl_command_queue command_queue, |
| 748 | void * svm_ptr, |
| 749 | const void * pattern, |
| 750 | size_t pattern_size, |
| 751 | size_t size, |
| 752 | cl_uint num_events_in_wait_list, |
| 753 | const cl_event * event_wait_list, |
| 754 | cl_event * event) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 755 | |
| 756 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 757 | clEnqueueSVMMapARM(cl_command_queue command_queue, |
| 758 | cl_bool blocking_map, |
| 759 | cl_map_flags flags, |
| 760 | void * svm_ptr, |
| 761 | size_t size, |
| 762 | cl_uint num_events_in_wait_list, |
| 763 | const cl_event * event_wait_list, |
| 764 | cl_event * event) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 765 | |
| 766 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 767 | clEnqueueSVMUnmapARM(cl_command_queue command_queue, |
| 768 | void * svm_ptr, |
| 769 | cl_uint num_events_in_wait_list, |
| 770 | const cl_event * event_wait_list, |
| 771 | cl_event * event) CL_EXT_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 772 | |
| 773 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 774 | clSetKernelArgSVMPointerARM(cl_kernel kernel, |
| 775 | cl_uint arg_index, |
| 776 | const void * arg_value) CL_EXT_SUFFIX__VERSION_1_2; |
| 777 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 778 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame^] | 779 | clSetKernelExecInfoARM(cl_kernel kernel, |
| 780 | cl_kernel_exec_info_arm param_name, |
| 781 | size_t param_value_size, |
| 782 | const void * param_value) CL_EXT_SUFFIX__VERSION_1_2; |
| 783 | |
| 784 | /******************************** |
| 785 | * cl_arm_get_core_id extension * |
| 786 | ********************************/ |
| 787 | |
| 788 | #ifdef CL_VERSION_1_2 |
| 789 | |
| 790 | #define cl_arm_get_core_id 1 |
| 791 | |
| 792 | /* Device info property for bitfield of cores present */ |
| 793 | #define CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM 0x40BF |
| 794 | |
| 795 | #endif /* CL_VERSION_1_2 */ |
| 796 | |
| 797 | /********************************* |
| 798 | * cl_arm_job_slot_selection |
| 799 | *********************************/ |
| 800 | |
| 801 | #define cl_arm_job_slot_selection 1 |
| 802 | |
| 803 | /* cl_device_info */ |
| 804 | #define CL_DEVICE_JOB_SLOTS_ARM 0x41E0 |
| 805 | |
| 806 | /* cl_command_queue_properties */ |
| 807 | #define CL_QUEUE_JOB_SLOT_ARM 0x41E1 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 808 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 809 | #ifdef __cplusplus |
| 810 | } |
| 811 | #endif |
| 812 | |
| 813 | |
| 814 | #endif /* __CL_EXT_H */ |