Halide
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 /* Platform API */
14  clGetPlatformIDs, (cl_uint /* num_entries */,
15  cl_platform_id * /* platforms */,
16  cl_uint * /* num_platforms */));
17 
19  clGetPlatformInfo, (cl_platform_id /* platform */,
20  cl_platform_info /* param_name */,
21  size_t /* param_value_size */,
22  void * /* param_value */,
23  size_t * /* param_value_size_ret */));
24 
25 /* Device APIs */
27  clGetDeviceIDs, (cl_platform_id /* platform */,
28  cl_device_type /* device_type */,
29  cl_uint /* num_entries */,
30  cl_device_id * /* devices */,
31  cl_uint * /* num_devices */));
32 
34  clGetDeviceInfo, (cl_device_id /* device */,
35  cl_device_info /* param_name */,
36  size_t /* param_value_size */,
37  void * /* param_value */,
38  size_t * /* param_value_size_ret */));
39 
40 #ifdef HAVE_OPENCL_12
42  clCreateSubDevices, (cl_device_id /* in_device */,
43  const cl_device_partition_property * /* properties */,
44  cl_uint /* num_devices */,
45  cl_device_id * /* out_devices */,
46  cl_uint * /* num_devices_ret */));
47 
49  clRetainDevice, (cl_device_id /* device */));
50 
52  clReleaseDevice, (cl_device_id /* device */));
53 #endif
54 
55 /* Context APIs */
57  clCreateContext, (const cl_context_properties * /* properties */,
58  cl_uint /* num_devices */,
59  const cl_device_id * /* devices */,
60  void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
61  void * /* user_data */,
62  cl_int * /* errcode_ret */));
63 
65  clCreateContextFromType, (const cl_context_properties * /* properties */,
66  cl_device_type /* device_type */,
67  void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
68  void * /* user_data */,
69  cl_int * /* errcode_ret */));
70 
72  clRetainContext, (cl_context /* context */));
73 
75  clReleaseContext, (cl_context /* context */));
76 
78  clGetContextInfo, (cl_context /* context */,
79  cl_context_info /* param_name */,
80  size_t /* param_value_size */,
81  void * /* param_value */,
82  size_t * /* param_value_size_ret */));
83 
84 /* Command Queue APIs */
86  clCreateCommandQueue, (cl_context /* context */,
87  cl_device_id /* device */,
88  cl_command_queue_properties /* properties */,
89  cl_int * /* errcode_ret */));
90 
92  clRetainCommandQueue, (cl_command_queue /* command_queue */));
93 
95  clReleaseCommandQueue, (cl_command_queue /* command_queue */));
96 
98  clGetCommandQueueInfo, (cl_command_queue /* command_queue */,
99  cl_command_queue_info /* param_name */,
100  size_t /* param_value_size */,
101  void * /* param_value */,
102  size_t * /* param_value_size_ret */));
103 
104 /* Memory Object APIs */
105 CL_FN(cl_mem,
106  clCreateBuffer, (cl_context /* context */,
107  cl_mem_flags /* flags */,
108  size_t /* size */,
109  void * /* host_ptr */,
110  cl_int * /* errcode_ret */));
111 
112 CL_FN(cl_mem,
113  clCreateSubBuffer, (cl_mem /* buffer */,
114  cl_mem_flags /* flags */,
115  cl_buffer_create_type /* buffer_create_type */,
116  const void * /* buffer_create_info */,
117  cl_int * /* errcode_ret */));
118 
119 #ifdef HAVE_OPENCL_12
120 CL_FN(cl_mem,
121  clCreateImage, (cl_context /* context */,
122  cl_mem_flags /* flags */,
123  const cl_image_format * /* image_format */,
124  const cl_image_desc * /* image_desc */,
125  void * /* host_ptr */,
126  cl_int * /* errcode_ret */));
127 #endif
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 */
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 */
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 
356 // clang-format on
cl_map_flags
cl_bitfield cl_map_flags
Definition: mini_cl.h:92
cl_platform_info
cl_uint cl_platform_info
Definition: mini_cl.h:68
cl_kernel
struct _cl_kernel * cl_kernel
Definition: mini_cl.h:61
cl_event
struct _cl_event * cl_event
Definition: mini_cl.h:62
cl_mem_info
cl_uint cl_mem_info
Definition: mini_cl.h:85
CL_FN
#define CL_FN(ret, fn, args)
Definition: cl_functions.h:9
cl_program_build_info
cl_uint cl_program_build_info
Definition: mini_cl.h:94
cl_command_queue_info
cl_uint cl_command_queue_info
Definition: mini_cl.h:80
cl_device_info
cl_uint cl_device_info
Definition: mini_cl.h:69
cl_program
struct _cl_program * cl_program
Definition: mini_cl.h:60
cl_int
int32_t cl_int
Definition: mini_cl.h:44
cl_bool
cl_uint cl_bool
Definition: mini_cl.h:65
cl_uint
uint32_t cl_uint
Definition: mini_cl.h:45
cl_command_queue
struct _cl_command_queue * cl_command_queue
Definition: mini_cl.h:58
cl_buffer_create_type
cl_uint cl_buffer_create_type
Definition: mini_cl.h:88
cl_device_type
cl_bitfield cl_device_type
Definition: mini_cl.h:67
cl_mem_object_type
cl_uint cl_mem_object_type
Definition: mini_cl.h:84
cl_device_partition_property
intptr_t cl_device_partition_property
Definition: mini_cl.h:75
cl_platform_id
struct _cl_platform_id * cl_platform_id
Definition: mini_cl.h:55
cl_context_info
cl_uint cl_context_info
Definition: mini_cl.h:79
_cl_image_format
Definition: mini_cl.h:107
cl_mem_flags
cl_bitfield cl_mem_flags
Definition: mini_cl.h:83
cl_device_id
struct _cl_device_id * cl_device_id
Definition: mini_cl.h:56
cl_command_queue_properties
cl_bitfield cl_command_queue_properties
Definition: mini_cl.h:74
cl_image_info
cl_uint cl_image_info
Definition: mini_cl.h:87
CL_CALLBACK
#define CL_CALLBACK
Definition: mini_cl.h:32
cl_mem
struct _cl_mem * cl_mem
Definition: mini_cl.h:59
_cl_image_desc
Definition: mini_cl.h:112
cl_context_properties
intptr_t cl_context_properties
Definition: mini_cl.h:78
cl_context
struct _cl_context * cl_context
Definition: mini_cl.h:57