blob: 0239b6413451b9b794097363d84fab443c25df79 [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*******************************************************************************
Sheri Zhang79cb9452021-09-07 14:51:49 +01002 * Copyright (c) 2008-2020 The Khronos Group Inc.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Anthony Barbier6ff3b192017-09-04 18:44:23 +01007 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01008 * http://www.apache.org/licenses/LICENSE-2.0
Anthony Barbier6ff3b192017-09-04 18:44:23 +01009 *
Sheri Zhang79cb9452021-09-07 14:51:49 +010010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010015 ******************************************************************************/
16
Anthony Barbier6ff3b192017-09-04 18:44:23 +010017/* cl_ext.h contains OpenCL extensions which don't have external */
18/* (OpenGL, D3D) dependencies. */
19
20#ifndef __CL_EXT_H
21#define __CL_EXT_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
Sheri Zhang67354e02021-06-30 16:08:29 +010027#include <CL/cl.h>
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010028
29/* cl_khr_fp64 extension - no extension #define since it has no functions */
30/* CL_DEVICE_DOUBLE_FP_CONFIG is defined in CL.h for OpenCL >= 120 */
31
32#if CL_TARGET_OPENCL_VERSION <= 110
33#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
Anthony Barbier6ff3b192017-09-04 18:44:23 +010034#endif
35
36/* cl_khr_fp16 extension - no extension #define since it has no functions */
37#define CL_DEVICE_HALF_FP_CONFIG 0x1033
38
39/* Memory object destruction
40 *
41 * Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
42 *
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010043 * Registers a user callback function that will be called when the memory object is deleted and its resources
44 * freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
45 * stack associated with memobj. The registered user callback functions are called in the reverse order in
46 * which they were registered. The user callback functions are called and then the memory object is deleted
47 * and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
48 * notified when the memory referenced by host_ptr, specified when the memory object is created and used as
Anthony Barbier6ff3b192017-09-04 18:44:23 +010049 * the storage bits for the memory object, can be reused or freed.
50 *
51 * The application may not call CL api's with the cl_mem object passed to the pfn_notify.
52 *
53 * Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
54 * before using.
55 */
56#define cl_APPLE_SetMemObjectDestructor 1
Sheri Zhang67354e02021-06-30 16:08:29 +010057cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem memobj,
58 void (* pfn_notify)(cl_mem memobj, void * user_data),
59 void * user_data) CL_EXT_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010060
61
62/* Context Logging Functions
63 *
64 * The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
65 * Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
66 * before using.
67 *
Sheri Zhang67354e02021-06-30 16:08:29 +010068 * clLogMessagesToSystemLog forwards on all log messages to the Apple System Logger
Anthony Barbier6ff3b192017-09-04 18:44:23 +010069 */
70#define cl_APPLE_ContextLoggingFunctions 1
Sheri Zhang67354e02021-06-30 16:08:29 +010071extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE( const char * errstr,
72 const void * private_info,
73 size_t cb,
74 void * user_data) CL_EXT_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010075
76/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */
Sheri Zhang67354e02021-06-30 16:08:29 +010077extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE( const char * errstr,
78 const void * private_info,
79 size_t cb,
80 void * user_data) CL_EXT_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010081
82/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */
Sheri Zhang67354e02021-06-30 16:08:29 +010083extern void CL_API_ENTRY clLogMessagesToStderrAPPLE( const char * errstr,
84 const void * private_info,
85 size_t cb,
86 void * user_data) CL_EXT_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010087
88
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010089/************************
90* cl_khr_icd extension *
Anthony Barbier6ff3b192017-09-04 18:44:23 +010091************************/
92#define cl_khr_icd 1
93
94/* cl_platform_info */
95#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920
96
97/* Additional Error Codes */
98#define CL_PLATFORM_NOT_FOUND_KHR -1001
99
100extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100101clIcdGetPlatformIDsKHR(cl_uint num_entries,
102 cl_platform_id * platforms,
103 cl_uint * num_platforms);
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100104
Sheri Zhang67354e02021-06-30 16:08:29 +0100105typedef CL_API_ENTRY cl_int
106(CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(cl_uint num_entries,
107 cl_platform_id * platforms,
108 cl_uint * num_platforms);
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100109
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100110
111/*******************************
112 * cl_khr_il_program extension *
113 *******************************/
114#define cl_khr_il_program 1
115
116/* New property to clGetDeviceInfo for retrieving supported intermediate
117 * languages
118 */
119#define CL_DEVICE_IL_VERSION_KHR 0x105B
120
121/* New property to clGetProgramInfo for retrieving for retrieving the IL of a
122 * program
123 */
124#define CL_PROGRAM_IL_KHR 0x1169
125
Sheri Zhang67354e02021-06-30 16:08:29 +0100126extern CL_API_ENTRY cl_program CL_API_CALL
127clCreateProgramWithILKHR(cl_context context,
128 const void * il,
129 size_t length,
130 cl_int * errcode_ret);
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100131
132typedef CL_API_ENTRY cl_program
Sheri Zhang67354e02021-06-30 16:08:29 +0100133(CL_API_CALL *clCreateProgramWithILKHR_fn)(cl_context context,
134 const void * il,
135 size_t length,
136 cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100137
Sheri Zhang67354e02021-06-30 16:08:29 +0100138/* Extension: cl_khr_image2d_from_buffer
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100139 *
Sheri Zhang67354e02021-06-30 16:08:29 +0100140 * This extension allows a 2D image to be created from a cl_mem buffer without
141 * a copy. The type associated with a 2D image created from a buffer in an
142 * OpenCL program is image2d_t. Both the sampler and sampler-less read_image
143 * built-in functions are supported for 2D images and 2D images created from
144 * a buffer. Similarly, the write_image built-ins are also supported for 2D
145 * images created from a buffer.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100146 *
Sheri Zhang67354e02021-06-30 16:08:29 +0100147 * When the 2D image from buffer is created, the client must specify the
148 * width, height, image format (i.e. channel order and channel data type)
149 * and optionally the row pitch.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100150 *
Sheri Zhang67354e02021-06-30 16:08:29 +0100151 * The pitch specified must be a multiple of
152 * CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR pixels.
153 * The base address of the buffer must be aligned to
154 * CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR pixels.
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100155 */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100156
Sheri Zhang67354e02021-06-30 16:08:29 +0100157#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR 0x104A
158#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR 0x104B
159
160
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100161/**************************************
162 * cl_khr_initialize_memory extension *
163 **************************************/
164
Pablo Telloe86a09f2018-01-11 15:44:48 +0000165#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x2030
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100166
167
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100168/**************************************
169 * cl_khr_terminate_context extension *
170 **************************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100171
Sheri Zhang79cb9452021-09-07 14:51:49 +0100172#define CL_CONTEXT_TERMINATED_KHR -1121
173
Pablo Telloe86a09f2018-01-11 15:44:48 +0000174#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x2031
175#define CL_CONTEXT_TERMINATE_KHR 0x2032
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100176
177#define cl_khr_terminate_context 1
Sheri Zhang67354e02021-06-30 16:08:29 +0100178extern CL_API_ENTRY cl_int CL_API_CALL
179clTerminateContextKHR(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100180
Sheri Zhang67354e02021-06-30 16:08:29 +0100181typedef CL_API_ENTRY cl_int
182(CL_API_CALL *clTerminateContextKHR_fn)(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100183
184
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100185/*
186 * Extension: cl_khr_spir
187 *
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100188 * This extension adds support to create an OpenCL program object from a
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100189 * Standard Portable Intermediate Representation (SPIR) instance
190 */
191
192#define CL_DEVICE_SPIR_VERSIONS 0x40E0
193#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
194
195
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100196/*****************************************
197 * cl_khr_create_command_queue extension *
198 *****************************************/
199#define cl_khr_create_command_queue 1
200
Sheri Zhang79cb9452021-09-07 14:51:49 +0100201typedef cl_properties cl_queue_properties_khr;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100202
203extern CL_API_ENTRY cl_command_queue CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100204clCreateCommandQueueWithPropertiesKHR(cl_context context,
205 cl_device_id device,
206 const cl_queue_properties_khr* properties,
207 cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
208
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100209typedef CL_API_ENTRY cl_command_queue
Sheri Zhang67354e02021-06-30 16:08:29 +0100210(CL_API_CALL *clCreateCommandQueueWithPropertiesKHR_fn)(cl_context context,
211 cl_device_id device,
212 const cl_queue_properties_khr* properties,
213 cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100214
215
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100216/******************************************
217* cl_nv_device_attribute_query extension *
218******************************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100219
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100220/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
221#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
222#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
223#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002
224#define CL_DEVICE_WARP_SIZE_NV 0x4003
225#define CL_DEVICE_GPU_OVERLAP_NV 0x4004
226#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
227#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
228
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100229
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100230/*********************************
231* cl_amd_device_attribute_query *
232*********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100233
Sheri Zhang79cb9452021-09-07 14:51:49 +0100234#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
235#define CL_DEVICE_TOPOLOGY_AMD 0x4037
236#define CL_DEVICE_BOARD_NAME_AMD 0x4038
237#define CL_DEVICE_GLOBAL_FREE_MEMORY_AMD 0x4039
238#define CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD 0x4040
239#define CL_DEVICE_SIMD_WIDTH_AMD 0x4041
240#define CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD 0x4042
241#define CL_DEVICE_WAVEFRONT_WIDTH_AMD 0x4043
242#define CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD 0x4044
243#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD 0x4045
244#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD 0x4046
245#define CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD 0x4047
246#define CL_DEVICE_LOCAL_MEM_BANKS_AMD 0x4048
247#define CL_DEVICE_THREAD_TRACE_SUPPORTED_AMD 0x4049
248#define CL_DEVICE_GFXIP_MAJOR_AMD 0x404A
249#define CL_DEVICE_GFXIP_MINOR_AMD 0x404B
250#define CL_DEVICE_AVAILABLE_ASYNC_QUEUES_AMD 0x404C
251#define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_AMD 0x4030
252#define CL_DEVICE_MAX_WORK_GROUP_SIZE_AMD 0x4031
253#define CL_DEVICE_PREFERRED_CONSTANT_BUFFER_SIZE_AMD 0x4033
254#define CL_DEVICE_PCIE_ID_AMD 0x4034
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100255
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100256
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100257/*********************************
258* cl_arm_printf extension
259*********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100260
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100261#define CL_PRINTF_CALLBACK_ARM 0x40B0
262#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
263
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100264
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100265/***********************************
266* cl_ext_device_fission extension
267***********************************/
268#define cl_ext_device_fission 1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100269
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100270extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100271clReleaseDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100272
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100273typedef CL_API_ENTRY cl_int
Sheri Zhang67354e02021-06-30 16:08:29 +0100274(CL_API_CALL *clReleaseDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100275
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100276extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100277clRetainDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100278
279typedef CL_API_ENTRY cl_int
Sheri Zhang67354e02021-06-30 16:08:29 +0100280(CL_API_CALL *clRetainDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100281
282typedef cl_ulong cl_device_partition_property_ext;
283extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100284clCreateSubDevicesEXT(cl_device_id in_device,
285 const cl_device_partition_property_ext * properties,
286 cl_uint num_entries,
287 cl_device_id * out_devices,
288 cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100289
290typedef CL_API_ENTRY cl_int
Sheri Zhang67354e02021-06-30 16:08:29 +0100291(CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id in_device,
292 const cl_device_partition_property_ext * properties,
293 cl_uint num_entries,
294 cl_device_id * out_devices,
295 cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100296
297/* cl_device_partition_property_ext */
298#define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050
299#define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
300#define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
301#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
302
303/* clDeviceGetInfo selectors */
304#define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
305#define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
306#define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
307#define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
308#define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
309
310/* error codes */
311#define CL_DEVICE_PARTITION_FAILED_EXT -1057
312#define CL_INVALID_PARTITION_COUNT_EXT -1058
313#define CL_INVALID_PARTITION_NAME_EXT -1059
314
315/* CL_AFFINITY_DOMAINs */
316#define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
317#define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
318#define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3
319#define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
320#define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
321#define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
322
323/* cl_device_partition_property_ext list terminators */
324#define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0)
325#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
326#define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
327
328
329/***********************************
330 * cl_ext_migrate_memobject extension definitions
331 ***********************************/
332#define cl_ext_migrate_memobject 1
333
334typedef cl_bitfield cl_mem_migration_flags_ext;
335
336#define CL_MIGRATE_MEM_OBJECT_HOST_EXT 0x1
337
338#define CL_COMMAND_MIGRATE_MEM_OBJECT_EXT 0x4040
339
340extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100341clEnqueueMigrateMemObjectEXT(cl_command_queue command_queue,
342 cl_uint num_mem_objects,
343 const cl_mem * mem_objects,
344 cl_mem_migration_flags_ext flags,
345 cl_uint num_events_in_wait_list,
346 const cl_event * event_wait_list,
347 cl_event * event);
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100348
349typedef CL_API_ENTRY cl_int
Sheri Zhang67354e02021-06-30 16:08:29 +0100350(CL_API_CALL *clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue command_queue,
351 cl_uint num_mem_objects,
352 const cl_mem * mem_objects,
353 cl_mem_migration_flags_ext flags,
354 cl_uint num_events_in_wait_list,
355 const cl_event * event_wait_list,
356 cl_event * event);
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100357
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100358
359/*********************************
Sheri Zhang79cb9452021-09-07 14:51:49 +0100360* cl_ext_cxx_for_opencl extension
361*********************************/
362#define cl_ext_cxx_for_opencl 1
363
364#define CL_DEVICE_CXX_FOR_OPENCL_NUMERIC_VERSION_EXT 0x4230
365
366/*********************************
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100367* cl_qcom_ext_host_ptr extension
368*********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100369#define cl_qcom_ext_host_ptr 1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100370
371#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29)
372
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100373#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100374#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
375#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2
376#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3
377#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4
378#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5
379#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6
380#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7
381
382typedef cl_uint cl_image_pitch_info_qcom;
383
384extern CL_API_ENTRY cl_int CL_API_CALL
385clGetDeviceImageInfoQCOM(cl_device_id device,
386 size_t image_width,
387 size_t image_height,
388 const cl_image_format *image_format,
389 cl_image_pitch_info_qcom param_name,
390 size_t param_value_size,
391 void *param_value,
392 size_t *param_value_size_ret);
393
394typedef struct _cl_mem_ext_host_ptr
395{
396 /* Type of external memory allocation. */
397 /* Legal values will be defined in layered extensions. */
398 cl_uint allocation_type;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100399
Pablo Telloe86a09f2018-01-11 15:44:48 +0000400 /* Host cache policy for this external memory allocation. */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100401 cl_uint host_cache_policy;
402
403} cl_mem_ext_host_ptr;
404
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100405
406/*******************************************
407* cl_qcom_ext_host_ptr_iocoherent extension
408********************************************/
409
410/* Cache policy specifying io-coherence */
411#define CL_MEM_HOST_IOCOHERENT_QCOM 0x40A9
412
413
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100414/*********************************
415* cl_qcom_ion_host_ptr extension
416*********************************/
417
418#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8
419
420typedef struct _cl_mem_ion_host_ptr
421{
422 /* Type of external memory allocation. */
423 /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
424 cl_mem_ext_host_ptr ext_host_ptr;
425
426 /* ION file descriptor */
427 int ion_filedesc;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100428
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100429 /* Host pointer to the ION allocated memory */
430 void* ion_hostptr;
431
432} cl_mem_ion_host_ptr;
433
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100434
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100435/*********************************
436* cl_qcom_android_native_buffer_host_ptr extension
437*********************************/
438
439#define CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM 0x40C6
440
441typedef struct _cl_mem_android_native_buffer_host_ptr
442{
443 /* Type of external memory allocation. */
444 /* Must be CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM for Android native buffers. */
445 cl_mem_ext_host_ptr ext_host_ptr;
446
447 /* Virtual pointer to the android native buffer */
448 void* anb_ptr;
449
450} cl_mem_android_native_buffer_host_ptr;
451
Pablo Telloe86a09f2018-01-11 15:44:48 +0000452
453/******************************************
454 * cl_img_yuv_image extension *
455 ******************************************/
456
457/* Image formats used in clCreateImage */
458#define CL_NV21_IMG 0x40D0
459#define CL_YV12_IMG 0x40D1
460
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100461
Pablo Telloe86a09f2018-01-11 15:44:48 +0000462/******************************************
463 * cl_img_cached_allocations extension *
464 ******************************************/
465
Sheri Zhang67354e02021-06-30 16:08:29 +0100466/* Flag values used by clCreateBuffer */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100467#define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG (1 << 26)
468#define CL_MEM_USE_CACHED_CPU_MEMORY_IMG (1 << 27)
469
Pablo Telloe86a09f2018-01-11 15:44:48 +0000470
471/******************************************
472 * cl_img_use_gralloc_ptr extension *
473 ******************************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100474#define cl_img_use_gralloc_ptr 1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000475
Sheri Zhang67354e02021-06-30 16:08:29 +0100476/* Flag values used by clCreateBuffer */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100477#define CL_MEM_USE_GRALLOC_PTR_IMG (1 << 28)
Pablo Telloe86a09f2018-01-11 15:44:48 +0000478
479/* To be used by clGetEventInfo: */
480#define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG 0x40D2
481#define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG 0x40D3
482
Sheri Zhang79cb9452021-09-07 14:51:49 +0100483/* Error codes from clEnqueueAcquireGrallocObjectsIMG and clEnqueueReleaseGrallocObjectsIMG */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000484#define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG 0x40D4
Sheri Zhang79cb9452021-09-07 14:51:49 +0100485#define CL_INVALID_GRALLOC_OBJECT_IMG 0x40D5
Pablo Telloe86a09f2018-01-11 15:44:48 +0000486
487extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100488clEnqueueAcquireGrallocObjectsIMG(cl_command_queue command_queue,
489 cl_uint num_objects,
490 const cl_mem * mem_objects,
491 cl_uint num_events_in_wait_list,
492 const cl_event * event_wait_list,
493 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000494
495extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100496clEnqueueReleaseGrallocObjectsIMG(cl_command_queue command_queue,
497 cl_uint num_objects,
498 const cl_mem * mem_objects,
499 cl_uint num_events_in_wait_list,
500 const cl_event * event_wait_list,
501 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000502
Sheri Zhang79cb9452021-09-07 14:51:49 +0100503/******************************************
504 * cl_img_generate_mipmap extension *
505 ******************************************/
506#define cl_img_generate_mipmap 1
507
508typedef cl_uint cl_mipmap_filter_mode_img;
509
510/* To be used by clEnqueueGenerateMipmapIMG */
511#define CL_MIPMAP_FILTER_ANY_IMG 0x0
512#define CL_MIPMAP_FILTER_BOX_IMG 0x1
513
514/* To be used by clGetEventInfo */
515#define CL_COMMAND_GENERATE_MIPMAP_IMG 0x40D6
516
517extern CL_API_ENTRY cl_int CL_API_CALL
518clEnqueueGenerateMipmapIMG(cl_command_queue command_queue,
519 cl_mem src_image,
520 cl_mem dst_image,
521 cl_mipmap_filter_mode_img mipmap_filter_mode,
522 const size_t *array_region,
523 const size_t *mip_region,
524 cl_uint num_events_in_wait_list,
525 const cl_event *event_wait_list,
526 cl_event *event) CL_EXT_SUFFIX__VERSION_1_2;
527
528/******************************************
529 * cl_img_mem_properties extension *
530 ******************************************/
531#define cl_img_mem_properties 1
532
533/* To be used by clCreateBufferWithProperties */
534#define CL_MEM_ALLOC_FLAGS_IMG 0x40D7
535
536/* To be used wiith the CL_MEM_ALLOC_FLAGS_IMG property */
537typedef cl_bitfield cl_mem_alloc_flags_img;
538
539/* To be used with cl_mem_alloc_flags_img */
540#define CL_MEM_ALLOC_RELAX_REQUIREMENTS_IMG (1 << 0)
Pablo Telloe86a09f2018-01-11 15:44:48 +0000541
Pablo Telloe86a09f2018-01-11 15:44:48 +0000542/*********************************
543* cl_khr_subgroups extension
544*********************************/
545#define cl_khr_subgroups 1
546
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100547#if !defined(CL_VERSION_2_1)
548/* For OpenCL 2.1 and newer, cl_kernel_sub_group_info is declared in CL.h.
549 In hindsight, there should have been a khr suffix on this type for
550 the extension, but keeping it un-suffixed to maintain backwards
551 compatibility. */
552typedef cl_uint cl_kernel_sub_group_info;
553#endif
Pablo Telloe86a09f2018-01-11 15:44:48 +0000554
555/* cl_kernel_sub_group_info */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100556#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033
557#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034
Pablo Telloe86a09f2018-01-11 15:44:48 +0000558
559extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100560clGetKernelSubGroupInfoKHR(cl_kernel in_kernel,
561 cl_device_id in_device,
562 cl_kernel_sub_group_info param_name,
563 size_t input_value_size,
564 const void * input_value,
565 size_t param_value_size,
566 void * param_value,
567 size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000568
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100569typedef CL_API_ENTRY cl_int
Sheri Zhang67354e02021-06-30 16:08:29 +0100570(CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel in_kernel,
571 cl_device_id in_device,
572 cl_kernel_sub_group_info param_name,
573 size_t input_value_size,
574 const void * input_value,
575 size_t param_value_size,
576 void * param_value,
577 size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
578
579
580/*********************************
581* cl_khr_mipmap_image extension
582*********************************/
583
584/* cl_sampler_properties */
585#define CL_SAMPLER_MIP_FILTER_MODE_KHR 0x1155
586#define CL_SAMPLER_LOD_MIN_KHR 0x1156
587#define CL_SAMPLER_LOD_MAX_KHR 0x1157
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100588
589
Pablo Telloe86a09f2018-01-11 15:44:48 +0000590/*********************************
591* cl_khr_priority_hints extension
592*********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100593/* This extension define is for backwards compatibility.
594 It shouldn't be required since this extension has no new functions. */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000595#define cl_khr_priority_hints 1
596
597typedef cl_uint cl_queue_priority_khr;
598
599/* cl_command_queue_properties */
600#define CL_QUEUE_PRIORITY_KHR 0x1096
601
602/* cl_queue_priority_khr */
603#define CL_QUEUE_PRIORITY_HIGH_KHR (1<<0)
604#define CL_QUEUE_PRIORITY_MED_KHR (1<<1)
605#define CL_QUEUE_PRIORITY_LOW_KHR (1<<2)
606
Pablo Telloe86a09f2018-01-11 15:44:48 +0000607
Pablo Telloe86a09f2018-01-11 15:44:48 +0000608/*********************************
609* cl_khr_throttle_hints extension
610*********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100611/* This extension define is for backwards compatibility.
612 It shouldn't be required since this extension has no new functions. */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000613#define cl_khr_throttle_hints 1
614
615typedef cl_uint cl_queue_throttle_khr;
616
617/* cl_command_queue_properties */
618#define CL_QUEUE_THROTTLE_KHR 0x1097
619
620/* cl_queue_throttle_khr */
621#define CL_QUEUE_THROTTLE_HIGH_KHR (1<<0)
622#define CL_QUEUE_THROTTLE_MED_KHR (1<<1)
623#define CL_QUEUE_THROTTLE_LOW_KHR (1<<2)
624
Pablo Telloe86a09f2018-01-11 15:44:48 +0000625
Pablo Telloe86a09f2018-01-11 15:44:48 +0000626/*********************************
627* cl_khr_subgroup_named_barrier
628*********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100629/* This extension define is for backwards compatibility.
630 It shouldn't be required since this extension has no new functions. */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000631#define cl_khr_subgroup_named_barrier 1
632
633/* cl_device_info */
634#define CL_DEVICE_MAX_NAMED_BARRIER_COUNT_KHR 0x2035
635
Pablo Telloe86a09f2018-01-11 15:44:48 +0000636
Sheri Zhang67354e02021-06-30 16:08:29 +0100637/*********************************
638* cl_khr_extended_versioning
639*********************************/
640
Sheri Zhang79cb9452021-09-07 14:51:49 +0100641#define cl_khr_extended_versioning 1
642
Sheri Zhang67354e02021-06-30 16:08:29 +0100643#define CL_VERSION_MAJOR_BITS_KHR (10)
644#define CL_VERSION_MINOR_BITS_KHR (10)
645#define CL_VERSION_PATCH_BITS_KHR (12)
646
647#define CL_VERSION_MAJOR_MASK_KHR ((1 << CL_VERSION_MAJOR_BITS_KHR) - 1)
648#define CL_VERSION_MINOR_MASK_KHR ((1 << CL_VERSION_MINOR_BITS_KHR) - 1)
649#define CL_VERSION_PATCH_MASK_KHR ((1 << CL_VERSION_PATCH_BITS_KHR) - 1)
650
651#define CL_VERSION_MAJOR_KHR(version) ((version) >> (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR))
652#define CL_VERSION_MINOR_KHR(version) (((version) >> CL_VERSION_PATCH_BITS_KHR) & CL_VERSION_MINOR_MASK_KHR)
653#define CL_VERSION_PATCH_KHR(version) ((version) & CL_VERSION_PATCH_MASK_KHR)
654
655#define CL_MAKE_VERSION_KHR(major, minor, patch) \
656 ((((major) & CL_VERSION_MAJOR_MASK_KHR) << (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR)) | \
657 (((minor) & CL_VERSION_MINOR_MASK_KHR) << CL_VERSION_PATCH_BITS_KHR) | \
658 ((patch) & CL_VERSION_PATCH_MASK_KHR))
659
660typedef cl_uint cl_version_khr;
661
662#define CL_NAME_VERSION_MAX_NAME_SIZE_KHR 64
663
664typedef struct _cl_name_version_khr
665{
666 cl_version_khr version;
667 char name[CL_NAME_VERSION_MAX_NAME_SIZE_KHR];
668} cl_name_version_khr;
669
670/* cl_platform_info */
671#define CL_PLATFORM_NUMERIC_VERSION_KHR 0x0906
672#define CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR 0x0907
673
674/* cl_device_info */
675#define CL_DEVICE_NUMERIC_VERSION_KHR 0x105E
676#define CL_DEVICE_OPENCL_C_NUMERIC_VERSION_KHR 0x105F
677#define CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR 0x1060
678#define CL_DEVICE_ILS_WITH_VERSION_KHR 0x1061
679#define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR 0x1062
680
681
Sheri Zhang79cb9452021-09-07 14:51:49 +0100682/*********************************
683* cl_khr_device_uuid extension
684*********************************/
685#define cl_khr_device_uuid 1
686
687#define CL_UUID_SIZE_KHR 16
688#define CL_LUID_SIZE_KHR 8
689
690#define CL_DEVICE_UUID_KHR 0x106A
691#define CL_DRIVER_UUID_KHR 0x106B
692#define CL_DEVICE_LUID_VALID_KHR 0x106C
693#define CL_DEVICE_LUID_KHR 0x106D
694#define CL_DEVICE_NODE_MASK_KHR 0x106E
695
696
Pablo Telloe86a09f2018-01-11 15:44:48 +0000697/**********************************
698 * cl_arm_import_memory extension *
699 **********************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100700#define cl_arm_import_memory 1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000701
702typedef intptr_t cl_import_properties_arm;
703
704/* Default and valid proporties name for cl_arm_import_memory */
705#define CL_IMPORT_TYPE_ARM 0x40B2
706
707/* Host process memory type default value for CL_IMPORT_TYPE_ARM property */
708#define CL_IMPORT_TYPE_HOST_ARM 0x40B3
709
710/* DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
711#define CL_IMPORT_TYPE_DMA_BUF_ARM 0x40B4
712
Sheri Zhang67354e02021-06-30 16:08:29 +0100713/* Protected memory property */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100714#define CL_IMPORT_TYPE_PROTECTED_ARM 0x40B5
Pablo Telloe86a09f2018-01-11 15:44:48 +0000715
Sheri Zhang67354e02021-06-30 16:08:29 +0100716/* Android hardware buffer type value for CL_IMPORT_TYPE_ARM property */
717#define CL_IMPORT_TYPE_ANDROID_HARDWARE_BUFFER_ARM 0x41E2
718
719/* Data consistency with host property */
720#define CL_IMPORT_DMA_BUF_DATA_CONSISTENCY_WITH_HOST_ARM 0x41E3
721
722/* Import memory size value to indicate a size for the whole buffer */
723#define CL_IMPORT_MEMORY_WHOLE_ALLOCATION_ARM SIZE_MAX
724
Pablo Telloe86a09f2018-01-11 15:44:48 +0000725/* This extension adds a new function that allows for direct memory import into
726 * OpenCL via the clImportMemoryARM function.
727 *
728 * Memory imported through this interface will be mapped into the device's page
729 * tables directly, providing zero copy access. It will never fall back to copy
730 * operations and aliased buffers.
731 *
732 * Types of memory supported for import are specified as additional extension
733 * strings.
734 *
735 * This extension produces cl_mem allocations which are compatible with all other
736 * users of cl_mem in the standard API.
737 *
738 * This extension maps pages with the same properties as the normal buffer creation
739 * function clCreateBuffer.
740 */
741extern CL_API_ENTRY cl_mem CL_API_CALL
742clImportMemoryARM( cl_context context,
743 cl_mem_flags flags,
744 const cl_import_properties_arm *properties,
745 void *memory,
746 size_t size,
747 cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
748
749
Pablo Telloe86a09f2018-01-11 15:44:48 +0000750/******************************************
751 * cl_arm_shared_virtual_memory extension *
752 ******************************************/
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100753#define cl_arm_shared_virtual_memory 1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000754
755/* Used by clGetDeviceInfo */
756#define CL_DEVICE_SVM_CAPABILITIES_ARM 0x40B6
757
758/* Used by clGetMemObjectInfo */
759#define CL_MEM_USES_SVM_POINTER_ARM 0x40B7
760
761/* Used by clSetKernelExecInfoARM: */
762#define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM 0x40B8
763#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM 0x40B9
764
765/* To be used by clGetEventInfo: */
766#define CL_COMMAND_SVM_FREE_ARM 0x40BA
767#define CL_COMMAND_SVM_MEMCPY_ARM 0x40BB
768#define CL_COMMAND_SVM_MEMFILL_ARM 0x40BC
769#define CL_COMMAND_SVM_MAP_ARM 0x40BD
770#define CL_COMMAND_SVM_UNMAP_ARM 0x40BE
771
772/* Flag values returned by clGetDeviceInfo with CL_DEVICE_SVM_CAPABILITIES_ARM as the param_name. */
773#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM (1 << 0)
774#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM (1 << 1)
775#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM (1 << 2)
776#define CL_DEVICE_SVM_ATOMICS_ARM (1 << 3)
777
778/* Flag values used by clSVMAllocARM: */
779#define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM (1 << 10)
780#define CL_MEM_SVM_ATOMICS_ARM (1 << 11)
781
782typedef cl_bitfield cl_svm_mem_flags_arm;
783typedef cl_uint cl_kernel_exec_info_arm;
784typedef cl_bitfield cl_device_svm_capabilities_arm;
785
786extern CL_API_ENTRY void * CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100787clSVMAllocARM(cl_context context,
788 cl_svm_mem_flags_arm flags,
789 size_t size,
790 cl_uint alignment) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000791
792extern CL_API_ENTRY void CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100793clSVMFreeARM(cl_context context,
794 void * svm_pointer) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000795
796extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100797clEnqueueSVMFreeARM(cl_command_queue command_queue,
798 cl_uint num_svm_pointers,
799 void * svm_pointers[],
800 void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue,
801 cl_uint num_svm_pointers,
802 void * svm_pointers[],
803 void * user_data),
804 void * user_data,
805 cl_uint num_events_in_wait_list,
806 const cl_event * event_wait_list,
807 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000808
809extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100810clEnqueueSVMMemcpyARM(cl_command_queue command_queue,
811 cl_bool blocking_copy,
812 void * dst_ptr,
813 const void * src_ptr,
814 size_t size,
815 cl_uint num_events_in_wait_list,
816 const cl_event * event_wait_list,
817 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000818
819extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100820clEnqueueSVMMemFillARM(cl_command_queue command_queue,
821 void * svm_ptr,
822 const void * pattern,
823 size_t pattern_size,
824 size_t size,
825 cl_uint num_events_in_wait_list,
826 const cl_event * event_wait_list,
827 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000828
829extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100830clEnqueueSVMMapARM(cl_command_queue command_queue,
831 cl_bool blocking_map,
832 cl_map_flags flags,
833 void * svm_ptr,
834 size_t size,
835 cl_uint num_events_in_wait_list,
836 const cl_event * event_wait_list,
837 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000838
839extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100840clEnqueueSVMUnmapARM(cl_command_queue command_queue,
841 void * svm_ptr,
842 cl_uint num_events_in_wait_list,
843 const cl_event * event_wait_list,
844 cl_event * event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000845
846extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100847clSetKernelArgSVMPointerARM(cl_kernel kernel,
848 cl_uint arg_index,
849 const void * arg_value) CL_EXT_SUFFIX__VERSION_1_2;
850
Pablo Telloe86a09f2018-01-11 15:44:48 +0000851extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100852clSetKernelExecInfoARM(cl_kernel kernel,
853 cl_kernel_exec_info_arm param_name,
854 size_t param_value_size,
855 const void * param_value) CL_EXT_SUFFIX__VERSION_1_2;
856
857/********************************
858 * cl_arm_get_core_id extension *
859 ********************************/
860
861#ifdef CL_VERSION_1_2
862
863#define cl_arm_get_core_id 1
864
865/* Device info property for bitfield of cores present */
866#define CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM 0x40BF
867
868#endif /* CL_VERSION_1_2 */
869
870/*********************************
871* cl_arm_job_slot_selection
872*********************************/
873
874#define cl_arm_job_slot_selection 1
875
876/* cl_device_info */
877#define CL_DEVICE_JOB_SLOTS_ARM 0x41E0
878
879/* cl_command_queue_properties */
880#define CL_QUEUE_JOB_SLOT_ARM 0x41E1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000881
Sheri Zhang79cb9452021-09-07 14:51:49 +0100882/*********************************
883* cl_arm_scheduling_controls
884*********************************/
885
886#define cl_arm_scheduling_controls 1
887
888/* cl_device_info */
889#define CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM 0x41E4
890
891#define CL_DEVICE_SCHEDULING_KERNEL_BATCHING_ARM (1 << 0)
892#define CL_DEVICE_SCHEDULING_WORKGROUP_BATCH_SIZE_ARM (1 << 1)
893#define CL_DEVICE_SCHEDULING_WORKGROUP_BATCH_SIZE_MODIFIER_ARM (1 << 2)
894
895/* cl_kernel_info */
896#define CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM 0x41E5
897#define CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM 0x41E6
898
899/* cl_queue_properties */
900#define CL_QUEUE_KERNEL_BATCHING_ARM 0x41E7
901
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100902#ifdef __cplusplus
903}
904#endif
905
906
907#endif /* __CL_EXT_H */