blob: 0018a0f420a31b0556c8129e24d54028877b5686 [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
17#ifndef __OPENCL_CL_H
18#define __OPENCL_CL_H
19
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010020#include <CL/cl_version.h>
Anthony Barbier6ff3b192017-09-04 18:44:23 +010021#include <CL/cl_platform.h>
Anthony Barbier6ff3b192017-09-04 18:44:23 +010022
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/******************************************************************************/
28
29typedef struct _cl_platform_id * cl_platform_id;
30typedef struct _cl_device_id * cl_device_id;
31typedef struct _cl_context * cl_context;
32typedef struct _cl_command_queue * cl_command_queue;
33typedef struct _cl_mem * cl_mem;
34typedef struct _cl_program * cl_program;
35typedef struct _cl_kernel * cl_kernel;
36typedef struct _cl_event * cl_event;
37typedef struct _cl_sampler * cl_sampler;
38
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010039typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010040typedef cl_ulong cl_bitfield;
Sheri Zhang79cb9452021-09-07 14:51:49 +010041typedef cl_ulong cl_properties;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010042typedef cl_bitfield cl_device_type;
43typedef cl_uint cl_platform_info;
44typedef cl_uint cl_device_info;
45typedef cl_bitfield cl_device_fp_config;
46typedef cl_uint cl_device_mem_cache_type;
47typedef cl_uint cl_device_local_mem_type;
48typedef cl_bitfield cl_device_exec_capabilities;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010049#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +000050typedef cl_bitfield cl_device_svm_capabilities;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010051#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010052typedef cl_bitfield cl_command_queue_properties;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010053#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +010054typedef intptr_t cl_device_partition_property;
55typedef cl_bitfield cl_device_affinity_domain;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010056#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010057
58typedef intptr_t cl_context_properties;
59typedef cl_uint cl_context_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010060#ifdef CL_VERSION_2_0
Sheri Zhang79cb9452021-09-07 14:51:49 +010061typedef cl_properties cl_queue_properties;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010062#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010063typedef cl_uint cl_command_queue_info;
64typedef cl_uint cl_channel_order;
65typedef cl_uint cl_channel_type;
66typedef cl_bitfield cl_mem_flags;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010067#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +000068typedef cl_bitfield cl_svm_mem_flags;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010069#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010070typedef cl_uint cl_mem_object_type;
71typedef cl_uint cl_mem_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010072#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +010073typedef cl_bitfield cl_mem_migration_flags;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010074#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010075typedef cl_uint cl_image_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010076#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +010077typedef cl_uint cl_buffer_create_type;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010078#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010079typedef cl_uint cl_addressing_mode;
80typedef cl_uint cl_filter_mode;
81typedef cl_uint cl_sampler_info;
82typedef cl_bitfield cl_map_flags;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010083#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +000084typedef intptr_t cl_pipe_properties;
85typedef cl_uint cl_pipe_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010086#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010087typedef cl_uint cl_program_info;
88typedef cl_uint cl_program_build_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010089#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +010090typedef cl_uint cl_program_binary_type;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010091#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010092typedef cl_int cl_build_status;
93typedef cl_uint cl_kernel_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010094#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +010095typedef cl_uint cl_kernel_arg_info;
96typedef cl_uint cl_kernel_arg_address_qualifier;
97typedef cl_uint cl_kernel_arg_access_qualifier;
98typedef cl_bitfield cl_kernel_arg_type_qualifier;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +010099#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100100typedef cl_uint cl_kernel_work_group_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100101#ifdef CL_VERSION_2_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000102typedef cl_uint cl_kernel_sub_group_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100103#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100104typedef cl_uint cl_event_info;
105typedef cl_uint cl_command_type;
106typedef cl_uint cl_profiling_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100107#ifdef CL_VERSION_2_0
Sheri Zhang79cb9452021-09-07 14:51:49 +0100108typedef cl_properties cl_sampler_properties;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000109typedef cl_uint cl_kernel_exec_info;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100110#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100111#ifdef CL_VERSION_3_0
Sheri Zhang67354e02021-06-30 16:08:29 +0100112typedef cl_bitfield cl_device_atomic_capabilities;
Sheri Zhang79cb9452021-09-07 14:51:49 +0100113typedef cl_bitfield cl_device_device_enqueue_capabilities;
114typedef cl_uint cl_khronos_vendor_id;
115typedef cl_properties cl_mem_properties;
116typedef cl_uint cl_version;
Sheri Zhang67354e02021-06-30 16:08:29 +0100117#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100118
119typedef struct _cl_image_format {
120 cl_channel_order image_channel_order;
121 cl_channel_type image_channel_data_type;
122} cl_image_format;
123
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100124#ifdef CL_VERSION_1_2
125
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100126typedef struct _cl_image_desc {
127 cl_mem_object_type image_type;
128 size_t image_width;
129 size_t image_height;
130 size_t image_depth;
131 size_t image_array_size;
132 size_t image_row_pitch;
133 size_t image_slice_pitch;
134 cl_uint num_mip_levels;
135 cl_uint num_samples;
Sheri Zhang67354e02021-06-30 16:08:29 +0100136#ifdef CL_VERSION_2_0
Sheri Zhang79cb9452021-09-07 14:51:49 +0100137#if defined(__GNUC__)
138 __extension__ /* Prevents warnings about anonymous union in -pedantic builds */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000139#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100140#if defined(_MSC_VER) && !defined(__STDC__)
Sheri Zhang67354e02021-06-30 16:08:29 +0100141#pragma warning( push )
Sheri Zhang79cb9452021-09-07 14:51:49 +0100142#pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 builds */
Sheri Zhang67354e02021-06-30 16:08:29 +0100143#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100144#if defined(_MSC_VER) && defined(__STDC__)
145 /* Anonymous unions are not supported in /Za builds */
146#else
Pablo Telloe86a09f2018-01-11 15:44:48 +0000147 union {
Sheri Zhang67354e02021-06-30 16:08:29 +0100148#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100149#endif
Pablo Telloe86a09f2018-01-11 15:44:48 +0000150 cl_mem buffer;
Sheri Zhang67354e02021-06-30 16:08:29 +0100151#ifdef CL_VERSION_2_0
Sheri Zhang79cb9452021-09-07 14:51:49 +0100152#if defined(_MSC_VER) && defined(__STDC__)
153 /* Anonymous unions are not supported in /Za builds */
154#else
Pablo Telloe86a09f2018-01-11 15:44:48 +0000155 cl_mem mem_object;
156 };
Sheri Zhang79cb9452021-09-07 14:51:49 +0100157#endif
158#if defined(_MSC_VER) && !defined(__STDC__)
Sheri Zhang67354e02021-06-30 16:08:29 +0100159#pragma warning( pop )
160#endif
161#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100162} cl_image_desc;
163
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100164#endif
165
166#ifdef CL_VERSION_1_1
167
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100168typedef struct _cl_buffer_region {
169 size_t origin;
170 size_t size;
171} cl_buffer_region;
172
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100173#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100174
Sheri Zhang79cb9452021-09-07 14:51:49 +0100175#ifdef CL_VERSION_3_0
176
177#define CL_NAME_VERSION_MAX_NAME_SIZE 64
178
179typedef struct _cl_name_version {
180 cl_version version;
181 char name[CL_NAME_VERSION_MAX_NAME_SIZE];
182} cl_name_version;
183
184#endif
185
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100186/******************************************************************************/
187
188/* Error Codes */
189#define CL_SUCCESS 0
190#define CL_DEVICE_NOT_FOUND -1
191#define CL_DEVICE_NOT_AVAILABLE -2
192#define CL_COMPILER_NOT_AVAILABLE -3
193#define CL_MEM_OBJECT_ALLOCATION_FAILURE -4
194#define CL_OUT_OF_RESOURCES -5
195#define CL_OUT_OF_HOST_MEMORY -6
196#define CL_PROFILING_INFO_NOT_AVAILABLE -7
197#define CL_MEM_COPY_OVERLAP -8
198#define CL_IMAGE_FORMAT_MISMATCH -9
199#define CL_IMAGE_FORMAT_NOT_SUPPORTED -10
200#define CL_BUILD_PROGRAM_FAILURE -11
201#define CL_MAP_FAILURE -12
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100202#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100203#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13
204#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100205#endif
206#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100207#define CL_COMPILE_PROGRAM_FAILURE -15
208#define CL_LINKER_NOT_AVAILABLE -16
209#define CL_LINK_PROGRAM_FAILURE -17
210#define CL_DEVICE_PARTITION_FAILED -18
211#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100212#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100213
214#define CL_INVALID_VALUE -30
215#define CL_INVALID_DEVICE_TYPE -31
216#define CL_INVALID_PLATFORM -32
217#define CL_INVALID_DEVICE -33
218#define CL_INVALID_CONTEXT -34
219#define CL_INVALID_QUEUE_PROPERTIES -35
220#define CL_INVALID_COMMAND_QUEUE -36
221#define CL_INVALID_HOST_PTR -37
222#define CL_INVALID_MEM_OBJECT -38
223#define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39
224#define CL_INVALID_IMAGE_SIZE -40
225#define CL_INVALID_SAMPLER -41
226#define CL_INVALID_BINARY -42
227#define CL_INVALID_BUILD_OPTIONS -43
228#define CL_INVALID_PROGRAM -44
229#define CL_INVALID_PROGRAM_EXECUTABLE -45
230#define CL_INVALID_KERNEL_NAME -46
231#define CL_INVALID_KERNEL_DEFINITION -47
232#define CL_INVALID_KERNEL -48
233#define CL_INVALID_ARG_INDEX -49
234#define CL_INVALID_ARG_VALUE -50
235#define CL_INVALID_ARG_SIZE -51
236#define CL_INVALID_KERNEL_ARGS -52
237#define CL_INVALID_WORK_DIMENSION -53
238#define CL_INVALID_WORK_GROUP_SIZE -54
239#define CL_INVALID_WORK_ITEM_SIZE -55
240#define CL_INVALID_GLOBAL_OFFSET -56
241#define CL_INVALID_EVENT_WAIT_LIST -57
242#define CL_INVALID_EVENT -58
243#define CL_INVALID_OPERATION -59
244#define CL_INVALID_GL_OBJECT -60
245#define CL_INVALID_BUFFER_SIZE -61
246#define CL_INVALID_MIP_LEVEL -62
247#define CL_INVALID_GLOBAL_WORK_SIZE -63
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100248#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100249#define CL_INVALID_PROPERTY -64
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100250#endif
251#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100252#define CL_INVALID_IMAGE_DESCRIPTOR -65
253#define CL_INVALID_COMPILER_OPTIONS -66
254#define CL_INVALID_LINKER_OPTIONS -67
255#define CL_INVALID_DEVICE_PARTITION_COUNT -68
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100256#endif
257#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000258#define CL_INVALID_PIPE_SIZE -69
259#define CL_INVALID_DEVICE_QUEUE -70
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100260#endif
261#ifdef CL_VERSION_2_2
Pablo Telloe86a09f2018-01-11 15:44:48 +0000262#define CL_INVALID_SPEC_ID -71
263#define CL_MAX_SIZE_RESTRICTION_EXCEEDED -72
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100264#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100265
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100266
267/* cl_bool */
268#define CL_FALSE 0
269#define CL_TRUE 1
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100270#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100271#define CL_BLOCKING CL_TRUE
272#define CL_NON_BLOCKING CL_FALSE
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100273#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100274
275/* cl_platform_info */
276#define CL_PLATFORM_PROFILE 0x0900
277#define CL_PLATFORM_VERSION 0x0901
278#define CL_PLATFORM_NAME 0x0902
279#define CL_PLATFORM_VENDOR 0x0903
280#define CL_PLATFORM_EXTENSIONS 0x0904
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100281#ifdef CL_VERSION_2_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000282#define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100283#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100284#ifdef CL_VERSION_3_0
285#define CL_PLATFORM_NUMERIC_VERSION 0x0906
286#define CL_PLATFORM_EXTENSIONS_WITH_VERSION 0x0907
287#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100288
289/* cl_device_type - bitfield */
290#define CL_DEVICE_TYPE_DEFAULT (1 << 0)
291#define CL_DEVICE_TYPE_CPU (1 << 1)
292#define CL_DEVICE_TYPE_GPU (1 << 2)
293#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100294#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100295#define CL_DEVICE_TYPE_CUSTOM (1 << 4)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100296#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100297#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
298
299/* cl_device_info */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000300#define CL_DEVICE_TYPE 0x1000
301#define CL_DEVICE_VENDOR_ID 0x1001
302#define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
303#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
304#define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
305#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
306#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
307#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
308#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
309#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009
310#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A
311#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B
312#define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C
313#define CL_DEVICE_ADDRESS_BITS 0x100D
314#define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E
315#define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F
316#define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010
317#define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011
318#define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012
319#define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013
320#define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014
321#define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015
322#define CL_DEVICE_IMAGE_SUPPORT 0x1016
323#define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017
324#define CL_DEVICE_MAX_SAMPLERS 0x1018
325#define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019
326#define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A
327#define CL_DEVICE_SINGLE_FP_CONFIG 0x101B
328#define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C
329#define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D
330#define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E
331#define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F
332#define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020
333#define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021
334#define CL_DEVICE_LOCAL_MEM_TYPE 0x1022
335#define CL_DEVICE_LOCAL_MEM_SIZE 0x1023
336#define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024
337#define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025
338#define CL_DEVICE_ENDIAN_LITTLE 0x1026
339#define CL_DEVICE_AVAILABLE 0x1027
340#define CL_DEVICE_COMPILER_AVAILABLE 0x1028
341#define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029
342#define CL_DEVICE_QUEUE_PROPERTIES 0x102A /* deprecated */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100343#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000344#define CL_DEVICE_QUEUE_ON_HOST_PROPERTIES 0x102A
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100345#endif
Pablo Telloe86a09f2018-01-11 15:44:48 +0000346#define CL_DEVICE_NAME 0x102B
347#define CL_DEVICE_VENDOR 0x102C
348#define CL_DRIVER_VERSION 0x102D
349#define CL_DEVICE_PROFILE 0x102E
350#define CL_DEVICE_VERSION 0x102F
351#define CL_DEVICE_EXTENSIONS 0x1030
352#define CL_DEVICE_PLATFORM 0x1031
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100353#ifdef CL_VERSION_1_2
Pablo Telloe86a09f2018-01-11 15:44:48 +0000354#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100355#endif
356/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG which is already defined in "cl_ext.h" */
357#ifdef CL_VERSION_1_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000358#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
359#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 /* deprecated */
360#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
361#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037
362#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038
363#define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039
364#define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A
365#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B
366#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C
367#define CL_DEVICE_OPENCL_C_VERSION 0x103D
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100368#endif
369#ifdef CL_VERSION_1_2
Pablo Telloe86a09f2018-01-11 15:44:48 +0000370#define CL_DEVICE_LINKER_AVAILABLE 0x103E
371#define CL_DEVICE_BUILT_IN_KERNELS 0x103F
372#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040
373#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041
374#define CL_DEVICE_PARENT_DEVICE 0x1042
375#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043
376#define CL_DEVICE_PARTITION_PROPERTIES 0x1044
377#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045
378#define CL_DEVICE_PARTITION_TYPE 0x1046
379#define CL_DEVICE_REFERENCE_COUNT 0x1047
380#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048
381#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100382#endif
383#ifdef CL_VERSION_2_0
Sheri Zhang67354e02021-06-30 16:08:29 +0100384#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
385#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
Pablo Telloe86a09f2018-01-11 15:44:48 +0000386#define CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS 0x104C
387#define CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE 0x104D
388#define CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES 0x104E
389#define CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE 0x104F
390#define CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE 0x1050
391#define CL_DEVICE_MAX_ON_DEVICE_QUEUES 0x1051
392#define CL_DEVICE_MAX_ON_DEVICE_EVENTS 0x1052
393#define CL_DEVICE_SVM_CAPABILITIES 0x1053
394#define CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE 0x1054
395#define CL_DEVICE_MAX_PIPE_ARGS 0x1055
396#define CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS 0x1056
397#define CL_DEVICE_PIPE_MAX_PACKET_SIZE 0x1057
398#define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT 0x1058
399#define CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT 0x1059
400#define CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT 0x105A
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100401#endif
402#ifdef CL_VERSION_2_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000403#define CL_DEVICE_IL_VERSION 0x105B
404#define CL_DEVICE_MAX_NUM_SUB_GROUPS 0x105C
405#define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100406#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100407#ifdef CL_VERSION_3_0
408#define CL_DEVICE_NUMERIC_VERSION 0x105E
409#define CL_DEVICE_EXTENSIONS_WITH_VERSION 0x1060
410#define CL_DEVICE_ILS_WITH_VERSION 0x1061
411#define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION 0x1062
412#define CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES 0x1063
413#define CL_DEVICE_ATOMIC_FENCE_CAPABILITIES 0x1064
414#define CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT 0x1065
415#define CL_DEVICE_OPENCL_C_ALL_VERSIONS 0x1066
416#define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x1067
417#define CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT 0x1068
418#define CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT 0x1069
419/* 0x106A to 0x106E - Reserved for upcoming KHR extension */
420#define CL_DEVICE_OPENCL_C_FEATURES 0x106F
421#define CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES 0x1070
422#define CL_DEVICE_PIPE_SUPPORT 0x1071
423#define CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED 0x1072
424#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100425
426/* cl_device_fp_config - bitfield */
427#define CL_FP_DENORM (1 << 0)
428#define CL_FP_INF_NAN (1 << 1)
429#define CL_FP_ROUND_TO_NEAREST (1 << 2)
430#define CL_FP_ROUND_TO_ZERO (1 << 3)
431#define CL_FP_ROUND_TO_INF (1 << 4)
432#define CL_FP_FMA (1 << 5)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100433#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100434#define CL_FP_SOFT_FLOAT (1 << 6)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100435#endif
436#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100437#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100438#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100439
440/* cl_device_mem_cache_type */
441#define CL_NONE 0x0
442#define CL_READ_ONLY_CACHE 0x1
443#define CL_READ_WRITE_CACHE 0x2
444
445/* cl_device_local_mem_type */
446#define CL_LOCAL 0x1
447#define CL_GLOBAL 0x2
448
449/* cl_device_exec_capabilities - bitfield */
450#define CL_EXEC_KERNEL (1 << 0)
451#define CL_EXEC_NATIVE_KERNEL (1 << 1)
452
453/* cl_command_queue_properties - bitfield */
454#define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
455#define CL_QUEUE_PROFILING_ENABLE (1 << 1)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100456#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000457#define CL_QUEUE_ON_DEVICE (1 << 2)
458#define CL_QUEUE_ON_DEVICE_DEFAULT (1 << 3)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100459#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100460
Sheri Zhang67354e02021-06-30 16:08:29 +0100461/* cl_context_info */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100462#define CL_CONTEXT_REFERENCE_COUNT 0x1080
463#define CL_CONTEXT_DEVICES 0x1081
464#define CL_CONTEXT_PROPERTIES 0x1082
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100465#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100466#define CL_CONTEXT_NUM_DEVICES 0x1083
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100467#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100468
469/* cl_context_properties */
470#define CL_CONTEXT_PLATFORM 0x1084
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100471#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100472#define CL_CONTEXT_INTEROP_USER_SYNC 0x1085
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100473#endif
474
475#ifdef CL_VERSION_1_2
476
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100477/* cl_device_partition_property */
478#define CL_DEVICE_PARTITION_EQUALLY 0x1086
479#define CL_DEVICE_PARTITION_BY_COUNTS 0x1087
480#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0
481#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100482
483#endif
484
485#ifdef CL_VERSION_1_2
486
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100487/* cl_device_affinity_domain */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000488#define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0)
489#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1)
490#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2)
491#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3)
492#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4)
493#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100494
495#endif
496
497#ifdef CL_VERSION_2_0
498
Pablo Telloe86a09f2018-01-11 15:44:48 +0000499/* cl_device_svm_capabilities */
500#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0)
501#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1)
502#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2)
503#define CL_DEVICE_SVM_ATOMICS (1 << 3)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100504
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100505#endif
506
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100507/* cl_command_queue_info */
508#define CL_QUEUE_CONTEXT 0x1090
509#define CL_QUEUE_DEVICE 0x1091
510#define CL_QUEUE_REFERENCE_COUNT 0x1092
511#define CL_QUEUE_PROPERTIES 0x1093
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100512#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000513#define CL_QUEUE_SIZE 0x1094
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100514#endif
515#ifdef CL_VERSION_2_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000516#define CL_QUEUE_DEVICE_DEFAULT 0x1095
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100517#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100518#ifdef CL_VERSION_3_0
519#define CL_QUEUE_PROPERTIES_ARRAY 0x1098
520#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100521
Pablo Telloe86a09f2018-01-11 15:44:48 +0000522/* cl_mem_flags and cl_svm_mem_flags - bitfield */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100523#define CL_MEM_READ_WRITE (1 << 0)
524#define CL_MEM_WRITE_ONLY (1 << 1)
525#define CL_MEM_READ_ONLY (1 << 2)
526#define CL_MEM_USE_HOST_PTR (1 << 3)
527#define CL_MEM_ALLOC_HOST_PTR (1 << 4)
528#define CL_MEM_COPY_HOST_PTR (1 << 5)
Pablo Telloe86a09f2018-01-11 15:44:48 +0000529/* reserved (1 << 6) */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100530#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100531#define CL_MEM_HOST_WRITE_ONLY (1 << 7)
532#define CL_MEM_HOST_READ_ONLY (1 << 8)
533#define CL_MEM_HOST_NO_ACCESS (1 << 9)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100534#endif
535#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000536#define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10) /* used by cl_svm_mem_flags only */
537#define CL_MEM_SVM_ATOMICS (1 << 11) /* used by cl_svm_mem_flags only */
538#define CL_MEM_KERNEL_READ_AND_WRITE (1 << 12)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100539#endif
540
541#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100542
543/* cl_mem_migration_flags - bitfield */
544#define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0)
545#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1)
546
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100547#endif
548
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100549/* cl_channel_order */
550#define CL_R 0x10B0
551#define CL_A 0x10B1
552#define CL_RG 0x10B2
553#define CL_RA 0x10B3
554#define CL_RGB 0x10B4
555#define CL_RGBA 0x10B5
556#define CL_BGRA 0x10B6
557#define CL_ARGB 0x10B7
558#define CL_INTENSITY 0x10B8
559#define CL_LUMINANCE 0x10B9
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100560#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100561#define CL_Rx 0x10BA
562#define CL_RGx 0x10BB
563#define CL_RGBx 0x10BC
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100564#endif
565#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100566#define CL_DEPTH 0x10BD
567#define CL_DEPTH_STENCIL 0x10BE
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100568#endif
569#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000570#define CL_sRGB 0x10BF
571#define CL_sRGBx 0x10C0
572#define CL_sRGBA 0x10C1
573#define CL_sBGRA 0x10C2
574#define CL_ABGR 0x10C3
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100575#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100576
577/* cl_channel_type */
578#define CL_SNORM_INT8 0x10D0
579#define CL_SNORM_INT16 0x10D1
580#define CL_UNORM_INT8 0x10D2
581#define CL_UNORM_INT16 0x10D3
582#define CL_UNORM_SHORT_565 0x10D4
583#define CL_UNORM_SHORT_555 0x10D5
584#define CL_UNORM_INT_101010 0x10D6
585#define CL_SIGNED_INT8 0x10D7
586#define CL_SIGNED_INT16 0x10D8
587#define CL_SIGNED_INT32 0x10D9
588#define CL_UNSIGNED_INT8 0x10DA
589#define CL_UNSIGNED_INT16 0x10DB
590#define CL_UNSIGNED_INT32 0x10DC
591#define CL_HALF_FLOAT 0x10DD
592#define CL_FLOAT 0x10DE
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100593#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100594#define CL_UNORM_INT24 0x10DF
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100595#endif
596#ifdef CL_VERSION_2_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000597#define CL_UNORM_INT_101010_2 0x10E0
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100598#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100599
600/* cl_mem_object_type */
601#define CL_MEM_OBJECT_BUFFER 0x10F0
602#define CL_MEM_OBJECT_IMAGE2D 0x10F1
603#define CL_MEM_OBJECT_IMAGE3D 0x10F2
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100604#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100605#define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3
606#define CL_MEM_OBJECT_IMAGE1D 0x10F4
607#define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5
608#define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100609#endif
610#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000611#define CL_MEM_OBJECT_PIPE 0x10F7
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100612#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100613
614/* cl_mem_info */
615#define CL_MEM_TYPE 0x1100
616#define CL_MEM_FLAGS 0x1101
617#define CL_MEM_SIZE 0x1102
618#define CL_MEM_HOST_PTR 0x1103
619#define CL_MEM_MAP_COUNT 0x1104
620#define CL_MEM_REFERENCE_COUNT 0x1105
621#define CL_MEM_CONTEXT 0x1106
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100622#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100623#define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107
624#define CL_MEM_OFFSET 0x1108
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100625#endif
626#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000627#define CL_MEM_USES_SVM_POINTER 0x1109
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100628#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100629#ifdef CL_VERSION_3_0
630#define CL_MEM_PROPERTIES 0x110A
631#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100632
633/* cl_image_info */
634#define CL_IMAGE_FORMAT 0x1110
635#define CL_IMAGE_ELEMENT_SIZE 0x1111
636#define CL_IMAGE_ROW_PITCH 0x1112
637#define CL_IMAGE_SLICE_PITCH 0x1113
638#define CL_IMAGE_WIDTH 0x1114
639#define CL_IMAGE_HEIGHT 0x1115
640#define CL_IMAGE_DEPTH 0x1116
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100641#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100642#define CL_IMAGE_ARRAY_SIZE 0x1117
643#define CL_IMAGE_BUFFER 0x1118
644#define CL_IMAGE_NUM_MIP_LEVELS 0x1119
645#define CL_IMAGE_NUM_SAMPLES 0x111A
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100646#endif
647
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100648
Pablo Telloe86a09f2018-01-11 15:44:48 +0000649/* cl_pipe_info */
Sheri Zhang79cb9452021-09-07 14:51:49 +0100650#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000651#define CL_PIPE_PACKET_SIZE 0x1120
652#define CL_PIPE_MAX_PACKETS 0x1121
Sheri Zhang79cb9452021-09-07 14:51:49 +0100653#endif
654#ifdef CL_VERSION_3_0
655#define CL_PIPE_PROPERTIES 0x1122
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100656#endif
657
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100658/* cl_addressing_mode */
659#define CL_ADDRESS_NONE 0x1130
660#define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
661#define CL_ADDRESS_CLAMP 0x1132
662#define CL_ADDRESS_REPEAT 0x1133
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100663#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100664#define CL_ADDRESS_MIRRORED_REPEAT 0x1134
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100665#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100666
667/* cl_filter_mode */
668#define CL_FILTER_NEAREST 0x1140
669#define CL_FILTER_LINEAR 0x1141
670
671/* cl_sampler_info */
672#define CL_SAMPLER_REFERENCE_COUNT 0x1150
673#define CL_SAMPLER_CONTEXT 0x1151
674#define CL_SAMPLER_NORMALIZED_COORDS 0x1152
675#define CL_SAMPLER_ADDRESSING_MODE 0x1153
676#define CL_SAMPLER_FILTER_MODE 0x1154
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100677#ifdef CL_VERSION_2_0
Sheri Zhang67354e02021-06-30 16:08:29 +0100678/* These enumerants are for the cl_khr_mipmap_image extension.
679 They have since been added to cl_ext.h with an appropriate
680 KHR suffix, but are left here for backwards compatibility. */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000681#define CL_SAMPLER_MIP_FILTER_MODE 0x1155
682#define CL_SAMPLER_LOD_MIN 0x1156
683#define CL_SAMPLER_LOD_MAX 0x1157
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100684#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100685#ifdef CL_VERSION_3_0
686#define CL_SAMPLER_PROPERTIES 0x1158
687#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100688
689/* cl_map_flags - bitfield */
690#define CL_MAP_READ (1 << 0)
691#define CL_MAP_WRITE (1 << 1)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100692#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100693#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100694#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100695
696/* cl_program_info */
697#define CL_PROGRAM_REFERENCE_COUNT 0x1160
698#define CL_PROGRAM_CONTEXT 0x1161
699#define CL_PROGRAM_NUM_DEVICES 0x1162
700#define CL_PROGRAM_DEVICES 0x1163
701#define CL_PROGRAM_SOURCE 0x1164
702#define CL_PROGRAM_BINARY_SIZES 0x1165
703#define CL_PROGRAM_BINARIES 0x1166
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100704#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100705#define CL_PROGRAM_NUM_KERNELS 0x1167
706#define CL_PROGRAM_KERNEL_NAMES 0x1168
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100707#endif
708#ifdef CL_VERSION_2_1
Pablo Telloe86a09f2018-01-11 15:44:48 +0000709#define CL_PROGRAM_IL 0x1169
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100710#endif
711#ifdef CL_VERSION_2_2
Pablo Telloe86a09f2018-01-11 15:44:48 +0000712#define CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT 0x116A
713#define CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT 0x116B
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100714#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100715
716/* cl_program_build_info */
717#define CL_PROGRAM_BUILD_STATUS 0x1181
718#define CL_PROGRAM_BUILD_OPTIONS 0x1182
719#define CL_PROGRAM_BUILD_LOG 0x1183
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100720#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100721#define CL_PROGRAM_BINARY_TYPE 0x1184
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100722#endif
723#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000724#define CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE 0x1185
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100725#endif
726
727#ifdef CL_VERSION_1_2
728
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100729/* cl_program_binary_type */
730#define CL_PROGRAM_BINARY_TYPE_NONE 0x0
731#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1
732#define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2
733#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4
734
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100735#endif
736
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100737/* cl_build_status */
738#define CL_BUILD_SUCCESS 0
739#define CL_BUILD_NONE -1
740#define CL_BUILD_ERROR -2
741#define CL_BUILD_IN_PROGRESS -3
742
743/* cl_kernel_info */
744#define CL_KERNEL_FUNCTION_NAME 0x1190
745#define CL_KERNEL_NUM_ARGS 0x1191
746#define CL_KERNEL_REFERENCE_COUNT 0x1192
747#define CL_KERNEL_CONTEXT 0x1193
748#define CL_KERNEL_PROGRAM 0x1194
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100749#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100750#define CL_KERNEL_ATTRIBUTES 0x1195
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100751#endif
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100752
753#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100754
755/* cl_kernel_arg_info */
756#define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196
757#define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197
758#define CL_KERNEL_ARG_TYPE_NAME 0x1198
759#define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199
760#define CL_KERNEL_ARG_NAME 0x119A
761
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100762#endif
763
764#ifdef CL_VERSION_1_2
765
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100766/* cl_kernel_arg_address_qualifier */
767#define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B
768#define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C
769#define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D
770#define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E
771
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100772#endif
773
774#ifdef CL_VERSION_1_2
775
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100776/* cl_kernel_arg_access_qualifier */
777#define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0
778#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1
779#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
780#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100781
782#endif
783
784#ifdef CL_VERSION_1_2
785
Pablo Telloe86a09f2018-01-11 15:44:48 +0000786/* cl_kernel_arg_type_qualifier */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100787#define CL_KERNEL_ARG_TYPE_NONE 0
788#define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
789#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
790#define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100791#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000792#define CL_KERNEL_ARG_TYPE_PIPE (1 << 3)
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100793#endif
794
795#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100796
797/* cl_kernel_work_group_info */
798#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
799#define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
800#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
801#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
802#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100803#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100804#define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100805#endif
806
807#ifdef CL_VERSION_2_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100808
Pablo Telloe86a09f2018-01-11 15:44:48 +0000809/* cl_kernel_sub_group_info */
810#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE 0x2033
811#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE 0x2034
812#define CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT 0x11B8
Sheri Zhang67354e02021-06-30 16:08:29 +0100813#define CL_KERNEL_MAX_NUM_SUB_GROUPS 0x11B9
814#define CL_KERNEL_COMPILE_NUM_SUB_GROUPS 0x11BA
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100815
816#endif
817
818#ifdef CL_VERSION_2_0
819
Pablo Telloe86a09f2018-01-11 15:44:48 +0000820/* cl_kernel_exec_info */
821#define CL_KERNEL_EXEC_INFO_SVM_PTRS 0x11B6
822#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM 0x11B7
823
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100824#endif
825
Sheri Zhang67354e02021-06-30 16:08:29 +0100826/* cl_event_info */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100827#define CL_EVENT_COMMAND_QUEUE 0x11D0
828#define CL_EVENT_COMMAND_TYPE 0x11D1
829#define CL_EVENT_REFERENCE_COUNT 0x11D2
830#define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100831#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100832#define CL_EVENT_CONTEXT 0x11D4
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100833#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100834
835/* cl_command_type */
836#define CL_COMMAND_NDRANGE_KERNEL 0x11F0
837#define CL_COMMAND_TASK 0x11F1
838#define CL_COMMAND_NATIVE_KERNEL 0x11F2
839#define CL_COMMAND_READ_BUFFER 0x11F3
840#define CL_COMMAND_WRITE_BUFFER 0x11F4
841#define CL_COMMAND_COPY_BUFFER 0x11F5
842#define CL_COMMAND_READ_IMAGE 0x11F6
843#define CL_COMMAND_WRITE_IMAGE 0x11F7
844#define CL_COMMAND_COPY_IMAGE 0x11F8
845#define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
846#define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
847#define CL_COMMAND_MAP_BUFFER 0x11FB
848#define CL_COMMAND_MAP_IMAGE 0x11FC
849#define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
850#define CL_COMMAND_MARKER 0x11FE
851#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
852#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100853#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100854#define CL_COMMAND_READ_BUFFER_RECT 0x1201
855#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
856#define CL_COMMAND_COPY_BUFFER_RECT 0x1203
857#define CL_COMMAND_USER 0x1204
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100858#endif
859#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100860#define CL_COMMAND_BARRIER 0x1205
861#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
862#define CL_COMMAND_FILL_BUFFER 0x1207
863#define CL_COMMAND_FILL_IMAGE 0x1208
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100864#endif
865#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000866#define CL_COMMAND_SVM_FREE 0x1209
867#define CL_COMMAND_SVM_MEMCPY 0x120A
868#define CL_COMMAND_SVM_MEMFILL 0x120B
869#define CL_COMMAND_SVM_MAP 0x120C
870#define CL_COMMAND_SVM_UNMAP 0x120D
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100871#endif
Sheri Zhang79cb9452021-09-07 14:51:49 +0100872#ifdef CL_VERSION_3_0
873#define CL_COMMAND_SVM_MIGRATE_MEM 0x120E
874#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100875
876/* command execution status */
877#define CL_COMPLETE 0x0
878#define CL_RUNNING 0x1
879#define CL_SUBMITTED 0x2
880#define CL_QUEUED 0x3
881
Sheri Zhang67354e02021-06-30 16:08:29 +0100882/* cl_buffer_create_type */
Sheri Zhang79cb9452021-09-07 14:51:49 +0100883#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100884#define CL_BUFFER_CREATE_TYPE_REGION 0x1220
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100885#endif
886
Sheri Zhang67354e02021-06-30 16:08:29 +0100887/* cl_profiling_info */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100888#define CL_PROFILING_COMMAND_QUEUED 0x1280
889#define CL_PROFILING_COMMAND_SUBMIT 0x1281
890#define CL_PROFILING_COMMAND_START 0x1282
891#define CL_PROFILING_COMMAND_END 0x1283
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100892#ifdef CL_VERSION_2_0
Pablo Telloe86a09f2018-01-11 15:44:48 +0000893#define CL_PROFILING_COMMAND_COMPLETE 0x1284
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100894#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100895
Sheri Zhang67354e02021-06-30 16:08:29 +0100896/* cl_device_atomic_capabilities - bitfield */
Sheri Zhang79cb9452021-09-07 14:51:49 +0100897#ifdef CL_VERSION_3_0
Sheri Zhang67354e02021-06-30 16:08:29 +0100898#define CL_DEVICE_ATOMIC_ORDER_RELAXED (1 << 0)
899#define CL_DEVICE_ATOMIC_ORDER_ACQ_REL (1 << 1)
900#define CL_DEVICE_ATOMIC_ORDER_SEQ_CST (1 << 2)
901#define CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM (1 << 3)
902#define CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP (1 << 4)
903#define CL_DEVICE_ATOMIC_SCOPE_DEVICE (1 << 5)
Sheri Zhang79cb9452021-09-07 14:51:49 +0100904#define CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES (1 << 6)
905#endif
Sheri Zhang67354e02021-06-30 16:08:29 +0100906
Sheri Zhang79cb9452021-09-07 14:51:49 +0100907/* cl_device_device_enqueue_capabilities - bitfield */
908#ifdef CL_VERSION_3_0
909#define CL_DEVICE_QUEUE_SUPPORTED (1 << 0)
910#define CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT (1 << 1)
911#endif
Sheri Zhang67354e02021-06-30 16:08:29 +0100912
Sheri Zhang79cb9452021-09-07 14:51:49 +0100913/* cl_khronos_vendor_id */
914#define CL_KHRONOS_VENDOR_ID_CODEPLAY 0x10004
915
916#ifdef CL_VERSION_3_0
917
918/* cl_version */
919#define CL_VERSION_MAJOR_BITS (10)
920#define CL_VERSION_MINOR_BITS (10)
921#define CL_VERSION_PATCH_BITS (12)
922
923#define CL_VERSION_MAJOR_MASK ((1 << CL_VERSION_MAJOR_BITS) - 1)
924#define CL_VERSION_MINOR_MASK ((1 << CL_VERSION_MINOR_BITS) - 1)
925#define CL_VERSION_PATCH_MASK ((1 << CL_VERSION_PATCH_BITS) - 1)
926
927#define CL_VERSION_MAJOR(version) \
928 ((version) >> (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS))
929
930#define CL_VERSION_MINOR(version) \
931 (((version) >> CL_VERSION_PATCH_BITS) & CL_VERSION_MINOR_MASK)
932
933#define CL_VERSION_PATCH(version) ((version) & CL_VERSION_PATCH_MASK)
934
935#define CL_MAKE_VERSION(major, minor, patch) \
936 ((((major) & CL_VERSION_MAJOR_MASK) \
937 << (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) | \
938 (((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \
939 ((patch) & CL_VERSION_PATCH_MASK))
Sheri Zhang67354e02021-06-30 16:08:29 +0100940
941#endif
942
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100943/********************************************************************************************************/
944
945/* Platform API */
946extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100947clGetPlatformIDs(cl_uint num_entries,
948 cl_platform_id * platforms,
949 cl_uint * num_platforms) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100950
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100951extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100952clGetPlatformInfo(cl_platform_id platform,
953 cl_platform_info param_name,
954 size_t param_value_size,
955 void * param_value,
956 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100957
958/* Device APIs */
959extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100960clGetDeviceIDs(cl_platform_id platform,
961 cl_device_type device_type,
962 cl_uint num_entries,
963 cl_device_id * devices,
964 cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100965
966extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100967clGetDeviceInfo(cl_device_id device,
968 cl_device_info param_name,
969 size_t param_value_size,
970 void * param_value,
971 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100972
973#ifdef CL_VERSION_1_2
974
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100975extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100976clCreateSubDevices(cl_device_id in_device,
977 const cl_device_partition_property * properties,
978 cl_uint num_devices,
979 cl_device_id * out_devices,
980 cl_uint * num_devices_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100981
982extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100983clRetainDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100984
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100985extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100986clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000987
Anthony Barbier8b2fdc92018-08-09 11:42:38 +0100988#endif
989
990#ifdef CL_VERSION_2_1
991
Pablo Telloe86a09f2018-01-11 15:44:48 +0000992extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100993clSetDefaultDeviceCommandQueue(cl_context context,
994 cl_device_id device,
995 cl_command_queue command_queue) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000996
997extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100998clGetDeviceAndHostTimer(cl_device_id device,
999 cl_ulong* device_timestamp,
1000 cl_ulong* host_timestamp) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001001
1002extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001003clGetHostTimer(cl_device_id device,
1004 cl_ulong * host_timestamp) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001005
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001006#endif
1007
Sheri Zhang67354e02021-06-30 16:08:29 +01001008/* Context APIs */
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001009extern CL_API_ENTRY cl_context CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001010clCreateContext(const cl_context_properties * properties,
1011 cl_uint num_devices,
1012 const cl_device_id * devices,
1013 void (CL_CALLBACK * pfn_notify)(const char * errinfo,
1014 const void * private_info,
1015 size_t cb,
1016 void * user_data),
1017 void * user_data,
1018 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001019
1020extern CL_API_ENTRY cl_context CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001021clCreateContextFromType(const cl_context_properties * properties,
1022 cl_device_type device_type,
1023 void (CL_CALLBACK * pfn_notify)(const char * errinfo,
1024 const void * private_info,
1025 size_t cb,
1026 void * user_data),
1027 void * user_data,
1028 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001029
1030extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001031clRetainContext(cl_context context) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001032
1033extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001034clReleaseContext(cl_context context) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001035
1036extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001037clGetContextInfo(cl_context context,
1038 cl_context_info param_name,
1039 size_t param_value_size,
1040 void * param_value,
1041 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001042
Sheri Zhang79cb9452021-09-07 14:51:49 +01001043#ifdef CL_VERSION_3_0
1044
1045extern CL_API_ENTRY cl_int CL_API_CALL
1046clSetContextDestructorCallback(cl_context context,
1047 void (CL_CALLBACK* pfn_notify)(cl_context context,
1048 void* user_data),
1049 void* user_data) CL_API_SUFFIX__VERSION_3_0;
1050
1051#endif
1052
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001053/* Command Queue APIs */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001054
1055#ifdef CL_VERSION_2_0
1056
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001057extern CL_API_ENTRY cl_command_queue CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001058clCreateCommandQueueWithProperties(cl_context context,
1059 cl_device_id device,
1060 const cl_queue_properties * properties,
1061 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001062
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001063#endif
1064
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001065extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001066clRetainCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001067
1068extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001069clReleaseCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001070
1071extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001072clGetCommandQueueInfo(cl_command_queue command_queue,
1073 cl_command_queue_info param_name,
1074 size_t param_value_size,
1075 void * param_value,
1076 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001077
1078/* Memory Object APIs */
1079extern CL_API_ENTRY cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001080clCreateBuffer(cl_context context,
1081 cl_mem_flags flags,
1082 size_t size,
1083 void * host_ptr,
1084 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001085
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001086#ifdef CL_VERSION_1_1
1087
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001088extern CL_API_ENTRY cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001089clCreateSubBuffer(cl_mem buffer,
1090 cl_mem_flags flags,
1091 cl_buffer_create_type buffer_create_type,
1092 const void * buffer_create_info,
1093 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001094
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001095#endif
1096
1097#ifdef CL_VERSION_1_2
1098
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001099extern CL_API_ENTRY cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001100clCreateImage(cl_context context,
1101 cl_mem_flags flags,
1102 const cl_image_format * image_format,
1103 const cl_image_desc * image_desc,
1104 void * host_ptr,
1105 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001106
1107#endif
1108
1109#ifdef CL_VERSION_2_0
1110
Pablo Telloe86a09f2018-01-11 15:44:48 +00001111extern CL_API_ENTRY cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001112clCreatePipe(cl_context context,
1113 cl_mem_flags flags,
1114 cl_uint pipe_packet_size,
1115 cl_uint pipe_max_packets,
1116 const cl_pipe_properties * properties,
1117 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001118
1119#endif
1120
Sheri Zhang79cb9452021-09-07 14:51:49 +01001121#ifdef CL_VERSION_3_0
1122
1123extern CL_API_ENTRY cl_mem CL_API_CALL
1124clCreateBufferWithProperties(cl_context context,
1125 const cl_mem_properties * properties,
1126 cl_mem_flags flags,
1127 size_t size,
1128 void * host_ptr,
1129 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_3_0;
1130
1131extern CL_API_ENTRY cl_mem CL_API_CALL
1132clCreateImageWithProperties(cl_context context,
1133 const cl_mem_properties * properties,
1134 cl_mem_flags flags,
1135 const cl_image_format * image_format,
1136 const cl_image_desc * image_desc,
1137 void * host_ptr,
1138 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_3_0;
1139
1140#endif
1141
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001142extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001143clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001144
1145extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001146clReleaseMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001147
1148extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001149clGetSupportedImageFormats(cl_context context,
1150 cl_mem_flags flags,
1151 cl_mem_object_type image_type,
1152 cl_uint num_entries,
1153 cl_image_format * image_formats,
1154 cl_uint * num_image_formats) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001155
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001156extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001157clGetMemObjectInfo(cl_mem memobj,
1158 cl_mem_info param_name,
1159 size_t param_value_size,
1160 void * param_value,
1161 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001162
1163extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001164clGetImageInfo(cl_mem image,
1165 cl_image_info param_name,
1166 size_t param_value_size,
1167 void * param_value,
1168 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001169
1170#ifdef CL_VERSION_2_0
1171
Pablo Telloe86a09f2018-01-11 15:44:48 +00001172extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001173clGetPipeInfo(cl_mem pipe,
1174 cl_pipe_info param_name,
1175 size_t param_value_size,
1176 void * param_value,
1177 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001178
1179#endif
1180
1181#ifdef CL_VERSION_1_1
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001182
1183extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001184clSetMemObjectDestructorCallback(cl_mem memobj,
1185 void (CL_CALLBACK * pfn_notify)(cl_mem memobj,
1186 void * user_data),
1187 void * user_data) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001188
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001189#endif
1190
Pablo Telloe86a09f2018-01-11 15:44:48 +00001191/* SVM Allocation APIs */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001192
1193#ifdef CL_VERSION_2_0
1194
Pablo Telloe86a09f2018-01-11 15:44:48 +00001195extern CL_API_ENTRY void * CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001196clSVMAlloc(cl_context context,
1197 cl_svm_mem_flags flags,
1198 size_t size,
1199 cl_uint alignment) CL_API_SUFFIX__VERSION_2_0;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001200
1201extern CL_API_ENTRY void CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001202clSVMFree(cl_context context,
1203 void * svm_pointer) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001204
1205#endif
1206
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001207/* Sampler APIs */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001208
1209#ifdef CL_VERSION_2_0
1210
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001211extern CL_API_ENTRY cl_sampler CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001212clCreateSamplerWithProperties(cl_context context,
1213 const cl_sampler_properties * sampler_properties,
1214 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001215
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001216#endif
1217
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001218extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001219clRetainSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001220
1221extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001222clReleaseSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001223
1224extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001225clGetSamplerInfo(cl_sampler sampler,
1226 cl_sampler_info param_name,
1227 size_t param_value_size,
1228 void * param_value,
1229 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001230
Sheri Zhang67354e02021-06-30 16:08:29 +01001231/* Program Object APIs */
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001232extern CL_API_ENTRY cl_program CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001233clCreateProgramWithSource(cl_context context,
1234 cl_uint count,
1235 const char ** strings,
1236 const size_t * lengths,
1237 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001238
1239extern CL_API_ENTRY cl_program CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001240clCreateProgramWithBinary(cl_context context,
1241 cl_uint num_devices,
1242 const cl_device_id * device_list,
1243 const size_t * lengths,
1244 const unsigned char ** binaries,
1245 cl_int * binary_status,
1246 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001247
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001248#ifdef CL_VERSION_1_2
1249
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001250extern CL_API_ENTRY cl_program CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001251clCreateProgramWithBuiltInKernels(cl_context context,
1252 cl_uint num_devices,
1253 const cl_device_id * device_list,
1254 const char * kernel_names,
1255 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001256
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001257#endif
1258
1259#ifdef CL_VERSION_2_1
1260
Pablo Telloe86a09f2018-01-11 15:44:48 +00001261extern CL_API_ENTRY cl_program CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001262clCreateProgramWithIL(cl_context context,
1263 const void* il,
1264 size_t length,
1265 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001266
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001267#endif
Pablo Telloe86a09f2018-01-11 15:44:48 +00001268
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001269extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001270clRetainProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001271
1272extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001273clReleaseProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001274
1275extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001276clBuildProgram(cl_program program,
1277 cl_uint num_devices,
1278 const cl_device_id * device_list,
1279 const char * options,
1280 void (CL_CALLBACK * pfn_notify)(cl_program program,
1281 void * user_data),
1282 void * user_data) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001283
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001284#ifdef CL_VERSION_1_2
1285
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001286extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001287clCompileProgram(cl_program program,
1288 cl_uint num_devices,
1289 const cl_device_id * device_list,
1290 const char * options,
1291 cl_uint num_input_headers,
1292 const cl_program * input_headers,
1293 const char ** header_include_names,
1294 void (CL_CALLBACK * pfn_notify)(cl_program program,
1295 void * user_data),
1296 void * user_data) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001297
1298extern CL_API_ENTRY cl_program CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001299clLinkProgram(cl_context context,
1300 cl_uint num_devices,
1301 const cl_device_id * device_list,
1302 const char * options,
1303 cl_uint num_input_programs,
1304 const cl_program * input_programs,
1305 void (CL_CALLBACK * pfn_notify)(cl_program program,
1306 void * user_data),
1307 void * user_data,
1308 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001309
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001310#endif
1311
1312#ifdef CL_VERSION_2_2
1313
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001314extern CL_API_ENTRY CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001315clSetProgramReleaseCallback(cl_program program,
1316 void (CL_CALLBACK * pfn_notify)(cl_program program,
1317 void * user_data),
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001318 void * user_data) CL_API_SUFFIX__VERSION_2_2_DEPRECATED;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001319
1320extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001321clSetProgramSpecializationConstant(cl_program program,
1322 cl_uint spec_id,
1323 size_t spec_size,
1324 const void* spec_value) CL_API_SUFFIX__VERSION_2_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001325
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001326#endif
1327
1328#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001329
1330extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001331clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001332
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001333#endif
1334
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001335extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001336clGetProgramInfo(cl_program program,
1337 cl_program_info param_name,
1338 size_t param_value_size,
1339 void * param_value,
1340 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001341
1342extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001343clGetProgramBuildInfo(cl_program program,
1344 cl_device_id device,
1345 cl_program_build_info param_name,
1346 size_t param_value_size,
1347 void * param_value,
1348 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001349
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001350/* Kernel Object APIs */
1351extern CL_API_ENTRY cl_kernel CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001352clCreateKernel(cl_program program,
1353 const char * kernel_name,
1354 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001355
1356extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001357clCreateKernelsInProgram(cl_program program,
1358 cl_uint num_kernels,
1359 cl_kernel * kernels,
1360 cl_uint * num_kernels_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001361
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001362#ifdef CL_VERSION_2_1
1363
Pablo Telloe86a09f2018-01-11 15:44:48 +00001364extern CL_API_ENTRY cl_kernel CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001365clCloneKernel(cl_kernel source_kernel,
1366 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001367
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001368#endif
1369
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001370extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001371clRetainKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001372
1373extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001374clReleaseKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001375
1376extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001377clSetKernelArg(cl_kernel kernel,
1378 cl_uint arg_index,
1379 size_t arg_size,
1380 const void * arg_value) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001381
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001382#ifdef CL_VERSION_2_0
1383
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001384extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001385clSetKernelArgSVMPointer(cl_kernel kernel,
1386 cl_uint arg_index,
1387 const void * arg_value) CL_API_SUFFIX__VERSION_2_0;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001388
1389extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001390clSetKernelExecInfo(cl_kernel kernel,
1391 cl_kernel_exec_info param_name,
1392 size_t param_value_size,
1393 const void * param_value) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001394
1395#endif
1396
Pablo Telloe86a09f2018-01-11 15:44:48 +00001397extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001398clGetKernelInfo(cl_kernel kernel,
1399 cl_kernel_info param_name,
1400 size_t param_value_size,
1401 void * param_value,
1402 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001403
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001404#ifdef CL_VERSION_1_2
1405
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001406extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001407clGetKernelArgInfo(cl_kernel kernel,
1408 cl_uint arg_indx,
1409 cl_kernel_arg_info param_name,
1410 size_t param_value_size,
1411 void * param_value,
1412 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001413
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001414#endif
1415
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001416extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001417clGetKernelWorkGroupInfo(cl_kernel kernel,
1418 cl_device_id device,
1419 cl_kernel_work_group_info param_name,
1420 size_t param_value_size,
1421 void * param_value,
1422 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001423
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001424#ifdef CL_VERSION_2_1
1425
Pablo Telloe86a09f2018-01-11 15:44:48 +00001426extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001427clGetKernelSubGroupInfo(cl_kernel kernel,
1428 cl_device_id device,
1429 cl_kernel_sub_group_info param_name,
1430 size_t input_value_size,
1431 const void* input_value,
1432 size_t param_value_size,
1433 void* param_value,
1434 size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001435
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001436#endif
Pablo Telloe86a09f2018-01-11 15:44:48 +00001437
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001438/* Event Object APIs */
1439extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001440clWaitForEvents(cl_uint num_events,
1441 const cl_event * event_list) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001442
1443extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001444clGetEventInfo(cl_event event,
1445 cl_event_info param_name,
1446 size_t param_value_size,
1447 void * param_value,
1448 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001449
1450#ifdef CL_VERSION_1_1
1451
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001452extern CL_API_ENTRY cl_event CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001453clCreateUserEvent(cl_context context,
1454 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001455
1456#endif
1457
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001458extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001459clRetainEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001460
1461extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001462clReleaseEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001463
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001464#ifdef CL_VERSION_1_1
1465
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001466extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001467clSetUserEventStatus(cl_event event,
1468 cl_int execution_status) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001469
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001470extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001471clSetEventCallback(cl_event event,
1472 cl_int command_exec_callback_type,
1473 void (CL_CALLBACK * pfn_notify)(cl_event event,
1474 cl_int event_command_status,
1475 void * user_data),
1476 void * user_data) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001477
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001478#endif
1479
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001480/* Profiling APIs */
1481extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001482clGetEventProfilingInfo(cl_event event,
1483 cl_profiling_info param_name,
1484 size_t param_value_size,
1485 void * param_value,
1486 size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001487
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001488/* Flush and Finish APIs */
1489extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001490clFlush(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001491
1492extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001493clFinish(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001494
1495/* Enqueued Commands APIs */
1496extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001497clEnqueueReadBuffer(cl_command_queue command_queue,
1498 cl_mem buffer,
1499 cl_bool blocking_read,
1500 size_t offset,
1501 size_t size,
1502 void * ptr,
1503 cl_uint num_events_in_wait_list,
1504 const cl_event * event_wait_list,
1505 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001506
1507#ifdef CL_VERSION_1_1
1508
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001509extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001510clEnqueueReadBufferRect(cl_command_queue command_queue,
1511 cl_mem buffer,
1512 cl_bool blocking_read,
Sheri Zhang79cb9452021-09-07 14:51:49 +01001513 const size_t * buffer_origin,
1514 const size_t * host_origin,
Sheri Zhang67354e02021-06-30 16:08:29 +01001515 const size_t * region,
1516 size_t buffer_row_pitch,
1517 size_t buffer_slice_pitch,
1518 size_t host_row_pitch,
1519 size_t host_slice_pitch,
1520 void * ptr,
1521 cl_uint num_events_in_wait_list,
1522 const cl_event * event_wait_list,
1523 cl_event * event) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001524
1525#endif
1526
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001527extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001528clEnqueueWriteBuffer(cl_command_queue command_queue,
1529 cl_mem buffer,
1530 cl_bool blocking_write,
1531 size_t offset,
1532 size_t size,
1533 const void * ptr,
1534 cl_uint num_events_in_wait_list,
1535 const cl_event * event_wait_list,
1536 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001537
1538#ifdef CL_VERSION_1_1
1539
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001540extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001541clEnqueueWriteBufferRect(cl_command_queue command_queue,
1542 cl_mem buffer,
1543 cl_bool blocking_write,
Sheri Zhang79cb9452021-09-07 14:51:49 +01001544 const size_t * buffer_origin,
1545 const size_t * host_origin,
Sheri Zhang67354e02021-06-30 16:08:29 +01001546 const size_t * region,
1547 size_t buffer_row_pitch,
1548 size_t buffer_slice_pitch,
1549 size_t host_row_pitch,
1550 size_t host_slice_pitch,
1551 const void * ptr,
1552 cl_uint num_events_in_wait_list,
1553 const cl_event * event_wait_list,
1554 cl_event * event) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001555
1556#endif
1557
1558#ifdef CL_VERSION_1_2
1559
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001560extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001561clEnqueueFillBuffer(cl_command_queue command_queue,
1562 cl_mem buffer,
1563 const void * pattern,
1564 size_t pattern_size,
1565 size_t offset,
1566 size_t size,
1567 cl_uint num_events_in_wait_list,
1568 const cl_event * event_wait_list,
1569 cl_event * event) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001570
1571#endif
1572
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001573extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001574clEnqueueCopyBuffer(cl_command_queue command_queue,
1575 cl_mem src_buffer,
1576 cl_mem dst_buffer,
1577 size_t src_offset,
1578 size_t dst_offset,
1579 size_t size,
1580 cl_uint num_events_in_wait_list,
1581 const cl_event * event_wait_list,
1582 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001583
1584#ifdef CL_VERSION_1_1
1585
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001586extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001587clEnqueueCopyBufferRect(cl_command_queue command_queue,
1588 cl_mem src_buffer,
1589 cl_mem dst_buffer,
1590 const size_t * src_origin,
1591 const size_t * dst_origin,
1592 const size_t * region,
1593 size_t src_row_pitch,
1594 size_t src_slice_pitch,
1595 size_t dst_row_pitch,
1596 size_t dst_slice_pitch,
1597 cl_uint num_events_in_wait_list,
1598 const cl_event * event_wait_list,
1599 cl_event * event) CL_API_SUFFIX__VERSION_1_1;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001600
1601#endif
1602
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001603extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001604clEnqueueReadImage(cl_command_queue command_queue,
1605 cl_mem image,
1606 cl_bool blocking_read,
1607 const size_t * origin,
1608 const size_t * region,
1609 size_t row_pitch,
1610 size_t slice_pitch,
1611 void * ptr,
1612 cl_uint num_events_in_wait_list,
1613 const cl_event * event_wait_list,
1614 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001615
1616extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001617clEnqueueWriteImage(cl_command_queue command_queue,
1618 cl_mem image,
1619 cl_bool blocking_write,
1620 const size_t * origin,
1621 const size_t * region,
1622 size_t input_row_pitch,
1623 size_t input_slice_pitch,
1624 const void * ptr,
1625 cl_uint num_events_in_wait_list,
1626 const cl_event * event_wait_list,
1627 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001628
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001629#ifdef CL_VERSION_1_2
1630
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001631extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001632clEnqueueFillImage(cl_command_queue command_queue,
1633 cl_mem image,
1634 const void * fill_color,
1635 const size_t * origin,
1636 const size_t * region,
1637 cl_uint num_events_in_wait_list,
1638 const cl_event * event_wait_list,
1639 cl_event * event) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001640
1641#endif
1642
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001643extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001644clEnqueueCopyImage(cl_command_queue command_queue,
1645 cl_mem src_image,
1646 cl_mem dst_image,
1647 const size_t * src_origin,
1648 const size_t * dst_origin,
1649 const size_t * region,
1650 cl_uint num_events_in_wait_list,
1651 const cl_event * event_wait_list,
1652 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001653
1654extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001655clEnqueueCopyImageToBuffer(cl_command_queue command_queue,
1656 cl_mem src_image,
1657 cl_mem dst_buffer,
1658 const size_t * src_origin,
1659 const size_t * region,
1660 size_t dst_offset,
1661 cl_uint num_events_in_wait_list,
1662 const cl_event * event_wait_list,
1663 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001664
1665extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001666clEnqueueCopyBufferToImage(cl_command_queue command_queue,
1667 cl_mem src_buffer,
1668 cl_mem dst_image,
1669 size_t src_offset,
1670 const size_t * dst_origin,
1671 const size_t * region,
1672 cl_uint num_events_in_wait_list,
1673 const cl_event * event_wait_list,
1674 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001675
1676extern CL_API_ENTRY void * CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001677clEnqueueMapBuffer(cl_command_queue command_queue,
1678 cl_mem buffer,
1679 cl_bool blocking_map,
1680 cl_map_flags map_flags,
1681 size_t offset,
1682 size_t size,
1683 cl_uint num_events_in_wait_list,
1684 const cl_event * event_wait_list,
1685 cl_event * event,
1686 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001687
1688extern CL_API_ENTRY void * CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001689clEnqueueMapImage(cl_command_queue command_queue,
1690 cl_mem image,
1691 cl_bool blocking_map,
1692 cl_map_flags map_flags,
1693 const size_t * origin,
1694 const size_t * region,
1695 size_t * image_row_pitch,
1696 size_t * image_slice_pitch,
1697 cl_uint num_events_in_wait_list,
1698 const cl_event * event_wait_list,
1699 cl_event * event,
1700 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001701
1702extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001703clEnqueueUnmapMemObject(cl_command_queue command_queue,
1704 cl_mem memobj,
1705 void * mapped_ptr,
1706 cl_uint num_events_in_wait_list,
1707 const cl_event * event_wait_list,
1708 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001709
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001710#ifdef CL_VERSION_1_2
1711
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001712extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001713clEnqueueMigrateMemObjects(cl_command_queue command_queue,
1714 cl_uint num_mem_objects,
1715 const cl_mem * mem_objects,
1716 cl_mem_migration_flags flags,
1717 cl_uint num_events_in_wait_list,
1718 const cl_event * event_wait_list,
1719 cl_event * event) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001720
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001721#endif
1722
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001723extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001724clEnqueueNDRangeKernel(cl_command_queue command_queue,
1725 cl_kernel kernel,
1726 cl_uint work_dim,
1727 const size_t * global_work_offset,
1728 const size_t * global_work_size,
1729 const size_t * local_work_size,
1730 cl_uint num_events_in_wait_list,
1731 const cl_event * event_wait_list,
1732 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001733
1734extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001735clEnqueueNativeKernel(cl_command_queue command_queue,
1736 void (CL_CALLBACK * user_func)(void *),
1737 void * args,
1738 size_t cb_args,
1739 cl_uint num_mem_objects,
1740 const cl_mem * mem_list,
1741 const void ** args_mem_loc,
1742 cl_uint num_events_in_wait_list,
1743 const cl_event * event_wait_list,
1744 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001745
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001746#ifdef CL_VERSION_1_2
1747
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001748extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001749clEnqueueMarkerWithWaitList(cl_command_queue command_queue,
1750 cl_uint num_events_in_wait_list,
1751 const cl_event * event_wait_list,
1752 cl_event * event) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001753
1754extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001755clEnqueueBarrierWithWaitList(cl_command_queue command_queue,
1756 cl_uint num_events_in_wait_list,
1757 const cl_event * event_wait_list,
1758 cl_event * event) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001759
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001760#endif
1761
1762#ifdef CL_VERSION_2_0
1763
Pablo Telloe86a09f2018-01-11 15:44:48 +00001764extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001765clEnqueueSVMFree(cl_command_queue command_queue,
1766 cl_uint num_svm_pointers,
1767 void * svm_pointers[],
1768 void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue,
1769 cl_uint num_svm_pointers,
1770 void * svm_pointers[],
1771 void * user_data),
1772 void * user_data,
1773 cl_uint num_events_in_wait_list,
1774 const cl_event * event_wait_list,
1775 cl_event * event) CL_API_SUFFIX__VERSION_2_0;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001776
1777extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001778clEnqueueSVMMemcpy(cl_command_queue command_queue,
1779 cl_bool blocking_copy,
1780 void * dst_ptr,
1781 const void * src_ptr,
1782 size_t size,
1783 cl_uint num_events_in_wait_list,
1784 const cl_event * event_wait_list,
1785 cl_event * event) CL_API_SUFFIX__VERSION_2_0;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001786
1787extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001788clEnqueueSVMMemFill(cl_command_queue command_queue,
1789 void * svm_ptr,
1790 const void * pattern,
1791 size_t pattern_size,
1792 size_t size,
1793 cl_uint num_events_in_wait_list,
1794 const cl_event * event_wait_list,
1795 cl_event * event) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001796
Pablo Telloe86a09f2018-01-11 15:44:48 +00001797extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001798clEnqueueSVMMap(cl_command_queue command_queue,
1799 cl_bool blocking_map,
1800 cl_map_flags flags,
1801 void * svm_ptr,
1802 size_t size,
1803 cl_uint num_events_in_wait_list,
1804 const cl_event * event_wait_list,
1805 cl_event * event) CL_API_SUFFIX__VERSION_2_0;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001806
Pablo Telloe86a09f2018-01-11 15:44:48 +00001807extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001808clEnqueueSVMUnmap(cl_command_queue command_queue,
1809 void * svm_ptr,
1810 cl_uint num_events_in_wait_list,
1811 const cl_event * event_wait_list,
1812 cl_event * event) CL_API_SUFFIX__VERSION_2_0;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001813
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001814#endif
1815
1816#ifdef CL_VERSION_2_1
1817
Pablo Telloe86a09f2018-01-11 15:44:48 +00001818extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001819clEnqueueSVMMigrateMem(cl_command_queue command_queue,
1820 cl_uint num_svm_pointers,
1821 const void ** svm_pointers,
1822 const size_t * sizes,
1823 cl_mem_migration_flags flags,
1824 cl_uint num_events_in_wait_list,
1825 const cl_event * event_wait_list,
1826 cl_event * event) CL_API_SUFFIX__VERSION_2_1;
Pablo Telloe86a09f2018-01-11 15:44:48 +00001827
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001828#endif
1829
1830#ifdef CL_VERSION_1_2
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001831
1832/* Extension function access
1833 *
1834 * Returns the extension function address for the given function name,
1835 * or NULL if a valid function can not be found. The client must
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001836 * check to make sure the address is not NULL, before using or
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001837 * calling the returned function address.
1838 */
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001839extern CL_API_ENTRY void * CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001840clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
1841 const char * func_name) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001842
1843#endif
1844
1845#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
1846 /*
1847 * WARNING:
1848 * This API introduces mutable state into the OpenCL implementation. It has been REMOVED
1849 * to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
1850 * OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
1851 * It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
1852 *
1853 * Software developers previously relying on this API are instructed to set the command queue
1854 * properties when creating the queue, instead.
1855 */
1856 extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001857 clSetCommandQueueProperty(cl_command_queue command_queue,
1858 cl_command_queue_properties properties,
1859 cl_bool enable,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001860 cl_command_queue_properties * old_properties) CL_API_SUFFIX__VERSION_1_0_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001861#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001862
Pablo Telloe86a09f2018-01-11 15:44:48 +00001863/* Deprecated OpenCL 1.1 APIs */
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001864extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001865clCreateImage2D(cl_context context,
1866 cl_mem_flags flags,
1867 const cl_image_format * image_format,
1868 size_t image_width,
1869 size_t image_height,
1870 size_t image_row_pitch,
1871 void * host_ptr,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001872 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001873
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001874extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001875clCreateImage3D(cl_context context,
1876 cl_mem_flags flags,
1877 const cl_image_format * image_format,
1878 size_t image_width,
1879 size_t image_height,
1880 size_t image_depth,
1881 size_t image_row_pitch,
1882 size_t image_slice_pitch,
1883 void * host_ptr,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001884 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001885
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001886extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001887clEnqueueMarker(cl_command_queue command_queue,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001888 cl_event * event) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001889
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001890extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001891clEnqueueWaitForEvents(cl_command_queue command_queue,
1892 cl_uint num_events,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001893 const cl_event * event_list) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001894
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001895extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1896clEnqueueBarrier(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001897
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001898extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
1899clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001900
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001901extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
1902clGetExtensionFunctionAddress(const char * func_name) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001903
Pablo Telloe86a09f2018-01-11 15:44:48 +00001904/* Deprecated OpenCL 2.0 APIs */
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001905extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001906clCreateCommandQueue(cl_context context,
1907 cl_device_id device,
1908 cl_command_queue_properties properties,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001909 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001910
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001911extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001912clCreateSampler(cl_context context,
1913 cl_bool normalized_coords,
1914 cl_addressing_mode addressing_mode,
1915 cl_filter_mode filter_mode,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001916 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001917
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001918extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +01001919clEnqueueTask(cl_command_queue command_queue,
1920 cl_kernel kernel,
1921 cl_uint num_events_in_wait_list,
1922 const cl_event * event_wait_list,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +00001923 cl_event * event) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
Anthony Barbier8b2fdc92018-08-09 11:42:38 +01001924
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001925#ifdef __cplusplus
1926}
1927#endif
1928
1929#endif /* __OPENCL_CL_H */