1#![allow(non_camel_case_types)]
2#![allow(non_snake_case)]
3#![allow(non_upper_case_globals)]
4
5pub const menoh_dtype_float: menoh_dtype_constant = 0;
8pub type menoh_dtype_constant = u32;
9pub type menoh_dtype = i32;
10pub const menoh_error_code_success: menoh_error_code_constant = 0;
11pub const menoh_error_code_std_error: menoh_error_code_constant = 1;
12pub const menoh_error_code_unknown_error: menoh_error_code_constant = 2;
13pub const menoh_error_code_invalid_filename: menoh_error_code_constant = 3;
14pub const menoh_error_code_unsupported_onnx_opset_version: menoh_error_code_constant = 4;
15pub const menoh_error_code_onnx_parse_error: menoh_error_code_constant = 5;
16pub const menoh_error_code_invalid_dtype: menoh_error_code_constant = 6;
17pub const menoh_error_code_invalid_attribute_type: menoh_error_code_constant = 7;
18pub const menoh_error_code_unsupported_operator_attribute: menoh_error_code_constant = 8;
19pub const menoh_error_code_dimension_mismatch: menoh_error_code_constant = 9;
20pub const menoh_error_code_variable_not_found: menoh_error_code_constant = 10;
21pub const menoh_error_code_index_out_of_range: menoh_error_code_constant = 11;
22pub const menoh_error_code_json_parse_error: menoh_error_code_constant = 12;
23pub const menoh_error_code_invalid_backend_name: menoh_error_code_constant = 13;
24pub const menoh_error_code_unsupported_operator: menoh_error_code_constant = 14;
25pub const menoh_error_code_failed_to_configure_operator: menoh_error_code_constant = 15;
26pub const menoh_error_code_backend_error: menoh_error_code_constant = 16;
27pub const menoh_error_code_same_named_variable_already_exist: menoh_error_code_constant = 17;
28pub const menoh_error_code_unsupported_input_dims: menoh_error_code_constant = 18;
29pub const menoh_error_code_same_named_parameter_already_exist: menoh_error_code_constant = 19;
30pub const menoh_error_code_same_named_attribute_already_exist: menoh_error_code_constant = 20;
31pub const menoh_error_code_invalid_backend_config_error: menoh_error_code_constant = 21;
32pub const menoh_error_code_input_not_found_error: menoh_error_code_constant = 22;
33pub const menoh_error_code_output_not_found_error: menoh_error_code_constant = 23;
34pub type menoh_error_code_constant = u32;
35pub type menoh_error_code = i32;
36extern "C" {
37 pub fn menoh_get_last_error_message() -> *const ::std::os::raw::c_char;
38}
39#[repr(C)]
40pub struct menoh_model_data {
41 _unused: [u8; 0],
42}
43pub type menoh_model_data_handle = *mut menoh_model_data;
44extern "C" {
45 pub fn menoh_delete_model_data(model_data: menoh_model_data_handle);
46}
47extern "C" {
48 pub fn menoh_make_model_data_from_onnx(
49 onnx_filename: *const ::std::os::raw::c_char,
50 dst_handle: *mut menoh_model_data_handle,
51 ) -> menoh_error_code;
52}
53extern "C" {
54 pub fn menoh_make_model_data_from_onnx_data_on_memory(
55 onnx_data: *const u8,
56 size: i32,
57 dst_handle: *mut menoh_model_data_handle,
58 ) -> menoh_error_code;
59}
60extern "C" {
61 pub fn menoh_make_model_data(dst_handle: *mut menoh_model_data_handle) -> menoh_error_code;
62}
63extern "C" {
64 pub fn menoh_model_data_add_parameter(
65 model_data: menoh_model_data_handle,
66 parameter_name: *const ::std::os::raw::c_char,
67 dtype: menoh_dtype,
68 dims_size: i32,
69 dims: *const i32,
70 buffer_handle: *mut ::std::os::raw::c_void,
71 ) -> menoh_error_code;
72}
73extern "C" {
74 pub fn menoh_model_data_add_new_node(
75 model_data: menoh_model_data_handle,
76 op_type: *const ::std::os::raw::c_char,
77 ) -> menoh_error_code;
78}
79extern "C" {
80 pub fn menoh_model_data_add_input_name_to_current_node(
81 model_data: menoh_model_data_handle,
82 input_name: *const ::std::os::raw::c_char,
83 ) -> menoh_error_code;
84}
85extern "C" {
86 pub fn menoh_model_data_add_output_name_to_current_node(
87 model_data: menoh_model_data_handle,
88 output_name: *const ::std::os::raw::c_char,
89 ) -> menoh_error_code;
90}
91extern "C" {
92 pub fn menoh_model_data_add_attribute_int_to_current_node(
93 model_data: menoh_model_data_handle,
94 attribute_name: *const ::std::os::raw::c_char,
95 value: i32,
96 ) -> menoh_error_code;
97}
98extern "C" {
99 pub fn menoh_model_data_add_attribute_float_to_current_node(
100 model_data: menoh_model_data_handle,
101 attribute_name: *const ::std::os::raw::c_char,
102 value: f32,
103 ) -> menoh_error_code;
104}
105extern "C" {
106 pub fn menoh_model_data_add_attribute_ints_to_current_node(
107 model_data: menoh_model_data_handle,
108 attribute_name: *const ::std::os::raw::c_char,
109 size: i32,
110 value: *const i32,
111 ) -> menoh_error_code;
112}
113extern "C" {
114 pub fn menoh_model_data_add_attribute_floats_to_current_node(
115 model_data: menoh_model_data_handle,
116 attribute_name: *const ::std::os::raw::c_char,
117 size: i32,
118 value: *const f32,
119 ) -> menoh_error_code;
120}
121#[repr(C)]
122pub struct menoh_variable_profile_table_builder {
123 _unused: [u8; 0],
124}
125pub type menoh_variable_profile_table_builder_handle = *mut menoh_variable_profile_table_builder;
126extern "C" {
127 pub fn menoh_make_variable_profile_table_builder(
128 dst_handle: *mut menoh_variable_profile_table_builder_handle,
129 ) -> menoh_error_code;
130}
131extern "C" {
132 pub fn menoh_delete_variable_profile_table_builder(
133 builder: menoh_variable_profile_table_builder_handle,
134 );
135}
136extern "C" {
137 pub fn menoh_variable_profile_table_builder_add_input_profile(
138 builder: menoh_variable_profile_table_builder_handle,
139 name: *const ::std::os::raw::c_char,
140 dtype: menoh_dtype,
141 dims_size: i32,
142 dims: *const i32,
143 ) -> menoh_error_code;
144}
145extern "C" {
146 pub fn menoh_variable_profile_table_builder_add_input_profile_dims_2(
147 builder: menoh_variable_profile_table_builder_handle,
148 name: *const ::std::os::raw::c_char,
149 dtype: menoh_dtype,
150 num: i32,
151 size: i32,
152 ) -> menoh_error_code;
153}
154extern "C" {
155 pub fn menoh_variable_profile_table_builder_add_input_profile_dims_4(
156 builder: menoh_variable_profile_table_builder_handle,
157 name: *const ::std::os::raw::c_char,
158 dtype: menoh_dtype,
159 num: i32,
160 channel: i32,
161 height: i32,
162 width: i32,
163 ) -> menoh_error_code;
164}
165extern "C" {
166 pub fn menoh_variable_profile_table_builder_add_output_name(
167 builder: menoh_variable_profile_table_builder_handle,
168 name: *const ::std::os::raw::c_char,
169 ) -> menoh_error_code;
170}
171extern "C" {
172 pub fn menoh_variable_profile_table_builder_add_output_profile(
173 builder: menoh_variable_profile_table_builder_handle,
174 name: *const ::std::os::raw::c_char,
175 dtype: menoh_dtype,
176 ) -> menoh_error_code;
177}
178#[repr(C)]
179pub struct menoh_variable_profile_table {
180 _unused: [u8; 0],
181}
182pub type menoh_variable_profile_table_handle = *mut menoh_variable_profile_table;
183extern "C" {
184 pub fn menoh_build_variable_profile_table(
185 builder: menoh_variable_profile_table_builder_handle,
186 model_data: menoh_model_data_handle,
187 dst_handle: *mut menoh_variable_profile_table_handle,
188 ) -> menoh_error_code;
189}
190extern "C" {
191 pub fn menoh_delete_variable_profile_table(
192 variable_profile_table: menoh_variable_profile_table_handle,
193 );
194}
195extern "C" {
196 pub fn menoh_variable_profile_table_get_dtype(
197 variable_profile_table: menoh_variable_profile_table_handle,
198 variable_name: *const ::std::os::raw::c_char,
199 dst_dtype: *mut menoh_dtype,
200 ) -> menoh_error_code;
201}
202extern "C" {
203 pub fn menoh_variable_profile_table_get_dims_size(
204 variable_profile_table: menoh_variable_profile_table_handle,
205 variable_name: *const ::std::os::raw::c_char,
206 dst_size: *mut i32,
207 ) -> menoh_error_code;
208}
209extern "C" {
210 pub fn menoh_variable_profile_table_get_dims_at(
211 variable_profile_table: menoh_variable_profile_table_handle,
212 variable_name: *const ::std::os::raw::c_char,
213 index: i32,
214 dst_size: *mut i32,
215 ) -> menoh_error_code;
216}
217extern "C" {
218 pub fn menoh_model_data_optimize(
219 model_data: menoh_model_data_handle,
220 variable_profile_table: menoh_variable_profile_table_handle,
221 ) -> menoh_error_code;
222}
223#[repr(C)]
224pub struct menoh_model_builder {
225 _unused: [u8; 0],
226}
227pub type menoh_model_builder_handle = *mut menoh_model_builder;
228extern "C" {
229 pub fn menoh_make_model_builder(
230 variable_profile_table: menoh_variable_profile_table_handle,
231 dst_handle: *mut menoh_model_builder_handle,
232 ) -> menoh_error_code;
233}
234extern "C" {
235 pub fn menoh_delete_model_builder(model_builder: menoh_model_builder_handle);
236}
237extern "C" {
238 pub fn menoh_model_builder_attach_external_buffer(
239 builder: menoh_model_builder_handle,
240 variable_name: *const ::std::os::raw::c_char,
241 buffer_handle: *mut ::std::os::raw::c_void,
242 ) -> menoh_error_code;
243}
244#[repr(C)]
245pub struct menoh_model {
246 _unused: [u8; 0],
247}
248pub type menoh_model_handle = *mut menoh_model;
249extern "C" {
250 pub fn menoh_build_model(
251 builder: menoh_model_builder_handle,
252 model_data: menoh_model_data_handle,
253 backend_name: *const ::std::os::raw::c_char,
254 backend_config: *const ::std::os::raw::c_char,
255 dst_model_handle: *mut menoh_model_handle,
256 ) -> menoh_error_code;
257}
258extern "C" {
259 pub fn menoh_delete_model(model: menoh_model_handle);
260}
261extern "C" {
262 pub fn menoh_model_get_variable_buffer_handle(
263 model: menoh_model_handle,
264 variable_name: *const ::std::os::raw::c_char,
265 dst_data: *mut *mut ::std::os::raw::c_void,
266 ) -> menoh_error_code;
267}
268extern "C" {
269 pub fn menoh_model_get_variable_dtype(
270 model: menoh_model_handle,
271 variable_name: *const ::std::os::raw::c_char,
272 dst_dtype: *mut menoh_dtype,
273 ) -> menoh_error_code;
274}
275extern "C" {
276 pub fn menoh_model_get_variable_dims_size(
277 model: menoh_model_handle,
278 variable_name: *const ::std::os::raw::c_char,
279 dst_size: *mut i32,
280 ) -> menoh_error_code;
281}
282extern "C" {
283 pub fn menoh_model_get_variable_dims_at(
284 model: menoh_model_handle,
285 variable_name: *const ::std::os::raw::c_char,
286 index: i32,
287 dst_size: *mut i32,
288 ) -> menoh_error_code;
289}
290extern "C" {
291 pub fn menoh_model_run(model: menoh_model_handle) -> menoh_error_code;
292}