1use core::ffi::c_void;
2
3extern "C" {
4 pub fn mps_ndarray_descriptor_new_with_dimension_sizes(
5 data_type: u32,
6 number_of_dimensions: usize,
7 dimension_sizes: *const usize,
8 ) -> *mut c_void;
9 pub fn mps_ndarray_descriptor_data_type(handle: *mut c_void) -> u32;
10 pub fn mps_ndarray_descriptor_set_data_type(handle: *mut c_void, data_type: u32);
11 pub fn mps_ndarray_descriptor_number_of_dimensions(handle: *mut c_void) -> usize;
12 pub fn mps_ndarray_descriptor_set_number_of_dimensions(
13 handle: *mut c_void,
14 number_of_dimensions: usize,
15 );
16 pub fn mps_ndarray_descriptor_length_of_dimension(
17 handle: *mut c_void,
18 dimension_index: usize,
19 ) -> usize;
20 pub fn mps_ndarray_descriptor_reshape_with_dimension_sizes(
21 handle: *mut c_void,
22 number_of_dimensions: usize,
23 dimension_sizes: *const usize,
24 );
25 pub fn mps_ndarray_descriptor_transpose_dimension(
26 handle: *mut c_void,
27 dimension_index: usize,
28 other_dimension_index: usize,
29 );
30
31 pub fn mps_ndarray_new_with_descriptor(
32 device_handle: *mut c_void,
33 descriptor_handle: *mut c_void,
34 ) -> *mut c_void;
35 pub fn mps_ndarray_new_scalar(device_handle: *mut c_void, value: f64) -> *mut c_void;
36 pub fn mps_ndarray_new_with_buffer(
37 buffer_handle: *mut c_void,
38 offset: usize,
39 descriptor_handle: *mut c_void,
40 ) -> *mut c_void;
41 pub fn mps_ndarray_data_type(handle: *mut c_void) -> u32;
42 pub fn mps_ndarray_number_of_dimensions(handle: *mut c_void) -> usize;
43 pub fn mps_ndarray_length_of_dimension(handle: *mut c_void, dimension_index: usize) -> usize;
44 pub fn mps_ndarray_descriptor(handle: *mut c_void) -> *mut c_void;
45 pub fn mps_ndarray_resource_size(handle: *mut c_void) -> usize;
46
47 pub fn mps_ndarray_identity_new(device_handle: *mut c_void) -> *mut c_void;
48 pub fn mps_ndarray_identity_reshape(
49 handle: *mut c_void,
50 command_buffer_handle: *mut c_void,
51 source_array_handle: *mut c_void,
52 number_of_dimensions: usize,
53 dimension_sizes: *const usize,
54 destination_array_handle: *mut c_void,
55 ) -> *mut c_void;
56}