Halide 22.0.0 Halide compiler and libraries

cl_functions.h
Go to the documentation of this file.
1// Note that this header intentionally does not use include
2// guards. The intended usage of this file is to define the meaning of
3// the CL_FN macro, and then include this file, sometimes repeatedly
4// within the same compilation unit.
5
6// clang-format off
7
8#ifndef CL_FN
9#define CL_FN(ret, fn, args)
10#endif
11
12#ifndef CL_12_FN
13#define CL_12_FN(ret, fn, args) CL_FN(ret, fn, args)
14#endif
15
16/* Platform API */
17 CL_FN(cl_int,
18 clGetPlatformIDs, (cl_uint /* num_entries */,
19 cl_platform_id * /* platforms */,
20 cl_uint * /* num_platforms */));
21
22 CL_FN(cl_int,
23 clGetPlatformInfo, (cl_platform_id /* platform */,
24 cl_platform_info /* param_name */,
25 size_t /* param_value_size */,
26 void * /* param_value */,
27 size_t * /* param_value_size_ret */));
28
29/* Device APIs */
30 CL_FN(cl_int,
31 clGetDeviceIDs, (cl_platform_id /* platform */,
32 cl_device_type /* device_type */,
33 cl_uint /* num_entries */,
34 cl_device_id * /* devices */,
35 cl_uint * /* num_devices */));
36
37 CL_FN(cl_int,
38 clGetDeviceInfo, (cl_device_id /* device */,
39 cl_device_info /* param_name */,
40 size_t /* param_value_size */,
41 void * /* param_value */,
42 size_t * /* param_value_size_ret */));
43
44 CL_12_FN(cl_int,
45 clCreateSubDevices, (cl_device_id /* in_device */,
46 const cl_device_partition_property * /* properties */,
47 cl_uint /* num_devices */,
48 cl_device_id * /* out_devices */,
49 cl_uint * /* num_devices_ret */));
50
51 CL_12_FN(cl_int,
52 clRetainDevice, (cl_device_id /* device */));
53
54 CL_12_FN(cl_int,
55 clReleaseDevice, (cl_device_id /* device */));
56
57/* Context APIs */
58 CL_FN(cl_context,
59 clCreateContext, (const cl_context_properties * /* properties */,
60 cl_uint /* num_devices */,
61 const cl_device_id * /* devices */,
62 void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
63 void * /* user_data */,
64 cl_int * /* errcode_ret */));
65
66 CL_FN(cl_context,
67 clCreateContextFromType, (const cl_context_properties * /* properties */,
68 cl_device_type /* device_type */,
69 void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
70 void * /* user_data */,
71 cl_int * /* errcode_ret */));
72
73 CL_FN(cl_int,
74 clRetainContext, (cl_context /* context */));
75
76 CL_FN(cl_int,
77 clReleaseContext, (cl_context /* context */));
78
79 CL_FN(cl_int,
80 clGetContextInfo, (cl_context /* context */,
81 cl_context_info /* param_name */,
82 size_t /* param_value_size */,
83 void * /* param_value */,
84 size_t * /* param_value_size_ret */));
85
86/* Command Queue APIs */
87 CL_FN(cl_command_queue,
88 clCreateCommandQueue, (cl_context /* context */,
89 cl_device_id /* device */,
90 cl_command_queue_properties /* properties */,
91 cl_int * /* errcode_ret */));
92
93 CL_FN(cl_int,
94 clRetainCommandQueue, (cl_command_queue /* command_queue */));
95
96 CL_FN(cl_int,
97 clReleaseCommandQueue, (cl_command_queue /* command_queue */));
98
99 CL_FN(cl_int,
100 clGetCommandQueueInfo, (cl_command_queue /* command_queue */,
101 cl_command_queue_info /* param_name */,
102 size_t /* param_value_size */,
103 void * /* param_value */,
104 size_t * /* param_value_size_ret */));
105
106/* Memory Object APIs */
107 CL_FN(cl_mem,
108 clCreateBuffer, (cl_context /* context */,
109 cl_mem_flags /* flags */,
110 size_t /* size */,
111 void * /* host_ptr */,
112 cl_int * /* errcode_ret */));
113
114 CL_FN(cl_mem,
115 clCreateSubBuffer, (cl_mem /* buffer */,
116 cl_mem_flags /* flags */,
117 cl_buffer_create_type /* buffer_create_type */,
118 const void * /* buffer_create_info */,
119 cl_int * /* errcode_ret */));
120
121 CL_12_FN(cl_mem,
122 clCreateImage, (cl_context /* context */,
123 cl_mem_flags /* flags */,
124 const cl_image_format * /* image_format */,
125 const cl_image_desc * /* image_desc */,
126 void * /* host_ptr */,
127 cl_int * /* errcode_ret */));
128
129 CL_FN(cl_int,
130 clRetainMemObject, (cl_mem /* memobj */));
131
132 CL_FN(cl_int,
133 clReleaseMemObject, (cl_mem /* memobj */));
134
135 CL_FN(cl_int,
136 clGetSupportedImageFormats, (cl_context /* context */,
137 cl_mem_flags /* flags */,
138 cl_mem_object_type /* image_type */,
139 cl_uint /* num_entries */,
140 cl_image_format * /* image_formats */,
141 cl_uint * /* num_image_formats */));
142
143 CL_FN(cl_int,
144 clGetMemObjectInfo, (cl_mem /* memobj */,
145 cl_mem_info /* param_name */,
146 size_t /* param_value_size */,
147 void * /* param_value */,
148 size_t * /* param_value_size_ret */));
149
150 CL_FN(cl_int,
151 clGetImageInfo, (cl_mem /* image */,
152 cl_image_info /* param_name */,
153 size_t /* param_value_size */,
154 void * /* param_value */,
155 size_t * /* param_value_size_ret */));
156
157 CL_FN(cl_int,
158 clSetMemObjectDestructorCallback, (cl_mem /* memobj */,
159 void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
160 void * /*user_data */ ));
161
162/* Program Object APIs */
163 CL_FN(cl_program,
164 clCreateProgramWithSource, (cl_context /* context */,
165 cl_uint /* count */,
166 const char ** /* strings */,
167 const size_t * /* lengths */,
168 cl_int * /* errcode_ret */));
169 CL_FN(cl_int,
170 clRetainProgram, (cl_program /* program */));
171
172 CL_FN(cl_int,
173 clReleaseProgram, (cl_program /* program */));
174
175 CL_FN(cl_int,
176 clBuildProgram, (cl_program /* program */,
177 cl_uint /* num_devices */,
178 const cl_device_id * /* device_list */,
179 const char * /* options */,
180 void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
181 void * /* user_data */));
182
183 CL_FN(cl_int,
184 clGetProgramBuildInfo, (cl_program /* program */,
185 cl_device_id /* device */,
186 cl_program_build_info /* param_name */,
187 size_t /* param_value_size */,
188 void * /* param_value */,
189 size_t * /* param_value_size_ret */));
190
191/* Kernel Object APIs */
192 CL_FN(cl_kernel,
193 clCreateKernel, (cl_program /* program */,
194 const char * /* kernel_name */,
195 cl_int * /* errcode_ret */));
196
197 CL_FN(cl_int,
198 clRetainKernel, (cl_kernel /* kernel */));
199
200 CL_FN(cl_int,
201 clReleaseKernel, (cl_kernel /* kernel */));
202
203 CL_FN(cl_int,
204 clSetKernelArg, (cl_kernel /* kernel */,
205 cl_uint /* arg_index */,
206 size_t /* arg_size */,
207 const void * /* arg_value */));
208
209/* Flush and Finish APIs */
210 CL_FN(cl_int,
211 clFlush, (cl_command_queue /* command_queue */));
212
213 CL_FN(cl_int,
214 clFinish, (cl_command_queue /* command_queue */));
215
216/* Enqueued Commands APIs */
217 CL_FN(cl_int,
218 clEnqueueReadBuffer, (cl_command_queue /* command_queue */,
219 cl_mem /* buffer */,
220 cl_bool /* blocking_read */,
221 size_t /* offset */,
222 size_t /* size */,
223 void * /* ptr */,
224 cl_uint /* num_events_in_wait_list */,
225 const cl_event * /* event_wait_list */,
226 cl_event * /* event */));
227
228 CL_FN(cl_int,
229 clEnqueueReadBufferRect, (cl_command_queue /* command_queue */,
230 cl_mem /* buffer */,
231 cl_bool /* blocking_read */,
232 const size_t * /* buffer_offset */,
233 const size_t * /* host_offset */,
234 const size_t * /* region */,
235 size_t /* buffer_row_pitch */,
236 size_t /* buffer_slice_pitch */,
237 size_t /* host_row_pitch */,
238 size_t /* host_slice_pitch */,
239 void * /* ptr */,
240 cl_uint /* num_events_in_wait_list */,
241 const cl_event * /* event_wait_list */,
242 cl_event * /* event */));
243
244 CL_FN(cl_int,
245 clEnqueueWriteBuffer, (cl_command_queue /* command_queue */,
246 cl_mem /* buffer */,
247 cl_bool /* blocking_write */,
248 size_t /* offset */,
249 size_t /* size */,
250 const void * /* ptr */,
251 cl_uint /* num_events_in_wait_list */,
252 const cl_event * /* event_wait_list */,
253 cl_event * /* event */));
254
255 CL_FN(cl_int,
256 clEnqueueWriteBufferRect, (cl_command_queue /* command_queue */,
257 cl_mem /* buffer */,
258 cl_bool /* blocking_write */,
259 const size_t * /* buffer_offset */,
260 const size_t * /* host_offset */,
261 const size_t * /* region */,
262 size_t /* buffer_row_pitch */,
263 size_t /* buffer_slice_pitch */,
264 size_t /* host_row_pitch */,
265 size_t /* host_slice_pitch */,
266 const void * /* ptr */,
267 cl_uint /* num_events_in_wait_list */,
268 const cl_event * /* event_wait_list */,
269 cl_event * /* event */));
270
271
272 CL_FN(cl_int,
273 clEnqueueCopyBuffer, (cl_command_queue /* command_queue */,
274 cl_mem /* src_buffer */,
275 cl_mem /* dst_buffer */,
276 size_t /* src_offset */,
277 size_t /* dst_offset */,
278 size_t /* cb */,
279 cl_uint /* num_events_in_wait_list */,
280 const cl_event * /* event_wait_list */,
281 cl_event * /* event */));
282
283 CL_FN(cl_int,
284 clEnqueueReadImage, (cl_command_queue /* command_queue */,
285 cl_mem /* image */,
286 cl_bool /* blocking_read */,
287 const size_t * /* origin[3] */,
288 const size_t * /* region[3] */,
289 size_t /* row_pitch */,
290 size_t /* slice_pitch */,
291 void * /* ptr */,
292 cl_uint /* num_events_in_wait_list */,
293 const cl_event * /* event_wait_list */,
294 cl_event * /* event */));
295
296 CL_FN(cl_int,
297 clEnqueueWriteImage, (cl_command_queue /* command_queue */,
298 cl_mem /* image */,
299 cl_bool /* blocking_write */,
300 const size_t * /* origin[3] */,
301 const size_t * /* region[3] */,
302 size_t /* input_row_pitch */,
303 size_t /* input_slice_pitch */,
304 const void * /* ptr */,
305 cl_uint /* num_events_in_wait_list */,
306 const cl_event * /* event_wait_list */,
307 cl_event * /* event */));
308
309 CL_FN(void *,
310 clEnqueueMapBuffer, (cl_command_queue /* command_queue */,
311 cl_mem /* buffer */,
312 cl_bool /* blocking_map */,
313 cl_map_flags /* map_flags */,
314 size_t /* offset */,
315 size_t /* size */,
316 cl_uint /* num_events_in_wait_list */,
317 const cl_event * /* event_wait_list */,
318 cl_event * /* event */,
319 cl_int * /* errcode_ret */));
320
321 CL_FN(void *,
322 clEnqueueMapImage, (cl_command_queue /* command_queue */,
323 cl_mem /* image */,
324 cl_bool /* blocking_map */,
325 cl_map_flags /* map_flags */,
326 const size_t * /* origin[3] */,
327 const size_t * /* region[3] */,
328 size_t * /* image_row_pitch */,
329 size_t * /* image_slice_pitch */,
330 cl_uint /* num_events_in_wait_list */,
331 const cl_event * /* event_wait_list */,
332 cl_event * /* event */,
333 cl_int * /* errcode_ret */));
334
335 CL_FN(cl_int,
336 clEnqueueUnmapMemObject, (cl_command_queue /* command_queue */,
337 cl_mem /* memobj */,
338 void * /* mapped_ptr */,
339 cl_uint /* num_events_in_wait_list */,
340 const cl_event * /* event_wait_list */,
341 cl_event * /* event */));
342
343 CL_FN(cl_int,
344 clEnqueueNDRangeKernel, (cl_command_queue /* command_queue */,
345 cl_kernel /* kernel */,
346 cl_uint /* work_dim */,
347 const size_t * /* global_work_offset */,
348 const size_t * /* global_work_size */,
349 const size_t * /* local_work_size */,
350 cl_uint /* num_events_in_wait_list */,
351 const cl_event * /* event_wait_list */,
352 cl_event * /* event */));
353
354#undef CL_FN
355#undef CL_12_FN
356
357// clang-format on
CL_FN
#define CL_FN(ret, fn, args)
Definition: cl_functions.h:9
CL_12_FN
#define CL_12_FN(ret, fn, args)
Definition: cl_functions.h:13
cl_context_info
cl_uint cl_context_info
Definition: mini_cl.h:79
CL_CALLBACK
#define CL_CALLBACK
Definition: mini_cl.h:32
cl_event
struct _cl_event * cl_event
Definition: mini_cl.h:62
cl_platform_id
struct _cl_platform_id * cl_platform_id
Definition: mini_cl.h:55
cl_program_build_info
cl_uint cl_program_build_info
Definition: mini_cl.h:94
cl_mem_flags
cl_bitfield cl_mem_flags
Definition: mini_cl.h:83
cl_context_properties
intptr_t cl_context_properties
Definition: mini_cl.h:78
cl_int
int32_t cl_int
Definition: mini_cl.h:44
cl_device_type
cl_bitfield cl_device_type
Definition: mini_cl.h:67
cl_program
struct _cl_program * cl_program
Definition: mini_cl.h:60
cl_uint
uint32_t cl_uint
Definition: mini_cl.h:45
cl_command_queue_info
cl_uint cl_command_queue_info
Definition: mini_cl.h:80
cl_map_flags
cl_bitfield cl_map_flags
Definition: mini_cl.h:92
cl_mem_object_type
cl_uint cl_mem_object_type
Definition: mini_cl.h:84
cl_bool
cl_uint cl_bool
Definition: mini_cl.h:65
cl_buffer_create_type
cl_uint cl_buffer_create_type
Definition: mini_cl.h:88
cl_context
struct _cl_context * cl_context
Definition: mini_cl.h:57
cl_image_info
cl_uint cl_image_info
Definition: mini_cl.h:87
cl_device_info
cl_uint cl_device_info
Definition: mini_cl.h:69
cl_device_id
struct _cl_device_id * cl_device_id
Definition: mini_cl.h:56
cl_command_queue
struct _cl_command_queue * cl_command_queue
Definition: mini_cl.h:58
cl_kernel
struct _cl_kernel * cl_kernel
Definition: mini_cl.h:61
cl_platform_info
cl_uint cl_platform_info
Definition: mini_cl.h:68
cl_command_queue_properties
cl_bitfield cl_command_queue_properties
Definition: mini_cl.h:74
cl_mem
struct _cl_mem * cl_mem
Definition: mini_cl.h:59
cl_device_partition_property
intptr_t cl_device_partition_property
Definition: mini_cl.h:75
cl_mem_info
cl_uint cl_mem_info
Definition: mini_cl.h:85
_cl_image_desc
Definition: mini_cl.h:112
_cl_image_format
Definition: mini_cl.h:107