opencl_sys/
cl_function_types.rs

1// Copyright (c) 2023 Via Technology Ltd.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//    http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! FFI bindings for [cl_function_types.h](https://github.com/KhronosGroup/OpenCL-Headers/blob/main/CL/cl_function_types.h)
16
17#![allow(non_camel_case_types)]
18
19pub use super::cl::{
20    cl_addressing_mode, cl_bitfield, cl_bool, cl_buffer_create_type, cl_channel_type,
21    cl_command_queue, cl_command_queue_info, cl_command_queue_properties, cl_command_type,
22    cl_context, cl_context_info, cl_context_properties, cl_device_id, cl_device_info,
23    cl_device_partition_property, cl_device_type, cl_event, cl_event_info, cl_filter_mode,
24    cl_image_desc, cl_image_format, cl_image_info, cl_kernel, cl_kernel_arg_info,
25    cl_kernel_exec_info, cl_kernel_info, cl_kernel_sub_group_info, cl_kernel_work_group_info,
26    cl_map_flags, cl_mem, cl_mem_flags, cl_mem_info, cl_mem_migration_flags, cl_mem_object_type,
27    cl_mem_properties, cl_pipe_info, cl_pipe_properties, cl_platform_id, cl_platform_info,
28    cl_profiling_info, cl_program, cl_program_build_info, cl_program_info, cl_properties,
29    cl_queue_properties, cl_sampler, cl_sampler_info, cl_sampler_properties, cl_svm_mem_flags,
30};
31use super::cl_platform::{cl_int, cl_uint, cl_ulong};
32use libc::{c_char, c_void, size_t};
33
34pub type clGetPlatformIDs_t = Option<
35    unsafe extern "C" fn(
36        num_entries: cl_uint,
37        platforms: *mut cl_platform_id,
38        num_platforms: *mut cl_uint,
39    ) -> cl_int,
40>;
41pub type clGetPlatformIDs_fn = clGetPlatformIDs_t;
42
43pub type clGetPlatformInfo_t = Option<
44    unsafe extern "C" fn(
45        platform: cl_platform_id,
46        param_name: cl_platform_info,
47        param_value_size: size_t,
48        param_value: *mut c_void,
49        param_value_size_ret: *mut size_t,
50    ) -> cl_int,
51>;
52pub type clGetPlatformInfo_fn = clGetPlatformInfo_t;
53
54pub type clGetDeviceIDs_t = Option<
55    unsafe extern "C" fn(
56        platform: cl_platform_id,
57        device_type: cl_device_type,
58        num_entries: cl_uint,
59        devices: *mut cl_device_id,
60        num_devices: *mut cl_uint,
61    ) -> cl_int,
62>;
63pub type clGetDeviceIDs_fn = clGetDeviceIDs_t;
64
65pub type clGetDeviceInfo_t = Option<
66    unsafe extern "C" fn(
67        device: cl_device_id,
68        param_name: cl_device_info,
69        param_value_size: size_t,
70        param_value: *mut c_void,
71        param_value_size_ret: *mut size_t,
72    ) -> cl_int,
73>;
74pub type clGetDeviceInfo_fn = clGetDeviceInfo_t;
75
76pub type clCreateContext_t = Option<
77    unsafe extern "C" fn(
78        properties: *const cl_context_properties,
79        num_devices: cl_uint,
80        devices: *const cl_device_id,
81        pfn_notify: Option<
82            unsafe extern "C" fn(
83                errinfo: *const c_char,
84                private_info: *const c_void,
85                cb: size_t,
86                user_data: *mut c_void,
87            ),
88        >,
89        user_data: *mut c_void,
90        errcode_ret: *mut cl_int,
91    ) -> cl_context,
92>;
93pub type clCreateContext_fn = clCreateContext_t;
94
95pub type clCreateContextFromType_t = Option<
96    unsafe extern "C" fn(
97        properties: *const cl_context_properties,
98        device_type: cl_device_type,
99        pfn_notify: Option<
100            unsafe extern "C" fn(
101                errinfo: *const c_char,
102                private_info: *const c_void,
103                cb: size_t,
104                user_data: *mut c_void,
105            ),
106        >,
107        user_data: *mut c_void,
108        errcode_ret: *mut cl_int,
109    ) -> cl_context,
110>;
111pub type clCreateContextFromType_fn = clCreateContextFromType_t;
112
113pub type clRetainContext_t = Option<unsafe extern "C" fn(context: cl_context) -> cl_int>;
114pub type clRetainContext_fn = clRetainContext_t;
115
116pub type clReleaseContext_t = Option<unsafe extern "C" fn(context: cl_context) -> cl_int>;
117pub type clReleaseContext_fn = clReleaseContext_t;
118
119pub type clGetContextInfo_t = Option<
120    unsafe extern "C" fn(
121        context: cl_context,
122        param_name: cl_context_info,
123        param_value_size: size_t,
124        param_value: *mut c_void,
125        param_value_size_ret: *mut size_t,
126    ) -> cl_int,
127>;
128pub type clGetContextInfo_fn = clGetContextInfo_t;
129
130pub type clRetainCommandQueue_t =
131    Option<unsafe extern "C" fn(command_queue: cl_command_queue) -> cl_int>;
132pub type clRetainCommandQueue_fn = clRetainCommandQueue_t;
133
134pub type clReleaseCommandQueue_t =
135    Option<unsafe extern "C" fn(command_queue: cl_command_queue) -> cl_int>;
136pub type clReleaseCommandQueue_fn = clReleaseCommandQueue_t;
137
138pub type clGetCommandQueueInfo_t = Option<
139    unsafe extern "C" fn(
140        command_queue: cl_command_queue,
141        param_name: cl_command_queue_info,
142        param_value_size: size_t,
143        param_value: *mut c_void,
144        param_value_size_ret: *mut size_t,
145    ) -> cl_int,
146>;
147pub type clGetCommandQueueInfo_fn = clGetCommandQueueInfo_t;
148
149pub type clCreateBuffer_t = Option<
150    unsafe extern "C" fn(
151        context: cl_context,
152        flags: cl_mem_flags,
153        size: size_t,
154        host_ptr: *mut c_void,
155        errcode_ret: *mut cl_int,
156    ) -> cl_mem,
157>;
158pub type clCreateBuffer_fn = clCreateBuffer_t;
159
160pub type clRetainMemObject_t = Option<unsafe extern "C" fn(memobj: cl_mem) -> cl_int>;
161pub type clRetainMemObject_fn = clRetainMemObject_t;
162
163pub type clReleaseMemObject_t = Option<unsafe extern "C" fn(memobj: cl_mem) -> cl_int>;
164pub type clReleaseMemObject_fn = clReleaseMemObject_t;
165
166pub type clGetSupportedImageFormats_t = Option<
167    unsafe extern "C" fn(
168        context: cl_context,
169        flags: cl_mem_flags,
170        image_type: cl_mem_object_type,
171        num_entries: cl_uint,
172        image_formats: *mut cl_image_format,
173        num_image_formats: *mut cl_uint,
174    ) -> cl_int,
175>;
176pub type clGetSupportedImageFormats_fn = clGetSupportedImageFormats_t;
177
178pub type clGetMemObjectInfo_t = Option<
179    unsafe extern "C" fn(
180        memobj: cl_mem,
181        param_name: cl_mem_info,
182        param_value_size: size_t,
183        param_value: *mut c_void,
184        param_value_size_ret: *mut size_t,
185    ) -> cl_int,
186>;
187pub type clGetMemObjectInfo_fn = clGetMemObjectInfo_t;
188
189pub type clGetImageInfo_t = Option<
190    unsafe extern "C" fn(
191        image: cl_mem,
192        param_name: cl_image_info,
193        param_value_size: size_t,
194        param_value: *mut c_void,
195        param_value_size_ret: *mut size_t,
196    ) -> cl_int,
197>;
198pub type clGetImageInfo_fn = clGetImageInfo_t;
199
200pub type clRetainSampler_t = Option<unsafe extern "C" fn(sampler: cl_sampler) -> cl_int>;
201pub type clRetainSampler_fn = clRetainSampler_t;
202
203pub type clReleaseSampler_t = Option<unsafe extern "C" fn(sampler: cl_sampler) -> cl_int>;
204pub type clReleaseSampler_fn = clReleaseSampler_t;
205
206pub type clGetSamplerInfo_t = Option<
207    unsafe extern "C" fn(
208        sampler: cl_sampler,
209        param_name: cl_sampler_info,
210        param_value_size: size_t,
211        param_value: *mut c_void,
212        param_value_size_ret: *mut size_t,
213    ) -> cl_int,
214>;
215pub type clGetSamplerInfo_fn = clGetSamplerInfo_t;
216
217pub type clCreateProgramWithSource_t = Option<
218    unsafe extern "C" fn(
219        context: cl_context,
220        count: cl_uint,
221        strings: *mut *const c_char,
222        lengths: *const size_t,
223        errcode_ret: *mut cl_int,
224    ) -> cl_program,
225>;
226pub type clCreateProgramWithSource_fn = clCreateProgramWithSource_t;
227
228pub type clCreateProgramWithBinary_t = Option<
229    unsafe extern "C" fn(
230        context: cl_context,
231        num_devices: cl_uint,
232        device_list: *const cl_device_id,
233        lengths: *const size_t,
234        binaries: *mut *const ::core::ffi::c_uchar,
235        binary_status: *mut cl_int,
236        errcode_ret: *mut cl_int,
237    ) -> cl_program,
238>;
239pub type clCreateProgramWithBinary_fn = clCreateProgramWithBinary_t;
240
241pub type clRetainProgram_t = Option<unsafe extern "C" fn(program: cl_program) -> cl_int>;
242pub type clRetainProgram_fn = clRetainProgram_t;
243
244pub type clReleaseProgram_t = Option<unsafe extern "C" fn(program: cl_program) -> cl_int>;
245pub type clReleaseProgram_fn = clReleaseProgram_t;
246
247pub type clBuildProgram_t = Option<
248    unsafe extern "C" fn(
249        program: cl_program,
250        num_devices: cl_uint,
251        device_list: *const cl_device_id,
252        options: *const c_char,
253        pfn_notify: Option<unsafe extern "C" fn(program: cl_program, user_data: *mut c_void)>,
254        user_data: *mut c_void,
255    ) -> cl_int,
256>;
257pub type clBuildProgram_fn = clBuildProgram_t;
258
259pub type clGetProgramInfo_t = Option<
260    unsafe extern "C" fn(
261        program: cl_program,
262        param_name: cl_program_info,
263        param_value_size: size_t,
264        param_value: *mut c_void,
265        param_value_size_ret: *mut size_t,
266    ) -> cl_int,
267>;
268pub type clGetProgramInfo_fn = clGetProgramInfo_t;
269
270pub type clGetProgramBuildInfo_t = Option<
271    unsafe extern "C" fn(
272        program: cl_program,
273        device: cl_device_id,
274        param_name: cl_program_build_info,
275        param_value_size: size_t,
276        param_value: *mut c_void,
277        param_value_size_ret: *mut size_t,
278    ) -> cl_int,
279>;
280pub type clGetProgramBuildInfo_fn = clGetProgramBuildInfo_t;
281
282pub type clCreateKernel_t = Option<
283    unsafe extern "C" fn(
284        program: cl_program,
285        kernel_name: *const c_char,
286        errcode_ret: *mut cl_int,
287    ) -> cl_kernel,
288>;
289pub type clCreateKernel_fn = clCreateKernel_t;
290
291pub type clCreateKernelsInProgram_t = Option<
292    unsafe extern "C" fn(
293        program: cl_program,
294        num_kernels: cl_uint,
295        kernels: *mut cl_kernel,
296        num_kernels_ret: *mut cl_uint,
297    ) -> cl_int,
298>;
299pub type clCreateKernelsInProgram_fn = clCreateKernelsInProgram_t;
300
301pub type clRetainKernel_t = Option<unsafe extern "C" fn(kernel: cl_kernel) -> cl_int>;
302pub type clRetainKernel_fn = clRetainKernel_t;
303
304pub type clReleaseKernel_t = Option<unsafe extern "C" fn(kernel: cl_kernel) -> cl_int>;
305pub type clReleaseKernel_fn = clReleaseKernel_t;
306
307pub type clSetKernelArg_t = Option<
308    unsafe extern "C" fn(
309        kernel: cl_kernel,
310        arg_index: cl_uint,
311        arg_size: size_t,
312        arg_value: *const c_void,
313    ) -> cl_int,
314>;
315pub type clSetKernelArg_fn = clSetKernelArg_t;
316
317pub type clGetKernelInfo_t = Option<
318    unsafe extern "C" fn(
319        kernel: cl_kernel,
320        param_name: cl_kernel_info,
321        param_value_size: size_t,
322        param_value: *mut c_void,
323        param_value_size_ret: *mut size_t,
324    ) -> cl_int,
325>;
326pub type clGetKernelInfo_fn = clGetKernelInfo_t;
327
328pub type clGetKernelWorkGroupInfo_t = Option<
329    unsafe extern "C" fn(
330        kernel: cl_kernel,
331        device: cl_device_id,
332        param_name: cl_kernel_work_group_info,
333        param_value_size: size_t,
334        param_value: *mut c_void,
335        param_value_size_ret: *mut size_t,
336    ) -> cl_int,
337>;
338pub type clGetKernelWorkGroupInfo_fn = clGetKernelWorkGroupInfo_t;
339
340pub type clWaitForEvents_t =
341    Option<unsafe extern "C" fn(num_events: cl_uint, event_list: *const cl_event) -> cl_int>;
342pub type clWaitForEvents_fn = clWaitForEvents_t;
343
344pub type clGetEventInfo_t = Option<
345    unsafe extern "C" fn(
346        event: cl_event,
347        param_name: cl_event_info,
348        param_value_size: size_t,
349        param_value: *mut c_void,
350        param_value_size_ret: *mut size_t,
351    ) -> cl_int,
352>;
353pub type clGetEventInfo_fn = clGetEventInfo_t;
354
355pub type clRetainEvent_t = Option<unsafe extern "C" fn(event: cl_event) -> cl_int>;
356pub type clRetainEvent_fn = clRetainEvent_t;
357
358pub type clReleaseEvent_t = Option<unsafe extern "C" fn(event: cl_event) -> cl_int>;
359pub type clReleaseEvent_fn = clReleaseEvent_t;
360
361pub type clGetEventProfilingInfo_t = Option<
362    unsafe extern "C" fn(
363        event: cl_event,
364        param_name: cl_profiling_info,
365        param_value_size: size_t,
366        param_value: *mut c_void,
367        param_value_size_ret: *mut size_t,
368    ) -> cl_int,
369>;
370pub type clGetEventProfilingInfo_fn = clGetEventProfilingInfo_t;
371
372pub type clFlush_t = Option<unsafe extern "C" fn(command_queue: cl_command_queue) -> cl_int>;
373pub type clFlush_fn = clFlush_t;
374
375pub type clFinish_t = Option<unsafe extern "C" fn(command_queue: cl_command_queue) -> cl_int>;
376pub type clFinish_fn = clFinish_t;
377
378pub type clEnqueueReadBuffer_t = Option<
379    unsafe extern "C" fn(
380        command_queue: cl_command_queue,
381        buffer: cl_mem,
382        blocking_read: cl_bool,
383        offset: size_t,
384        size: size_t,
385        ptr: *mut c_void,
386        num_events_in_wait_list: cl_uint,
387        event_wait_list: *const cl_event,
388        event: *mut cl_event,
389    ) -> cl_int,
390>;
391pub type clEnqueueReadBuffer_fn = clEnqueueReadBuffer_t;
392
393pub type clEnqueueWriteBuffer_t = Option<
394    unsafe extern "C" fn(
395        command_queue: cl_command_queue,
396        buffer: cl_mem,
397        blocking_write: cl_bool,
398        offset: size_t,
399        size: size_t,
400        ptr: *const c_void,
401        num_events_in_wait_list: cl_uint,
402        event_wait_list: *const cl_event,
403        event: *mut cl_event,
404    ) -> cl_int,
405>;
406pub type clEnqueueWriteBuffer_fn = clEnqueueWriteBuffer_t;
407
408pub type clEnqueueCopyBuffer_t = Option<
409    unsafe extern "C" fn(
410        command_queue: cl_command_queue,
411        src_buffer: cl_mem,
412        dst_buffer: cl_mem,
413        src_offset: size_t,
414        dst_offset: size_t,
415        size: size_t,
416        num_events_in_wait_list: cl_uint,
417        event_wait_list: *const cl_event,
418        event: *mut cl_event,
419    ) -> cl_int,
420>;
421pub type clEnqueueCopyBuffer_fn = clEnqueueCopyBuffer_t;
422
423pub type clEnqueueReadImage_t = Option<
424    unsafe extern "C" fn(
425        command_queue: cl_command_queue,
426        image: cl_mem,
427        blocking_read: cl_bool,
428        origin: *const size_t,
429        region: *const size_t,
430        row_pitch: size_t,
431        slice_pitch: size_t,
432        ptr: *mut c_void,
433        num_events_in_wait_list: cl_uint,
434        event_wait_list: *const cl_event,
435        event: *mut cl_event,
436    ) -> cl_int,
437>;
438pub type clEnqueueReadImage_fn = clEnqueueReadImage_t;
439
440pub type clEnqueueWriteImage_t = Option<
441    unsafe extern "C" fn(
442        command_queue: cl_command_queue,
443        image: cl_mem,
444        blocking_write: cl_bool,
445        origin: *const size_t,
446        region: *const size_t,
447        input_row_pitch: size_t,
448        input_slice_pitch: size_t,
449        ptr: *const c_void,
450        num_events_in_wait_list: cl_uint,
451        event_wait_list: *const cl_event,
452        event: *mut cl_event,
453    ) -> cl_int,
454>;
455pub type clEnqueueWriteImage_fn = clEnqueueWriteImage_t;
456
457pub type clEnqueueCopyImage_t = Option<
458    unsafe extern "C" fn(
459        command_queue: cl_command_queue,
460        src_image: cl_mem,
461        dst_image: cl_mem,
462        src_origin: *const size_t,
463        dst_origin: *const size_t,
464        region: *const size_t,
465        num_events_in_wait_list: cl_uint,
466        event_wait_list: *const cl_event,
467        event: *mut cl_event,
468    ) -> cl_int,
469>;
470pub type clEnqueueCopyImage_fn = clEnqueueCopyImage_t;
471
472pub type clEnqueueCopyImageToBuffer_t = Option<
473    unsafe extern "C" fn(
474        command_queue: cl_command_queue,
475        src_image: cl_mem,
476        dst_buffer: cl_mem,
477        src_origin: *const size_t,
478        region: *const size_t,
479        dst_offset: size_t,
480        num_events_in_wait_list: cl_uint,
481        event_wait_list: *const cl_event,
482        event: *mut cl_event,
483    ) -> cl_int,
484>;
485pub type clEnqueueCopyImageToBuffer_fn = clEnqueueCopyImageToBuffer_t;
486
487pub type clEnqueueCopyBufferToImage_t = Option<
488    unsafe extern "C" fn(
489        command_queue: cl_command_queue,
490        src_buffer: cl_mem,
491        dst_image: cl_mem,
492        src_offset: size_t,
493        dst_origin: *const size_t,
494        region: *const size_t,
495        num_events_in_wait_list: cl_uint,
496        event_wait_list: *const cl_event,
497        event: *mut cl_event,
498    ) -> cl_int,
499>;
500pub type clEnqueueCopyBufferToImage_fn = clEnqueueCopyBufferToImage_t;
501
502pub type clEnqueueMapBuffer_t = Option<
503    unsafe extern "C" fn(
504        command_queue: cl_command_queue,
505        buffer: cl_mem,
506        blocking_map: cl_bool,
507        map_flags: cl_map_flags,
508        offset: size_t,
509        size: size_t,
510        num_events_in_wait_list: cl_uint,
511        event_wait_list: *const cl_event,
512        event: *mut cl_event,
513        errcode_ret: *mut cl_int,
514    ) -> *mut c_void,
515>;
516pub type clEnqueueMapBuffer_fn = clEnqueueMapBuffer_t;
517
518pub type clEnqueueMapImage_t = Option<
519    unsafe extern "C" fn(
520        command_queue: cl_command_queue,
521        image: cl_mem,
522        blocking_map: cl_bool,
523        map_flags: cl_map_flags,
524        origin: *const size_t,
525        region: *const size_t,
526        image_row_pitch: *mut size_t,
527        image_slice_pitch: *mut size_t,
528        num_events_in_wait_list: cl_uint,
529        event_wait_list: *const cl_event,
530        event: *mut cl_event,
531        errcode_ret: *mut cl_int,
532    ) -> *mut c_void,
533>;
534pub type clEnqueueMapImage_fn = clEnqueueMapImage_t;
535
536pub type clEnqueueUnmapMemObject_t = Option<
537    unsafe extern "C" fn(
538        command_queue: cl_command_queue,
539        memobj: cl_mem,
540        mapped_ptr: *mut c_void,
541        num_events_in_wait_list: cl_uint,
542        event_wait_list: *const cl_event,
543        event: *mut cl_event,
544    ) -> cl_int,
545>;
546pub type clEnqueueUnmapMemObject_fn = clEnqueueUnmapMemObject_t;
547
548pub type clEnqueueNDRangeKernel_t = Option<
549    unsafe extern "C" fn(
550        command_queue: cl_command_queue,
551        kernel: cl_kernel,
552        work_dim: cl_uint,
553        global_work_offset: *const size_t,
554        global_work_size: *const size_t,
555        local_work_size: *const size_t,
556        num_events_in_wait_list: cl_uint,
557        event_wait_list: *const cl_event,
558        event: *mut cl_event,
559    ) -> cl_int,
560>;
561pub type clEnqueueNDRangeKernel_fn = clEnqueueNDRangeKernel_t;
562
563pub type clEnqueueNativeKernel_t = Option<
564    unsafe extern "C" fn(
565        command_queue: cl_command_queue,
566        user_func: Option<unsafe extern "C" fn(arg1: *mut c_void)>,
567        args: *mut c_void,
568        cb_args: size_t,
569        num_mem_objects: cl_uint,
570        mem_list: *const cl_mem,
571        args_mem_loc: *mut *const c_void,
572        num_events_in_wait_list: cl_uint,
573        event_wait_list: *const cl_event,
574        event: *mut cl_event,
575    ) -> cl_int,
576>;
577pub type clEnqueueNativeKernel_fn = clEnqueueNativeKernel_t;
578
579pub type clSetCommandQueueProperty_t = Option<
580    unsafe extern "C" fn(
581        command_queue: cl_command_queue,
582        properties: cl_command_queue_properties,
583        enable: cl_bool,
584        old_properties: *mut cl_command_queue_properties,
585    ) -> cl_int,
586>;
587pub type clSetCommandQueueProperty_fn = clSetCommandQueueProperty_t;
588
589pub type clCreateImage2D_t = Option<
590    unsafe extern "C" fn(
591        context: cl_context,
592        flags: cl_mem_flags,
593        image_format: *const cl_image_format,
594        image_width: size_t,
595        image_height: size_t,
596        image_row_pitch: size_t,
597        host_ptr: *mut c_void,
598        errcode_ret: *mut cl_int,
599    ) -> cl_mem,
600>;
601pub type clCreateImage2D_fn = clCreateImage2D_t;
602
603pub type clCreateImage3D_t = Option<
604    unsafe extern "C" fn(
605        context: cl_context,
606        flags: cl_mem_flags,
607        image_format: *const cl_image_format,
608        image_width: size_t,
609        image_height: size_t,
610        image_depth: size_t,
611        image_row_pitch: size_t,
612        image_slice_pitch: size_t,
613        host_ptr: *mut c_void,
614        errcode_ret: *mut cl_int,
615    ) -> cl_mem,
616>;
617pub type clCreateImage3D_fn = clCreateImage3D_t;
618
619pub type clEnqueueMarker_t =
620    Option<unsafe extern "C" fn(command_queue: cl_command_queue, event: *mut cl_event) -> cl_int>;
621pub type clEnqueueMarker_fn = clEnqueueMarker_t;
622
623pub type clEnqueueWaitForEvents_t = Option<
624    unsafe extern "C" fn(
625        command_queue: cl_command_queue,
626        num_events: cl_uint,
627        event_list: *const cl_event,
628    ) -> cl_int,
629>;
630pub type clEnqueueWaitForEvents_fn = clEnqueueWaitForEvents_t;
631
632pub type clEnqueueBarrier_t =
633    Option<unsafe extern "C" fn(command_queue: cl_command_queue) -> cl_int>;
634pub type clEnqueueBarrier_fn = clEnqueueBarrier_t;
635
636pub type clUnloadCompiler_t = Option<unsafe extern "C" fn() -> cl_int>;
637pub type clUnloadCompiler_fn = clUnloadCompiler_t;
638
639pub type clGetExtensionFunctionAddress_t =
640    Option<unsafe extern "C" fn(func_name: *const c_char) -> *mut c_void>;
641pub type clGetExtensionFunctionAddress_fn = clGetExtensionFunctionAddress_t;
642
643pub type clCreateCommandQueue_t = Option<
644    unsafe extern "C" fn(
645        context: cl_context,
646        device: cl_device_id,
647        properties: cl_command_queue_properties,
648        errcode_ret: *mut cl_int,
649    ) -> cl_command_queue,
650>;
651pub type clCreateCommandQueue_fn = clCreateCommandQueue_t;
652
653pub type clCreateSampler_t = Option<
654    unsafe extern "C" fn(
655        context: cl_context,
656        normalized_coords: cl_bool,
657        addressing_mode: cl_addressing_mode,
658        filter_mode: cl_filter_mode,
659        errcode_ret: *mut cl_int,
660    ) -> cl_sampler,
661>;
662pub type clCreateSampler_fn = clCreateSampler_t;
663
664pub type clEnqueueTask_t = Option<
665    unsafe extern "C" fn(
666        command_queue: cl_command_queue,
667        kernel: cl_kernel,
668        num_events_in_wait_list: cl_uint,
669        event_wait_list: *const cl_event,
670        event: *mut cl_event,
671    ) -> cl_int,
672>;
673pub type clEnqueueTask_fn = clEnqueueTask_t;
674
675pub type clCreateSubBuffer_t = Option<
676    unsafe extern "C" fn(
677        buffer: cl_mem,
678        flags: cl_mem_flags,
679        buffer_create_type: cl_buffer_create_type,
680        buffer_create_info: *const c_void,
681        errcode_ret: *mut cl_int,
682    ) -> cl_mem,
683>;
684pub type clCreateSubBuffer_fn = clCreateSubBuffer_t;
685
686pub type clSetMemObjectDestructorCallback_t = Option<
687    unsafe extern "C" fn(
688        memobj: cl_mem,
689        pfn_notify: Option<unsafe extern "C" fn(memobj: cl_mem, user_data: *mut c_void)>,
690        user_data: *mut c_void,
691    ) -> cl_int,
692>;
693pub type clSetMemObjectDestructorCallback_fn = clSetMemObjectDestructorCallback_t;
694
695pub type clCreateUserEvent_t =
696    Option<unsafe extern "C" fn(context: cl_context, errcode_ret: *mut cl_int) -> cl_event>;
697pub type clCreateUserEvent_fn = clCreateUserEvent_t;
698
699pub type clSetUserEventStatus_t =
700    Option<unsafe extern "C" fn(event: cl_event, execution_status: cl_int) -> cl_int>;
701pub type clSetUserEventStatus_fn = clSetUserEventStatus_t;
702
703pub type clSetEventCallback_t = Option<
704    unsafe extern "C" fn(
705        event: cl_event,
706        command_exec_callback_type: cl_int,
707        pfn_notify: Option<
708            unsafe extern "C" fn(
709                event: cl_event,
710                event_command_status: cl_int,
711                user_data: *mut c_void,
712            ),
713        >,
714        user_data: *mut c_void,
715    ) -> cl_int,
716>;
717pub type clSetEventCallback_fn = clSetEventCallback_t;
718
719pub type clEnqueueReadBufferRect_t = Option<
720    unsafe extern "C" fn(
721        command_queue: cl_command_queue,
722        buffer: cl_mem,
723        blocking_read: cl_bool,
724        buffer_origin: *const size_t,
725        host_origin: *const size_t,
726        region: *const size_t,
727        buffer_row_pitch: size_t,
728        buffer_slice_pitch: size_t,
729        host_row_pitch: size_t,
730        host_slice_pitch: size_t,
731        ptr: *mut c_void,
732        num_events_in_wait_list: cl_uint,
733        event_wait_list: *const cl_event,
734        event: *mut cl_event,
735    ) -> cl_int,
736>;
737pub type clEnqueueReadBufferRect_fn = clEnqueueReadBufferRect_t;
738
739pub type clEnqueueWriteBufferRect_t = Option<
740    unsafe extern "C" fn(
741        command_queue: cl_command_queue,
742        buffer: cl_mem,
743        blocking_write: cl_bool,
744        buffer_origin: *const size_t,
745        host_origin: *const size_t,
746        region: *const size_t,
747        buffer_row_pitch: size_t,
748        buffer_slice_pitch: size_t,
749        host_row_pitch: size_t,
750        host_slice_pitch: size_t,
751        ptr: *const c_void,
752        num_events_in_wait_list: cl_uint,
753        event_wait_list: *const cl_event,
754        event: *mut cl_event,
755    ) -> cl_int,
756>;
757pub type clEnqueueWriteBufferRect_fn = clEnqueueWriteBufferRect_t;
758
759pub type clEnqueueCopyBufferRect_t = Option<
760    unsafe extern "C" fn(
761        command_queue: cl_command_queue,
762        src_buffer: cl_mem,
763        dst_buffer: cl_mem,
764        src_origin: *const size_t,
765        dst_origin: *const size_t,
766        region: *const size_t,
767        src_row_pitch: size_t,
768        src_slice_pitch: size_t,
769        dst_row_pitch: size_t,
770        dst_slice_pitch: size_t,
771        num_events_in_wait_list: cl_uint,
772        event_wait_list: *const cl_event,
773        event: *mut cl_event,
774    ) -> cl_int,
775>;
776pub type clEnqueueCopyBufferRect_fn = clEnqueueCopyBufferRect_t;
777
778pub type clCreateSubDevices_t = Option<
779    unsafe extern "C" fn(
780        in_device: cl_device_id,
781        properties: *const cl_device_partition_property,
782        num_devices: cl_uint,
783        out_devices: *mut cl_device_id,
784        num_devices_ret: *mut cl_uint,
785    ) -> cl_int,
786>;
787pub type clCreateSubDevices_fn = clCreateSubDevices_t;
788
789pub type clRetainDevice_t = Option<unsafe extern "C" fn(device: cl_device_id) -> cl_int>;
790pub type clRetainDevice_fn = clRetainDevice_t;
791
792pub type clReleaseDevice_t = Option<unsafe extern "C" fn(device: cl_device_id) -> cl_int>;
793pub type clReleaseDevice_fn = clReleaseDevice_t;
794
795pub type clCreateImage_t = Option<
796    unsafe extern "C" fn(
797        context: cl_context,
798        flags: cl_mem_flags,
799        image_format: *const cl_image_format,
800        image_desc: *const cl_image_desc,
801        host_ptr: *mut c_void,
802        errcode_ret: *mut cl_int,
803    ) -> cl_mem,
804>;
805pub type clCreateImage_fn = clCreateImage_t;
806
807pub type clCreateProgramWithBuiltInKernels_t = Option<
808    unsafe extern "C" fn(
809        context: cl_context,
810        num_devices: cl_uint,
811        device_list: *const cl_device_id,
812        kernel_names: *const c_char,
813        errcode_ret: *mut cl_int,
814    ) -> cl_program,
815>;
816pub type clCreateProgramWithBuiltInKernels_fn = clCreateProgramWithBuiltInKernels_t;
817
818pub type clCompileProgram_t = Option<
819    unsafe extern "C" fn(
820        program: cl_program,
821        num_devices: cl_uint,
822        device_list: *const cl_device_id,
823        options: *const c_char,
824        num_input_headers: cl_uint,
825        input_headers: *const cl_program,
826        header_include_names: *mut *const c_char,
827        pfn_notify: Option<unsafe extern "C" fn(program: cl_program, user_data: *mut c_void)>,
828        user_data: *mut c_void,
829    ) -> cl_int,
830>;
831pub type clCompileProgram_fn = clCompileProgram_t;
832
833pub type clLinkProgram_t = Option<
834    unsafe extern "C" fn(
835        context: cl_context,
836        num_devices: cl_uint,
837        device_list: *const cl_device_id,
838        options: *const c_char,
839        num_input_programs: cl_uint,
840        input_programs: *const cl_program,
841        pfn_notify: Option<unsafe extern "C" fn(program: cl_program, user_data: *mut c_void)>,
842        user_data: *mut c_void,
843        errcode_ret: *mut cl_int,
844    ) -> cl_program,
845>;
846pub type clLinkProgram_fn = clLinkProgram_t;
847
848pub type clUnloadPlatformCompiler_t =
849    Option<unsafe extern "C" fn(platform: cl_platform_id) -> cl_int>;
850pub type clUnloadPlatformCompiler_fn = clUnloadPlatformCompiler_t;
851
852pub type clGetKernelArgInfo_t = Option<
853    unsafe extern "C" fn(
854        kernel: cl_kernel,
855        arg_index: cl_uint,
856        param_name: cl_kernel_arg_info,
857        param_value_size: size_t,
858        param_value: *mut c_void,
859        param_value_size_ret: *mut size_t,
860    ) -> cl_int,
861>;
862pub type clGetKernelArgInfo_fn = clGetKernelArgInfo_t;
863
864pub type clEnqueueFillBuffer_t = Option<
865    unsafe extern "C" fn(
866        command_queue: cl_command_queue,
867        buffer: cl_mem,
868        pattern: *const c_void,
869        pattern_size: size_t,
870        offset: size_t,
871        size: size_t,
872        num_events_in_wait_list: cl_uint,
873        event_wait_list: *const cl_event,
874        event: *mut cl_event,
875    ) -> cl_int,
876>;
877pub type clEnqueueFillBuffer_fn = clEnqueueFillBuffer_t;
878
879pub type clEnqueueFillImage_t = Option<
880    unsafe extern "C" fn(
881        command_queue: cl_command_queue,
882        image: cl_mem,
883        fill_color: *const c_void,
884        origin: *const size_t,
885        region: *const size_t,
886        num_events_in_wait_list: cl_uint,
887        event_wait_list: *const cl_event,
888        event: *mut cl_event,
889    ) -> cl_int,
890>;
891pub type clEnqueueFillImage_fn = clEnqueueFillImage_t;
892
893pub type clEnqueueMigrateMemObjects_t = Option<
894    unsafe extern "C" fn(
895        command_queue: cl_command_queue,
896        num_mem_objects: cl_uint,
897        mem_objects: *const cl_mem,
898        flags: cl_mem_migration_flags,
899        num_events_in_wait_list: cl_uint,
900        event_wait_list: *const cl_event,
901        event: *mut cl_event,
902    ) -> cl_int,
903>;
904pub type clEnqueueMigrateMemObjects_fn = clEnqueueMigrateMemObjects_t;
905
906pub type clEnqueueMarkerWithWaitList_t = Option<
907    unsafe extern "C" fn(
908        command_queue: cl_command_queue,
909        num_events_in_wait_list: cl_uint,
910        event_wait_list: *const cl_event,
911        event: *mut cl_event,
912    ) -> cl_int,
913>;
914pub type clEnqueueMarkerWithWaitList_fn = clEnqueueMarkerWithWaitList_t;
915
916pub type clEnqueueBarrierWithWaitList_t = Option<
917    unsafe extern "C" fn(
918        command_queue: cl_command_queue,
919        num_events_in_wait_list: cl_uint,
920        event_wait_list: *const cl_event,
921        event: *mut cl_event,
922    ) -> cl_int,
923>;
924pub type clEnqueueBarrierWithWaitList_fn = clEnqueueBarrierWithWaitList_t;
925
926pub type clGetExtensionFunctionAddressForPlatform_t =
927    Option<unsafe extern "C" fn(platform: cl_platform_id, func_name: *const c_char) -> *mut c_void>;
928pub type clGetExtensionFunctionAddressForPlatform_fn = clGetExtensionFunctionAddressForPlatform_t;
929
930pub type clCreateCommandQueueWithProperties_t = Option<
931    unsafe extern "C" fn(
932        context: cl_context,
933        device: cl_device_id,
934        properties: *const cl_queue_properties,
935        errcode_ret: *mut cl_int,
936    ) -> cl_command_queue,
937>;
938pub type clCreateCommandQueueWithProperties_fn = clCreateCommandQueueWithProperties_t;
939
940pub type clCreatePipe_t = Option<
941    unsafe extern "C" fn(
942        context: cl_context,
943        flags: cl_mem_flags,
944        pipe_packet_size: cl_uint,
945        pipe_max_packets: cl_uint,
946        properties: *const cl_pipe_properties,
947        errcode_ret: *mut cl_int,
948    ) -> cl_mem,
949>;
950pub type clCreatePipe_fn = clCreatePipe_t;
951
952pub type clGetPipeInfo_t = Option<
953    unsafe extern "C" fn(
954        pipe: cl_mem,
955        param_name: cl_pipe_info,
956        param_value_size: size_t,
957        param_value: *mut c_void,
958        param_value_size_ret: *mut size_t,
959    ) -> cl_int,
960>;
961pub type clGetPipeInfo_fn = clGetPipeInfo_t;
962
963pub type clSVMAlloc_t = Option<
964    unsafe extern "C" fn(
965        context: cl_context,
966        flags: cl_svm_mem_flags,
967        size: size_t,
968        alignment: cl_uint,
969    ) -> *mut c_void,
970>;
971pub type clSVMAlloc_fn = clSVMAlloc_t;
972
973pub type clSVMFree_t = Option<unsafe extern "C" fn(context: cl_context, svm_pointer: *mut c_void)>;
974pub type clSVMFree_fn = clSVMFree_t;
975
976pub type clCreateSamplerWithProperties_t = Option<
977    unsafe extern "C" fn(
978        context: cl_context,
979        sampler_properties: *const cl_sampler_properties,
980        errcode_ret: *mut cl_int,
981    ) -> cl_sampler,
982>;
983pub type clCreateSamplerWithProperties_fn = clCreateSamplerWithProperties_t;
984
985pub type clSetKernelArgSVMPointer_t = Option<
986    unsafe extern "C" fn(kernel: cl_kernel, arg_index: cl_uint, arg_value: *const c_void) -> cl_int,
987>;
988pub type clSetKernelArgSVMPointer_fn = clSetKernelArgSVMPointer_t;
989
990pub type clSetKernelExecInfo_t = Option<
991    unsafe extern "C" fn(
992        kernel: cl_kernel,
993        param_name: cl_kernel_exec_info,
994        param_value_size: size_t,
995        param_value: *const c_void,
996    ) -> cl_int,
997>;
998pub type clSetKernelExecInfo_fn = clSetKernelExecInfo_t;
999
1000pub type clEnqueueSVMFree_t = Option<
1001    unsafe extern "C" fn(
1002        command_queue: cl_command_queue,
1003        num_svm_pointers: cl_uint,
1004        svm_pointers: *mut *mut c_void,
1005        pfn_free_func: Option<
1006            unsafe extern "C" fn(
1007                queue: cl_command_queue,
1008                num_svm_pointers: cl_uint,
1009                svm_pointers: *mut *mut c_void,
1010                user_data: *mut c_void,
1011            ),
1012        >,
1013        user_data: *mut c_void,
1014        num_events_in_wait_list: cl_uint,
1015        event_wait_list: *const cl_event,
1016        event: *mut cl_event,
1017    ) -> cl_int,
1018>;
1019pub type clEnqueueSVMFree_fn = clEnqueueSVMFree_t;
1020
1021pub type clEnqueueSVMMemcpy_t = Option<
1022    unsafe extern "C" fn(
1023        command_queue: cl_command_queue,
1024        blocking_copy: cl_bool,
1025        dst_ptr: *mut c_void,
1026        src_ptr: *const c_void,
1027        size: size_t,
1028        num_events_in_wait_list: cl_uint,
1029        event_wait_list: *const cl_event,
1030        event: *mut cl_event,
1031    ) -> cl_int,
1032>;
1033pub type clEnqueueSVMMemcpy_fn = clEnqueueSVMMemcpy_t;
1034
1035pub type clEnqueueSVMMemFill_t = Option<
1036    unsafe extern "C" fn(
1037        command_queue: cl_command_queue,
1038        svm_ptr: *mut c_void,
1039        pattern: *const c_void,
1040        pattern_size: size_t,
1041        size: size_t,
1042        num_events_in_wait_list: cl_uint,
1043        event_wait_list: *const cl_event,
1044        event: *mut cl_event,
1045    ) -> cl_int,
1046>;
1047pub type clEnqueueSVMMemFill_fn = clEnqueueSVMMemFill_t;
1048
1049pub type clEnqueueSVMMap_t = Option<
1050    unsafe extern "C" fn(
1051        command_queue: cl_command_queue,
1052        blocking_map: cl_bool,
1053        flags: cl_map_flags,
1054        svm_ptr: *mut c_void,
1055        size: size_t,
1056        num_events_in_wait_list: cl_uint,
1057        event_wait_list: *const cl_event,
1058        event: *mut cl_event,
1059    ) -> cl_int,
1060>;
1061pub type clEnqueueSVMMap_fn = clEnqueueSVMMap_t;
1062
1063pub type clEnqueueSVMUnmap_t = Option<
1064    unsafe extern "C" fn(
1065        command_queue: cl_command_queue,
1066        svm_ptr: *mut c_void,
1067        num_events_in_wait_list: cl_uint,
1068        event_wait_list: *const cl_event,
1069        event: *mut cl_event,
1070    ) -> cl_int,
1071>;
1072pub type clEnqueueSVMUnmap_fn = clEnqueueSVMUnmap_t;
1073
1074pub type clSetDefaultDeviceCommandQueue_t = Option<
1075    unsafe extern "C" fn(
1076        context: cl_context,
1077        device: cl_device_id,
1078        command_queue: cl_command_queue,
1079    ) -> cl_int,
1080>;
1081pub type clSetDefaultDeviceCommandQueue_fn = clSetDefaultDeviceCommandQueue_t;
1082
1083pub type clGetDeviceAndHostTimer_t = Option<
1084    unsafe extern "C" fn(
1085        device: cl_device_id,
1086        device_timestamp: *mut cl_ulong,
1087        host_timestamp: *mut cl_ulong,
1088    ) -> cl_int,
1089>;
1090pub type clGetDeviceAndHostTimer_fn = clGetDeviceAndHostTimer_t;
1091
1092pub type clGetHostTimer_t =
1093    Option<unsafe extern "C" fn(device: cl_device_id, host_timestamp: *mut cl_ulong) -> cl_int>;
1094pub type clGetHostTimer_fn = clGetHostTimer_t;
1095
1096pub type clCreateProgramWithIL_t = Option<
1097    unsafe extern "C" fn(
1098        context: cl_context,
1099        il: *const c_void,
1100        length: size_t,
1101        errcode_ret: *mut cl_int,
1102    ) -> cl_program,
1103>;
1104pub type clCreateProgramWithIL_fn = clCreateProgramWithIL_t;
1105
1106pub type clCloneKernel_t =
1107    Option<unsafe extern "C" fn(source_kernel: cl_kernel, errcode_ret: *mut cl_int) -> cl_kernel>;
1108pub type clCloneKernel_fn = clCloneKernel_t;
1109
1110pub type clGetKernelSubGroupInfo_t = Option<
1111    unsafe extern "C" fn(
1112        kernel: cl_kernel,
1113        device: cl_device_id,
1114        param_name: cl_kernel_sub_group_info,
1115        input_value_size: size_t,
1116        input_value: *const c_void,
1117        param_value_size: size_t,
1118        param_value: *mut c_void,
1119        param_value_size_ret: *mut size_t,
1120    ) -> cl_int,
1121>;
1122pub type clGetKernelSubGroupInfo_fn = clGetKernelSubGroupInfo_t;
1123
1124pub type clEnqueueSVMMigrateMem_t = Option<
1125    unsafe extern "C" fn(
1126        command_queue: cl_command_queue,
1127        num_svm_pointers: cl_uint,
1128        svm_pointers: *mut *const c_void,
1129        sizes: *const size_t,
1130        flags: cl_mem_migration_flags,
1131        num_events_in_wait_list: cl_uint,
1132        event_wait_list: *const cl_event,
1133        event: *mut cl_event,
1134    ) -> cl_int,
1135>;
1136pub type clEnqueueSVMMigrateMem_fn = clEnqueueSVMMigrateMem_t;
1137
1138pub type clSetProgramSpecializationConstant_t = Option<
1139    unsafe extern "C" fn(
1140        program: cl_program,
1141        spec_id: cl_uint,
1142        spec_size: size_t,
1143        spec_value: *const c_void,
1144    ) -> cl_int,
1145>;
1146pub type clSetProgramSpecializationConstant_fn = clSetProgramSpecializationConstant_t;
1147
1148pub type clSetProgramReleaseCallback_t = Option<
1149    unsafe extern "C" fn(
1150        program: cl_program,
1151        pfn_notify: Option<unsafe extern "C" fn(program: cl_program, user_data: *mut c_void)>,
1152        user_data: *mut c_void,
1153    ) -> cl_int,
1154>;
1155pub type clSetProgramReleaseCallback_fn = clSetProgramReleaseCallback_t;
1156
1157pub type clSetContextDestructorCallback_t = Option<
1158    unsafe extern "C" fn(
1159        context: cl_context,
1160        pfn_notify: Option<unsafe extern "C" fn(context: cl_context, user_data: *mut c_void)>,
1161        user_data: *mut c_void,
1162    ) -> cl_int,
1163>;
1164pub type clSetContextDestructorCallback_fn = clSetContextDestructorCallback_t;
1165
1166pub type clCreateBufferWithProperties_t = Option<
1167    unsafe extern "C" fn(
1168        context: cl_context,
1169        properties: *const cl_mem_properties,
1170        flags: cl_mem_flags,
1171        size: size_t,
1172        host_ptr: *mut c_void,
1173        errcode_ret: *mut cl_int,
1174    ) -> cl_mem,
1175>;
1176pub type clCreateBufferWithProperties_fn = clCreateBufferWithProperties_t;
1177
1178pub type clCreateImageWithProperties_t = Option<
1179    unsafe extern "C" fn(
1180        context: cl_context,
1181        properties: *const cl_mem_properties,
1182        flags: cl_mem_flags,
1183        image_format: *const cl_image_format,
1184        image_desc: *const cl_image_desc,
1185        host_ptr: *mut c_void,
1186        errcode_ret: *mut cl_int,
1187    ) -> cl_mem,
1188>;
1189pub type clCreateImageWithProperties_fn = clCreateImageWithProperties_t;