Skip to main content

apple_mpsgraph/ffi/
mod.rs

1use core::ffi::{c_char, c_void};
2
3/// Mirrors the `MPSGraph` framework counterpart for `TensorArrayCallback`.
4pub type TensorArrayCallback = unsafe extern "C" fn(context: *mut c_void) -> *mut c_void;
5/// Mirrors the `MPSGraph` framework counterpart for `TensorArrayInputCallback`.
6pub type TensorArrayInputCallback =
7    unsafe extern "C" fn(context: *mut c_void, input_box_handle: *mut c_void) -> *mut c_void;
8/// Mirrors the `MPSGraph` framework counterpart for `WhileBeforeCallback`.
9pub type WhileBeforeCallback = unsafe extern "C" fn(
10    context: *mut c_void,
11    input_box_handle: *mut c_void,
12    out_result_box_handle: *mut *mut c_void,
13) -> *mut c_void;
14/// Mirrors the `MPSGraph` framework counterpart for `ForBodyCallback`.
15pub type ForBodyCallback = unsafe extern "C" fn(
16    context: *mut c_void,
17    index_handle: *mut c_void,
18    input_box_handle: *mut c_void,
19) -> *mut c_void;
20
21mod specialized;
22/// Re-exports the `MPSGraph` framework surface for this item.
23pub use specialized::*;
24
25unsafe extern "C" {
26/// Calls the `MPSGraph` framework counterpart for `mpsgraph_object_release`.
27    pub fn mpsgraph_object_release(handle: *mut c_void);
28
29/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_new_with_bytes`.
30    pub fn mpsgraph_tensor_data_new_with_bytes(
31        device_handle: *mut c_void,
32        bytes: *const c_void,
33        byte_len: usize,
34        shape: *const usize,
35        shape_len: usize,
36        data_type: u32,
37    ) -> *mut c_void;
38/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_new_with_buffer`.
39    pub fn mpsgraph_tensor_data_new_with_buffer(
40        buffer_handle: *mut c_void,
41        shape: *const usize,
42        shape_len: usize,
43        data_type: u32,
44    ) -> *mut c_void;
45/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_new_with_tensor`.
46    pub fn mpsgraph_tensor_data_new_with_tensor(tensor_handle: *mut c_void) -> *mut c_void;
47/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_data_type`.
48    pub fn mpsgraph_tensor_data_data_type(handle: *mut c_void) -> u32;
49/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_shape_len`.
50    pub fn mpsgraph_tensor_data_shape_len(handle: *mut c_void) -> usize;
51/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_copy_shape`.
52    pub fn mpsgraph_tensor_data_copy_shape(handle: *mut c_void, out_shape: *mut usize);
53/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_read_bytes`.
54    pub fn mpsgraph_tensor_data_read_bytes(
55        handle: *mut c_void,
56        dst: *mut c_void,
57        dst_len: usize,
58    ) -> bool;
59/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_device`.
60    pub fn mpsgraph_tensor_data_device(handle: *mut c_void) -> *mut c_void;
61
62/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_new`.
63    pub fn mpsgraph_graph_new() -> *mut c_void;
64/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_placeholder`.
65    pub fn mpsgraph_graph_placeholder(
66        graph_handle: *mut c_void,
67        shape: *const usize,
68        shape_len: usize,
69        data_type: u32,
70        name: *const c_char,
71    ) -> *mut c_void;
72/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_constant_data`.
73    pub fn mpsgraph_graph_constant_data(
74        graph_handle: *mut c_void,
75        bytes: *const c_void,
76        byte_len: usize,
77        shape: *const usize,
78        shape_len: usize,
79        data_type: u32,
80    ) -> *mut c_void;
81/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_constant_scalar`.
82    pub fn mpsgraph_graph_constant_scalar(
83        graph_handle: *mut c_void,
84        scalar: f64,
85        data_type: u32,
86    ) -> *mut c_void;
87/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_constant_scalar_shaped`.
88    pub fn mpsgraph_graph_constant_scalar_shaped(
89        graph_handle: *mut c_void,
90        scalar: f64,
91        shape: *const usize,
92        shape_len: usize,
93        data_type: u32,
94    ) -> *mut c_void;
95
96/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_addition`.
97    pub fn mpsgraph_graph_addition(
98        graph_handle: *mut c_void,
99        primary_tensor: *mut c_void,
100        secondary_tensor: *mut c_void,
101        name: *const c_char,
102    ) -> *mut c_void;
103/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_subtraction`.
104    pub fn mpsgraph_graph_subtraction(
105        graph_handle: *mut c_void,
106        primary_tensor: *mut c_void,
107        secondary_tensor: *mut c_void,
108        name: *const c_char,
109    ) -> *mut c_void;
110/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_multiplication`.
111    pub fn mpsgraph_graph_multiplication(
112        graph_handle: *mut c_void,
113        primary_tensor: *mut c_void,
114        secondary_tensor: *mut c_void,
115        name: *const c_char,
116    ) -> *mut c_void;
117/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_division`.
118    pub fn mpsgraph_graph_division(
119        graph_handle: *mut c_void,
120        primary_tensor: *mut c_void,
121        secondary_tensor: *mut c_void,
122        name: *const c_char,
123    ) -> *mut c_void;
124/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_matrix_multiplication`.
125    pub fn mpsgraph_graph_matrix_multiplication(
126        graph_handle: *mut c_void,
127        primary_tensor: *mut c_void,
128        secondary_tensor: *mut c_void,
129        name: *const c_char,
130    ) -> *mut c_void;
131/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_relu`.
132    pub fn mpsgraph_graph_relu(
133        graph_handle: *mut c_void,
134        tensor: *mut c_void,
135        name: *const c_char,
136    ) -> *mut c_void;
137/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_sigmoid`.
138    pub fn mpsgraph_graph_sigmoid(
139        graph_handle: *mut c_void,
140        tensor: *mut c_void,
141        name: *const c_char,
142    ) -> *mut c_void;
143/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_softmax`.
144    pub fn mpsgraph_graph_softmax(
145        graph_handle: *mut c_void,
146        tensor: *mut c_void,
147        axis: isize,
148        name: *const c_char,
149    ) -> *mut c_void;
150/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reshape`.
151    pub fn mpsgraph_graph_reshape(
152        graph_handle: *mut c_void,
153        tensor: *mut c_void,
154        shape: *const usize,
155        shape_len: usize,
156        name: *const c_char,
157    ) -> *mut c_void;
158/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_transpose`.
159    pub fn mpsgraph_graph_transpose(
160        graph_handle: *mut c_void,
161        tensor: *mut c_void,
162        permutation: *const usize,
163        permutation_len: usize,
164        name: *const c_char,
165    ) -> *mut c_void;
166/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_slice`.
167    pub fn mpsgraph_graph_slice(
168        graph_handle: *mut c_void,
169        tensor: *mut c_void,
170        dimension: usize,
171        start: isize,
172        length: isize,
173        name: *const c_char,
174    ) -> *mut c_void;
175/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_broadcast`.
176    pub fn mpsgraph_graph_broadcast(
177        graph_handle: *mut c_void,
178        tensor: *mut c_void,
179        shape: *const usize,
180        shape_len: usize,
181        name: *const c_char,
182    ) -> *mut c_void;
183/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_sum`.
184    pub fn mpsgraph_graph_reduction_sum(
185        graph_handle: *mut c_void,
186        tensor: *mut c_void,
187        axes: *const usize,
188        axes_len: usize,
189        name: *const c_char,
190    ) -> *mut c_void;
191/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_maximum`.
192    pub fn mpsgraph_graph_reduction_maximum(
193        graph_handle: *mut c_void,
194        tensor: *mut c_void,
195        axes: *const usize,
196        axes_len: usize,
197        name: *const c_char,
198    ) -> *mut c_void;
199/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_minimum`.
200    pub fn mpsgraph_graph_reduction_minimum(
201        graph_handle: *mut c_void,
202        tensor: *mut c_void,
203        axes: *const usize,
204        axes_len: usize,
205        name: *const c_char,
206    ) -> *mut c_void;
207/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_mean`.
208    pub fn mpsgraph_graph_mean(
209        graph_handle: *mut c_void,
210        tensor: *mut c_void,
211        axes: *const usize,
212        axes_len: usize,
213        name: *const c_char,
214    ) -> *mut c_void;
215
216/// Calls the `MPSGraph` framework counterpart for `mpsgraph_convolution2d_descriptor_new`.
217    pub fn mpsgraph_convolution2d_descriptor_new(
218        stride_in_x: usize,
219        stride_in_y: usize,
220        dilation_rate_in_x: usize,
221        dilation_rate_in_y: usize,
222        groups: usize,
223        padding_left: usize,
224        padding_right: usize,
225        padding_top: usize,
226        padding_bottom: usize,
227        padding_style: usize,
228        data_layout: usize,
229        weights_layout: usize,
230    ) -> *mut c_void;
231/// Calls the `MPSGraph` framework counterpart for `mpsgraph_pooling2d_descriptor_new`.
232    pub fn mpsgraph_pooling2d_descriptor_new(
233        kernel_width: usize,
234        kernel_height: usize,
235        stride_in_x: usize,
236        stride_in_y: usize,
237        dilation_rate_in_x: usize,
238        dilation_rate_in_y: usize,
239        padding_left: usize,
240        padding_right: usize,
241        padding_top: usize,
242        padding_bottom: usize,
243        padding_style: usize,
244        data_layout: usize,
245    ) -> *mut c_void;
246/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_convolution2d`.
247    pub fn mpsgraph_graph_convolution2d(
248        graph_handle: *mut c_void,
249        source_tensor: *mut c_void,
250        weights_tensor: *mut c_void,
251        descriptor_handle: *mut c_void,
252        name: *const c_char,
253    ) -> *mut c_void;
254/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_max_pooling2d`.
255    pub fn mpsgraph_graph_max_pooling2d(
256        graph_handle: *mut c_void,
257        source_tensor: *mut c_void,
258        descriptor_handle: *mut c_void,
259        name: *const c_char,
260    ) -> *mut c_void;
261/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_normalize`.
262    pub fn mpsgraph_graph_normalize(
263        graph_handle: *mut c_void,
264        tensor: *mut c_void,
265        mean_tensor: *mut c_void,
266        variance_tensor: *mut c_void,
267        gamma_tensor: *mut c_void,
268        beta_tensor: *mut c_void,
269        epsilon: f32,
270        name: *const c_char,
271    ) -> *mut c_void;
272
273/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_run`.
274    pub fn mpsgraph_graph_run(
275        graph_handle: *mut c_void,
276        feed_tensors: *const *mut c_void,
277        feed_data: *const *mut c_void,
278        feed_count: usize,
279        target_tensors: *const *mut c_void,
280        target_count: usize,
281        out_results: *mut *mut c_void,
282    ) -> bool;
283/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_run_with_command_queue`.
284    pub fn mpsgraph_graph_run_with_command_queue(
285        graph_handle: *mut c_void,
286        command_queue_handle: *mut c_void,
287        feed_tensors: *const *mut c_void,
288        feed_data: *const *mut c_void,
289        feed_count: usize,
290        target_tensors: *const *mut c_void,
291        target_count: usize,
292        out_results: *mut *mut c_void,
293    ) -> bool;
294/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_compile`.
295    pub fn mpsgraph_graph_compile(
296        graph_handle: *mut c_void,
297        device_handle: *mut c_void,
298        feed_tensors: *const *mut c_void,
299        feed_count: usize,
300        flat_shapes: *const usize,
301        shape_lengths: *const usize,
302        data_types: *const u32,
303        target_tensors: *const *mut c_void,
304        target_count: usize,
305    ) -> *mut c_void;
306/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_run`.
307    pub fn mpsgraph_executable_run(
308        executable_handle: *mut c_void,
309        command_queue_handle: *mut c_void,
310        input_data: *const *mut c_void,
311        input_count: usize,
312        output_count: usize,
313        out_results: *mut *mut c_void,
314    ) -> bool;
315
316/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_array_box_len`.
317    pub fn mpsgraph_tensor_array_box_len(handle: *mut c_void) -> usize;
318/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_array_box_get`.
319    pub fn mpsgraph_tensor_array_box_get(handle: *mut c_void, index: usize) -> *mut c_void;
320/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_array_box_len`.
321    pub fn mpsgraph_tensor_data_array_box_len(handle: *mut c_void) -> usize;
322/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_array_box_get`.
323    pub fn mpsgraph_tensor_data_array_box_get(handle: *mut c_void, index: usize) -> *mut c_void;
324/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_array_box_len`.
325    pub fn mpsgraph_shaped_type_array_box_len(handle: *mut c_void) -> usize;
326/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_array_box_get`.
327    pub fn mpsgraph_shaped_type_array_box_get(handle: *mut c_void, index: usize) -> *mut c_void;
328
329/// Calls the `MPSGraph` framework counterpart for `mpsgraph_device_new_with_metal_device`.
330    pub fn mpsgraph_device_new_with_metal_device(metal_device_handle: *mut c_void) -> *mut c_void;
331/// Calls the `MPSGraph` framework counterpart for `mpsgraph_device_type`.
332    pub fn mpsgraph_device_type(handle: *mut c_void) -> u32;
333
334/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_new`.
335    pub fn mpsgraph_shaped_type_new(
336        shape: *const isize,
337        shape_len: usize,
338        data_type: u32,
339    ) -> *mut c_void;
340/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_has_shape`.
341    pub fn mpsgraph_shaped_type_has_shape(handle: *mut c_void) -> bool;
342/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_shape_len`.
343    pub fn mpsgraph_shaped_type_shape_len(handle: *mut c_void) -> usize;
344/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_copy_shape`.
345    pub fn mpsgraph_shaped_type_copy_shape(handle: *mut c_void, out_shape: *mut isize);
346/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_data_type`.
347    pub fn mpsgraph_shaped_type_data_type(handle: *mut c_void) -> u32;
348/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_set_shape`.
349    pub fn mpsgraph_shaped_type_set_shape(
350        handle: *mut c_void,
351        shape: *const isize,
352        shape_len: usize,
353    ) -> bool;
354/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_set_data_type`.
355    pub fn mpsgraph_shaped_type_set_data_type(handle: *mut c_void, data_type: u32) -> bool;
356/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_is_equal`.
357    pub fn mpsgraph_shaped_type_is_equal(handle: *mut c_void, other_handle: *mut c_void) -> bool;
358
359/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_has_shape`.
360    pub fn mpsgraph_tensor_has_shape(handle: *mut c_void) -> bool;
361/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_shape_len`.
362    pub fn mpsgraph_tensor_shape_len(handle: *mut c_void) -> usize;
363/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_copy_shape`.
364    pub fn mpsgraph_tensor_copy_shape(handle: *mut c_void, out_shape: *mut isize);
365/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_type`.
366    pub fn mpsgraph_tensor_data_type(handle: *mut c_void) -> u32;
367/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_operation`.
368    pub fn mpsgraph_tensor_operation(handle: *mut c_void) -> *mut c_void;
369
370/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_options`.
371    pub fn mpsgraph_graph_options(handle: *mut c_void) -> u64;
372/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_set_options`.
373    pub fn mpsgraph_graph_set_options(handle: *mut c_void, raw_value: u64) -> bool;
374/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_placeholder_tensors`.
375    pub fn mpsgraph_graph_placeholder_tensors(handle: *mut c_void) -> *mut c_void;
376
377/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_new`.
378    pub fn mpsgraph_compilation_descriptor_new() -> *mut c_void;
379/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_disable_type_inference`.
380    pub fn mpsgraph_compilation_descriptor_disable_type_inference(handle: *mut c_void) -> bool;
381/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_optimization_level`.
382    pub fn mpsgraph_compilation_descriptor_optimization_level(handle: *mut c_void) -> u64;
383/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_optimization_level`.
384    pub fn mpsgraph_compilation_descriptor_set_optimization_level(
385        handle: *mut c_void,
386        raw_value: u64,
387    ) -> bool;
388/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_wait_for_completion`.
389    pub fn mpsgraph_compilation_descriptor_wait_for_completion(handle: *mut c_void) -> bool;
390/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_wait_for_completion`.
391    pub fn mpsgraph_compilation_descriptor_set_wait_for_completion(
392        handle: *mut c_void,
393        value: bool,
394    ) -> bool;
395/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_optimization_profile`.
396    pub fn mpsgraph_compilation_descriptor_optimization_profile(handle: *mut c_void) -> u64;
397/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_optimization_profile`.
398    pub fn mpsgraph_compilation_descriptor_set_optimization_profile(
399        handle: *mut c_void,
400        raw_value: u64,
401    ) -> bool;
402/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_reduced_precision_fast_math`.
403    pub fn mpsgraph_compilation_descriptor_reduced_precision_fast_math(
404        handle: *mut c_void,
405    ) -> usize;
406/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_reduced_precision_fast_math`.
407    pub fn mpsgraph_compilation_descriptor_set_reduced_precision_fast_math(
408        handle: *mut c_void,
409        raw_value: usize,
410    ) -> bool;
411
412/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_new`.
413    pub fn mpsgraph_execution_descriptor_new() -> *mut c_void;
414/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_wait_until_completed`.
415    pub fn mpsgraph_execution_descriptor_wait_until_completed(handle: *mut c_void) -> bool;
416/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_set_wait_until_completed`.
417    pub fn mpsgraph_execution_descriptor_set_wait_until_completed(
418        handle: *mut c_void,
419        value: bool,
420    ) -> bool;
421/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_compilation_descriptor`.
422    pub fn mpsgraph_execution_descriptor_compilation_descriptor(handle: *mut c_void)
423        -> *mut c_void;
424/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_set_compilation_descriptor`.
425    pub fn mpsgraph_execution_descriptor_set_compilation_descriptor(
426        handle: *mut c_void,
427        compilation_descriptor_handle: *mut c_void,
428    ) -> bool;
429
430/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_execution_descriptor_new`.
431    pub fn mpsgraph_executable_execution_descriptor_new() -> *mut c_void;
432/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_execution_descriptor_wait_until_completed`.
433    pub fn mpsgraph_executable_execution_descriptor_wait_until_completed(
434        handle: *mut c_void,
435    ) -> bool;
436/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_execution_descriptor_set_wait_until_completed`.
437    pub fn mpsgraph_executable_execution_descriptor_set_wait_until_completed(
438        handle: *mut c_void,
439        value: bool,
440    ) -> bool;
441
442/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_new`.
443    pub fn mpsgraph_executable_serialization_descriptor_new() -> *mut c_void;
444/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_append`.
445    pub fn mpsgraph_executable_serialization_descriptor_append(handle: *mut c_void) -> bool;
446/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_set_append`.
447    pub fn mpsgraph_executable_serialization_descriptor_set_append(
448        handle: *mut c_void,
449        value: bool,
450    ) -> bool;
451/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_deployment_platform`.
452    pub fn mpsgraph_executable_serialization_descriptor_deployment_platform(
453        handle: *mut c_void,
454    ) -> u64;
455/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_set_deployment_platform`.
456    pub fn mpsgraph_executable_serialization_descriptor_set_deployment_platform(
457        handle: *mut c_void,
458        raw_value: u64,
459    ) -> bool;
460/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_minimum_deployment_target_len`.
461    pub fn mpsgraph_executable_serialization_descriptor_minimum_deployment_target_len(
462        handle: *mut c_void,
463    ) -> usize;
464/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_copy_minimum_deployment_target`.
465    pub fn mpsgraph_executable_serialization_descriptor_copy_minimum_deployment_target(
466        handle: *mut c_void,
467        out_bytes: *mut u8,
468        out_len: usize,
469    ) -> bool;
470/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_set_minimum_deployment_target`.
471    pub fn mpsgraph_executable_serialization_descriptor_set_minimum_deployment_target(
472        handle: *mut c_void,
473        value: *const c_char,
474    ) -> bool;
475
476/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_compile_with_descriptor`.
477    pub fn mpsgraph_graph_compile_with_descriptor(
478        graph_handle: *mut c_void,
479        device_handle: *mut c_void,
480        feed_tensors: *const *mut c_void,
481        feed_count: usize,
482        flat_shapes: *const usize,
483        shape_lengths: *const usize,
484        data_types: *const u32,
485        target_tensors: *const *mut c_void,
486        target_count: usize,
487        compilation_descriptor_handle: *mut c_void,
488    ) -> *mut c_void;
489
490/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_options`.
491    pub fn mpsgraph_executable_options(handle: *mut c_void) -> u64;
492/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_set_options`.
493    pub fn mpsgraph_executable_set_options(handle: *mut c_void, raw_value: u64) -> bool;
494/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_feed_tensors`.
495    pub fn mpsgraph_executable_feed_tensors(handle: *mut c_void) -> *mut c_void;
496/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_target_tensors`.
497    pub fn mpsgraph_executable_target_tensors(handle: *mut c_void) -> *mut c_void;
498/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_specialize`.
499    pub fn mpsgraph_executable_specialize(
500        handle: *mut c_void,
501        device_handle: *mut c_void,
502        input_type_handles: *const *mut c_void,
503        input_type_count: usize,
504        compilation_descriptor_handle: *mut c_void,
505    ) -> bool;
506/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_get_output_types`.
507    pub fn mpsgraph_executable_get_output_types(
508        handle: *mut c_void,
509        device_handle: *mut c_void,
510        input_type_handles: *const *mut c_void,
511        input_type_count: usize,
512        compilation_descriptor_handle: *mut c_void,
513    ) -> *mut c_void;
514/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_run_with_descriptor`.
515    pub fn mpsgraph_executable_run_with_descriptor(
516        executable_handle: *mut c_void,
517        command_queue_handle: *mut c_void,
518        input_handles: *const *mut c_void,
519        input_count: usize,
520        result_handles: *const *mut c_void,
521        result_count: usize,
522        execution_descriptor_handle: *mut c_void,
523    ) -> *mut c_void;
524/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_run_async_with_descriptor`.
525    pub fn mpsgraph_executable_run_async_with_descriptor(
526        executable_handle: *mut c_void,
527        command_queue_handle: *mut c_void,
528        input_handles: *const *mut c_void,
529        input_count: usize,
530        result_handles: *const *mut c_void,
531        result_count: usize,
532        execution_descriptor_handle: *mut c_void,
533    ) -> *mut c_void;
534/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialize_package`.
535    pub fn mpsgraph_executable_serialize_package(
536        handle: *mut c_void,
537        path: *const c_char,
538        descriptor_handle: *mut c_void,
539    ) -> bool;
540/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_new_with_package`.
541    pub fn mpsgraph_executable_new_with_package(
542        path: *const c_char,
543        compilation_descriptor_handle: *mut c_void,
544    ) -> *mut c_void;
545
546/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_arithmetic_unary`.
547    pub fn mpsgraph_graph_arithmetic_unary(
548        graph_handle: *mut c_void,
549        op: u32,
550        tensor_handle: *mut c_void,
551        name: *const c_char,
552    ) -> *mut c_void;
553/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_arithmetic_binary`.
554    pub fn mpsgraph_graph_arithmetic_binary(
555        graph_handle: *mut c_void,
556        op: u32,
557        primary_handle: *mut c_void,
558        secondary_handle: *mut c_void,
559        name: *const c_char,
560    ) -> *mut c_void;
561/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_select`.
562    pub fn mpsgraph_graph_select(
563        graph_handle: *mut c_void,
564        predicate_handle: *mut c_void,
565        true_handle: *mut c_void,
566        false_handle: *mut c_void,
567        name: *const c_char,
568    ) -> *mut c_void;
569/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_relu_gradient`.
570    pub fn mpsgraph_graph_relu_gradient(
571        graph_handle: *mut c_void,
572        gradient_handle: *mut c_void,
573        source_handle: *mut c_void,
574        name: *const c_char,
575    ) -> *mut c_void;
576/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_sigmoid_gradient`.
577    pub fn mpsgraph_graph_sigmoid_gradient(
578        graph_handle: *mut c_void,
579        gradient_handle: *mut c_void,
580        source_handle: *mut c_void,
581        name: *const c_char,
582    ) -> *mut c_void;
583/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_softmax_gradient`.
584    pub fn mpsgraph_graph_softmax_gradient(
585        graph_handle: *mut c_void,
586        gradient_handle: *mut c_void,
587        source_handle: *mut c_void,
588        axis: isize,
589        name: *const c_char,
590    ) -> *mut c_void;
591/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_leaky_relu_scalar`.
592    pub fn mpsgraph_graph_leaky_relu_scalar(
593        graph_handle: *mut c_void,
594        tensor_handle: *mut c_void,
595        alpha: f64,
596        name: *const c_char,
597    ) -> *mut c_void;
598/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_leaky_relu_tensor`.
599    pub fn mpsgraph_graph_leaky_relu_tensor(
600        graph_handle: *mut c_void,
601        tensor_handle: *mut c_void,
602        alpha_tensor_handle: *mut c_void,
603        name: *const c_char,
604    ) -> *mut c_void;
605/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_leaky_relu_gradient`.
606    pub fn mpsgraph_graph_leaky_relu_gradient(
607        graph_handle: *mut c_void,
608        gradient_handle: *mut c_void,
609        source_handle: *mut c_void,
610        alpha_tensor_handle: *mut c_void,
611        name: *const c_char,
612    ) -> *mut c_void;
613/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_axis`.
614    pub fn mpsgraph_graph_reduction_axis(
615        graph_handle: *mut c_void,
616        op: u32,
617        tensor_handle: *mut c_void,
618        axis: isize,
619        name: *const c_char,
620    ) -> *mut c_void;
621/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_axes`.
622    pub fn mpsgraph_graph_reduction_axes(
623        graph_handle: *mut c_void,
624        op: u32,
625        tensor_handle: *mut c_void,
626        axes: *const usize,
627        axes_len: usize,
628        name: *const c_char,
629    ) -> *mut c_void;
630/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_concat_pair`.
631    pub fn mpsgraph_graph_concat_pair(
632        graph_handle: *mut c_void,
633        first_handle: *mut c_void,
634        second_handle: *mut c_void,
635        dimension: isize,
636        name: *const c_char,
637    ) -> *mut c_void;
638/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_concat_tensors`.
639    pub fn mpsgraph_graph_concat_tensors(
640        graph_handle: *mut c_void,
641        tensor_handles: *const *mut c_void,
642        tensor_count: usize,
643        dimension: isize,
644        interleave: bool,
645        name: *const c_char,
646    ) -> *mut c_void;
647/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_split_sizes`.
648    pub fn mpsgraph_graph_split_sizes(
649        graph_handle: *mut c_void,
650        tensor_handle: *mut c_void,
651        split_sizes: *const usize,
652        split_count: usize,
653        axis: isize,
654        name: *const c_char,
655    ) -> *mut c_void;
656/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_split_sizes_tensor`.
657    pub fn mpsgraph_graph_split_sizes_tensor(
658        graph_handle: *mut c_void,
659        tensor_handle: *mut c_void,
660        split_sizes_tensor_handle: *mut c_void,
661        axis: isize,
662        name: *const c_char,
663    ) -> *mut c_void;
664/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_split_num`.
665    pub fn mpsgraph_graph_split_num(
666        graph_handle: *mut c_void,
667        tensor_handle: *mut c_void,
668        num_splits: usize,
669        axis: isize,
670        name: *const c_char,
671    ) -> *mut c_void;
672/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_stack`.
673    pub fn mpsgraph_graph_stack(
674        graph_handle: *mut c_void,
675        tensor_handles: *const *mut c_void,
676        tensor_count: usize,
677        axis: isize,
678        name: *const c_char,
679    ) -> *mut c_void;
680/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_pad`.
681    pub fn mpsgraph_graph_pad(
682        graph_handle: *mut c_void,
683        tensor_handle: *mut c_void,
684        padding_mode: isize,
685        left_padding: *const isize,
686        left_padding_len: usize,
687        right_padding: *const isize,
688        right_padding_len: usize,
689        constant_value: f64,
690        name: *const c_char,
691    ) -> *mut c_void;
692/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_top_k`.
693    pub fn mpsgraph_graph_top_k(
694        graph_handle: *mut c_void,
695        source_handle: *mut c_void,
696        k: usize,
697        name: *const c_char,
698    ) -> *mut c_void;
699/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_top_k_tensor`.
700    pub fn mpsgraph_graph_top_k_tensor(
701        graph_handle: *mut c_void,
702        source_handle: *mut c_void,
703        k_tensor_handle: *mut c_void,
704        name: *const c_char,
705    ) -> *mut c_void;
706/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_array_box_new`.
707    pub fn mpsgraph_tensor_array_box_new(handles: *const *mut c_void, count: usize) -> *mut c_void;
708/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_callable`.
709    pub fn mpsgraph_compilation_descriptor_set_callable(
710        handle: *mut c_void,
711        symbol_name: *const c_char,
712        executable_handle: *mut c_void,
713    ) -> bool;
714/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_call_symbol`.
715    pub fn mpsgraph_graph_call_symbol(
716        graph_handle: *mut c_void,
717        symbol_name: *const c_char,
718        input_handles: *const *mut c_void,
719        input_count: usize,
720        output_type_handles: *const *mut c_void,
721        output_type_count: usize,
722        name: *const c_char,
723    ) -> *mut c_void;
724/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather_nd`.
725    pub fn mpsgraph_graph_gather_nd(
726        graph_handle: *mut c_void,
727        updates_tensor_handle: *mut c_void,
728        indices_tensor_handle: *mut c_void,
729        batch_dimensions: usize,
730        name: *const c_char,
731    ) -> *mut c_void;
732/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather`.
733    pub fn mpsgraph_graph_gather(
734        graph_handle: *mut c_void,
735        updates_tensor_handle: *mut c_void,
736        indices_tensor_handle: *mut c_void,
737        axis: usize,
738        batch_dimensions: usize,
739        name: *const c_char,
740    ) -> *mut c_void;
741/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather_along_axis`.
742    pub fn mpsgraph_graph_gather_along_axis(
743        graph_handle: *mut c_void,
744        axis: isize,
745        updates_tensor_handle: *mut c_void,
746        indices_tensor_handle: *mut c_void,
747        name: *const c_char,
748    ) -> *mut c_void;
749/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather_along_axis_tensor`.
750    pub fn mpsgraph_graph_gather_along_axis_tensor(
751        graph_handle: *mut c_void,
752        axis_tensor_handle: *mut c_void,
753        updates_tensor_handle: *mut c_void,
754        indices_tensor_handle: *mut c_void,
755        name: *const c_char,
756    ) -> *mut c_void;
757/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_new`.
758    pub fn mpsgraph_random_op_descriptor_new(distribution: u64, data_type: u32) -> *mut c_void;
759/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_distribution`.
760    pub fn mpsgraph_random_op_descriptor_distribution(handle: *mut c_void) -> u64;
761/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_distribution`.
762    pub fn mpsgraph_random_op_descriptor_set_distribution(
763        handle: *mut c_void,
764        raw_value: u64,
765    ) -> bool;
766/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_data_type`.
767    pub fn mpsgraph_random_op_descriptor_data_type(handle: *mut c_void) -> u32;
768/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_data_type`.
769    pub fn mpsgraph_random_op_descriptor_set_data_type(handle: *mut c_void, raw_value: u32)
770        -> bool;
771/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_min`.
772    pub fn mpsgraph_random_op_descriptor_min(handle: *mut c_void) -> f32;
773/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_min`.
774    pub fn mpsgraph_random_op_descriptor_set_min(handle: *mut c_void, value: f32) -> bool;
775/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_max`.
776    pub fn mpsgraph_random_op_descriptor_max(handle: *mut c_void) -> f32;
777/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_max`.
778    pub fn mpsgraph_random_op_descriptor_set_max(handle: *mut c_void, value: f32) -> bool;
779/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_min_integer`.
780    pub fn mpsgraph_random_op_descriptor_min_integer(handle: *mut c_void) -> isize;
781/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_min_integer`.
782    pub fn mpsgraph_random_op_descriptor_set_min_integer(handle: *mut c_void, value: isize)
783        -> bool;
784/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_max_integer`.
785    pub fn mpsgraph_random_op_descriptor_max_integer(handle: *mut c_void) -> isize;
786/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_max_integer`.
787    pub fn mpsgraph_random_op_descriptor_set_max_integer(handle: *mut c_void, value: isize)
788        -> bool;
789/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_mean`.
790    pub fn mpsgraph_random_op_descriptor_mean(handle: *mut c_void) -> f32;
791/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_mean`.
792    pub fn mpsgraph_random_op_descriptor_set_mean(handle: *mut c_void, value: f32) -> bool;
793/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_standard_deviation`.
794    pub fn mpsgraph_random_op_descriptor_standard_deviation(handle: *mut c_void) -> f32;
795/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_standard_deviation`.
796    pub fn mpsgraph_random_op_descriptor_set_standard_deviation(
797        handle: *mut c_void,
798        value: f32,
799    ) -> bool;
800/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_sampling_method`.
801    pub fn mpsgraph_random_op_descriptor_sampling_method(handle: *mut c_void) -> u64;
802/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_sampling_method`.
803    pub fn mpsgraph_random_op_descriptor_set_sampling_method(
804        handle: *mut c_void,
805        raw_value: u64,
806    ) -> bool;
807/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_philox_state_seed`.
808    pub fn mpsgraph_graph_random_philox_state_seed(
809        graph_handle: *mut c_void,
810        seed: usize,
811        name: *const c_char,
812    ) -> *mut c_void;
813/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_philox_state_counter`.
814    pub fn mpsgraph_graph_random_philox_state_counter(
815        graph_handle: *mut c_void,
816        counter_low: usize,
817        counter_high: usize,
818        key: usize,
819        name: *const c_char,
820    ) -> *mut c_void;
821/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor`.
822    pub fn mpsgraph_graph_random_tensor(
823        graph_handle: *mut c_void,
824        shape: *const usize,
825        shape_len: usize,
826        descriptor_handle: *mut c_void,
827        name: *const c_char,
828    ) -> *mut c_void;
829/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_shape_tensor`.
830    pub fn mpsgraph_graph_random_tensor_shape_tensor(
831        graph_handle: *mut c_void,
832        shape_tensor_handle: *mut c_void,
833        descriptor_handle: *mut c_void,
834        name: *const c_char,
835    ) -> *mut c_void;
836/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_seed`.
837    pub fn mpsgraph_graph_random_tensor_seed(
838        graph_handle: *mut c_void,
839        shape: *const usize,
840        shape_len: usize,
841        descriptor_handle: *mut c_void,
842        seed: usize,
843        name: *const c_char,
844    ) -> *mut c_void;
845/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_shape_tensor_seed`.
846    pub fn mpsgraph_graph_random_tensor_shape_tensor_seed(
847        graph_handle: *mut c_void,
848        shape_tensor_handle: *mut c_void,
849        descriptor_handle: *mut c_void,
850        seed: usize,
851        name: *const c_char,
852    ) -> *mut c_void;
853/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_state`.
854    pub fn mpsgraph_graph_random_tensor_state(
855        graph_handle: *mut c_void,
856        shape: *const usize,
857        shape_len: usize,
858        descriptor_handle: *mut c_void,
859        state_handle: *mut c_void,
860        name: *const c_char,
861    ) -> *mut c_void;
862/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_shape_tensor_state`.
863    pub fn mpsgraph_graph_random_tensor_shape_tensor_state(
864        graph_handle: *mut c_void,
865        shape_tensor_handle: *mut c_void,
866        descriptor_handle: *mut c_void,
867        state_handle: *mut c_void,
868        name: *const c_char,
869    ) -> *mut c_void;
870/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_dropout`.
871    pub fn mpsgraph_graph_dropout(
872        graph_handle: *mut c_void,
873        tensor_handle: *mut c_void,
874        rate: f64,
875        name: *const c_char,
876    ) -> *mut c_void;
877/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_dropout_tensor`.
878    pub fn mpsgraph_graph_dropout_tensor(
879        graph_handle: *mut c_void,
880        tensor_handle: *mut c_void,
881        rate_tensor_handle: *mut c_void,
882        name: *const c_char,
883    ) -> *mut c_void;
884/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_new`.
885    pub fn mpsgraph_single_gate_rnn_descriptor_new() -> *mut c_void;
886/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_reverse`.
887    pub fn mpsgraph_single_gate_rnn_descriptor_reverse(handle: *mut c_void) -> bool;
888/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_reverse`.
889    pub fn mpsgraph_single_gate_rnn_descriptor_set_reverse(
890        handle: *mut c_void,
891        value: bool,
892    ) -> bool;
893/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_bidirectional`.
894    pub fn mpsgraph_single_gate_rnn_descriptor_bidirectional(handle: *mut c_void) -> bool;
895/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_bidirectional`.
896    pub fn mpsgraph_single_gate_rnn_descriptor_set_bidirectional(
897        handle: *mut c_void,
898        value: bool,
899    ) -> bool;
900/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_training`.
901    pub fn mpsgraph_single_gate_rnn_descriptor_training(handle: *mut c_void) -> bool;
902/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_training`.
903    pub fn mpsgraph_single_gate_rnn_descriptor_set_training(
904        handle: *mut c_void,
905        value: bool,
906    ) -> bool;
907/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_activation`.
908    pub fn mpsgraph_single_gate_rnn_descriptor_activation(handle: *mut c_void) -> usize;
909/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_activation`.
910    pub fn mpsgraph_single_gate_rnn_descriptor_set_activation(
911        handle: *mut c_void,
912        value: usize,
913    ) -> bool;
914/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_new`.
915    pub fn mpsgraph_lstm_descriptor_new() -> *mut c_void;
916/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_reverse`.
917    pub fn mpsgraph_lstm_descriptor_reverse(handle: *mut c_void) -> bool;
918/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_reverse`.
919    pub fn mpsgraph_lstm_descriptor_set_reverse(handle: *mut c_void, value: bool) -> bool;
920/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_bidirectional`.
921    pub fn mpsgraph_lstm_descriptor_bidirectional(handle: *mut c_void) -> bool;
922/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_bidirectional`.
923    pub fn mpsgraph_lstm_descriptor_set_bidirectional(handle: *mut c_void, value: bool) -> bool;
924/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_produce_cell`.
925    pub fn mpsgraph_lstm_descriptor_produce_cell(handle: *mut c_void) -> bool;
926/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_produce_cell`.
927    pub fn mpsgraph_lstm_descriptor_set_produce_cell(handle: *mut c_void, value: bool) -> bool;
928/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_training`.
929    pub fn mpsgraph_lstm_descriptor_training(handle: *mut c_void) -> bool;
930/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_training`.
931    pub fn mpsgraph_lstm_descriptor_set_training(handle: *mut c_void, value: bool) -> bool;
932/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_forget_gate_last`.
933    pub fn mpsgraph_lstm_descriptor_forget_gate_last(handle: *mut c_void) -> bool;
934/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_forget_gate_last`.
935    pub fn mpsgraph_lstm_descriptor_set_forget_gate_last(handle: *mut c_void, value: bool) -> bool;
936/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_input_gate_activation`.
937    pub fn mpsgraph_lstm_descriptor_input_gate_activation(handle: *mut c_void) -> usize;
938/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_input_gate_activation`.
939    pub fn mpsgraph_lstm_descriptor_set_input_gate_activation(
940        handle: *mut c_void,
941        value: usize,
942    ) -> bool;
943/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_forget_gate_activation`.
944    pub fn mpsgraph_lstm_descriptor_forget_gate_activation(handle: *mut c_void) -> usize;
945/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_forget_gate_activation`.
946    pub fn mpsgraph_lstm_descriptor_set_forget_gate_activation(
947        handle: *mut c_void,
948        value: usize,
949    ) -> bool;
950/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_cell_gate_activation`.
951    pub fn mpsgraph_lstm_descriptor_cell_gate_activation(handle: *mut c_void) -> usize;
952/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_cell_gate_activation`.
953    pub fn mpsgraph_lstm_descriptor_set_cell_gate_activation(
954        handle: *mut c_void,
955        value: usize,
956    ) -> bool;
957/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_output_gate_activation`.
958    pub fn mpsgraph_lstm_descriptor_output_gate_activation(handle: *mut c_void) -> usize;
959/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_output_gate_activation`.
960    pub fn mpsgraph_lstm_descriptor_set_output_gate_activation(
961        handle: *mut c_void,
962        value: usize,
963    ) -> bool;
964/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_activation`.
965    pub fn mpsgraph_lstm_descriptor_activation(handle: *mut c_void) -> usize;
966/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_activation`.
967    pub fn mpsgraph_lstm_descriptor_set_activation(handle: *mut c_void, value: usize) -> bool;
968/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_new`.
969    pub fn mpsgraph_gru_descriptor_new() -> *mut c_void;
970/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reverse`.
971    pub fn mpsgraph_gru_descriptor_reverse(handle: *mut c_void) -> bool;
972/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reverse`.
973    pub fn mpsgraph_gru_descriptor_set_reverse(handle: *mut c_void, value: bool) -> bool;
974/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_bidirectional`.
975    pub fn mpsgraph_gru_descriptor_bidirectional(handle: *mut c_void) -> bool;
976/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_bidirectional`.
977    pub fn mpsgraph_gru_descriptor_set_bidirectional(handle: *mut c_void, value: bool) -> bool;
978/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_training`.
979    pub fn mpsgraph_gru_descriptor_training(handle: *mut c_void) -> bool;
980/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_training`.
981    pub fn mpsgraph_gru_descriptor_set_training(handle: *mut c_void, value: bool) -> bool;
982/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reset_gate_first`.
983    pub fn mpsgraph_gru_descriptor_reset_gate_first(handle: *mut c_void) -> bool;
984/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reset_gate_first`.
985    pub fn mpsgraph_gru_descriptor_set_reset_gate_first(handle: *mut c_void, value: bool) -> bool;
986/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reset_after`.
987    pub fn mpsgraph_gru_descriptor_reset_after(handle: *mut c_void) -> bool;
988/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reset_after`.
989    pub fn mpsgraph_gru_descriptor_set_reset_after(handle: *mut c_void, value: bool) -> bool;
990/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_flip_z`.
991    pub fn mpsgraph_gru_descriptor_flip_z(handle: *mut c_void) -> bool;
992/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_flip_z`.
993    pub fn mpsgraph_gru_descriptor_set_flip_z(handle: *mut c_void, value: bool) -> bool;
994/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_update_gate_activation`.
995    pub fn mpsgraph_gru_descriptor_update_gate_activation(handle: *mut c_void) -> usize;
996/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_update_gate_activation`.
997    pub fn mpsgraph_gru_descriptor_set_update_gate_activation(
998        handle: *mut c_void,
999        value: usize,
1000    ) -> bool;
1001/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reset_gate_activation`.
1002    pub fn mpsgraph_gru_descriptor_reset_gate_activation(handle: *mut c_void) -> usize;
1003/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reset_gate_activation`.
1004    pub fn mpsgraph_gru_descriptor_set_reset_gate_activation(
1005        handle: *mut c_void,
1006        value: usize,
1007    ) -> bool;
1008/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_output_gate_activation`.
1009    pub fn mpsgraph_gru_descriptor_output_gate_activation(handle: *mut c_void) -> usize;
1010/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_output_gate_activation`.
1011    pub fn mpsgraph_gru_descriptor_set_output_gate_activation(
1012        handle: *mut c_void,
1013        value: usize,
1014    ) -> bool;
1015/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_single_gate_rnn`.
1016    pub fn mpsgraph_graph_single_gate_rnn(
1017        graph_handle: *mut c_void,
1018        source_handle: *mut c_void,
1019        recurrent_weight_handle: *mut c_void,
1020        input_weight_handle: *mut c_void,
1021        bias_handle: *mut c_void,
1022        init_state_handle: *mut c_void,
1023        mask_handle: *mut c_void,
1024        descriptor_handle: *mut c_void,
1025        name: *const c_char,
1026    ) -> *mut c_void;
1027/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_lstm`.
1028    pub fn mpsgraph_graph_lstm(
1029        graph_handle: *mut c_void,
1030        source_handle: *mut c_void,
1031        recurrent_weight_handle: *mut c_void,
1032        input_weight_handle: *mut c_void,
1033        bias_handle: *mut c_void,
1034        init_state_handle: *mut c_void,
1035        init_cell_handle: *mut c_void,
1036        mask_handle: *mut c_void,
1037        peephole_handle: *mut c_void,
1038        descriptor_handle: *mut c_void,
1039        name: *const c_char,
1040    ) -> *mut c_void;
1041/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gru`.
1042    pub fn mpsgraph_graph_gru(
1043        graph_handle: *mut c_void,
1044        source_handle: *mut c_void,
1045        recurrent_weight_handle: *mut c_void,
1046        input_weight_handle: *mut c_void,
1047        bias_handle: *mut c_void,
1048        init_state_handle: *mut c_void,
1049        mask_handle: *mut c_void,
1050        secondary_bias_handle: *mut c_void,
1051        descriptor_handle: *mut c_void,
1052        name: *const c_char,
1053    ) -> *mut c_void;
1054/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_control_dependency`.
1055    pub fn mpsgraph_graph_control_dependency(
1056        graph_handle: *mut c_void,
1057        operation_handles: *const *mut c_void,
1058        operation_count: usize,
1059        dependent_callback: Option<TensorArrayCallback>,
1060        dependent_context: *mut c_void,
1061        name: *const c_char,
1062    ) -> *mut c_void;
1063/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_if_then_else`.
1064    pub fn mpsgraph_graph_if_then_else(
1065        graph_handle: *mut c_void,
1066        predicate_handle: *mut c_void,
1067        then_callback: Option<TensorArrayCallback>,
1068        then_context: *mut c_void,
1069        else_callback: Option<TensorArrayCallback>,
1070        else_context: *mut c_void,
1071        name: *const c_char,
1072    ) -> *mut c_void;
1073/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_while_loop`.
1074    pub fn mpsgraph_graph_while_loop(
1075        graph_handle: *mut c_void,
1076        input_handles: *const *mut c_void,
1077        input_count: usize,
1078        before_callback: Option<WhileBeforeCallback>,
1079        before_context: *mut c_void,
1080        after_callback: Option<TensorArrayInputCallback>,
1081        after_context: *mut c_void,
1082        name: *const c_char,
1083    ) -> *mut c_void;
1084/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_for_loop`.
1085    pub fn mpsgraph_graph_for_loop(
1086        graph_handle: *mut c_void,
1087        lower_bound_handle: *mut c_void,
1088        upper_bound_handle: *mut c_void,
1089        step_handle: *mut c_void,
1090        argument_handles: *const *mut c_void,
1091        argument_count: usize,
1092        body_callback: Option<ForBodyCallback>,
1093        body_context: *mut c_void,
1094        name: *const c_char,
1095    ) -> *mut c_void;
1096/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_for_loop_iterations`.
1097    pub fn mpsgraph_graph_for_loop_iterations(
1098        graph_handle: *mut c_void,
1099        number_of_iterations_handle: *mut c_void,
1100        argument_handles: *const *mut c_void,
1101        argument_count: usize,
1102        body_callback: Option<ForBodyCallback>,
1103        body_context: *mut c_void,
1104        name: *const c_char,
1105    ) -> *mut c_void;
1106}