1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

/* automatically generated by rust-bindgen */

pub const menoh_dtype_float: menoh_dtype_constant = 0;
pub type menoh_dtype_constant = u32;
pub type menoh_dtype = i32;
pub const menoh_error_code_success: menoh_error_code_constant = 0;
pub const menoh_error_code_std_error: menoh_error_code_constant = 1;
pub const menoh_error_code_unknown_error: menoh_error_code_constant = 2;
pub const menoh_error_code_invalid_filename: menoh_error_code_constant = 3;
pub const menoh_error_code_unsupported_onnx_opset_version: menoh_error_code_constant = 4;
pub const menoh_error_code_onnx_parse_error: menoh_error_code_constant = 5;
pub const menoh_error_code_invalid_dtype: menoh_error_code_constant = 6;
pub const menoh_error_code_invalid_attribute_type: menoh_error_code_constant = 7;
pub const menoh_error_code_unsupported_operator_attribute: menoh_error_code_constant = 8;
pub const menoh_error_code_dimension_mismatch: menoh_error_code_constant = 9;
pub const menoh_error_code_variable_not_found: menoh_error_code_constant = 10;
pub const menoh_error_code_index_out_of_range: menoh_error_code_constant = 11;
pub const menoh_error_code_json_parse_error: menoh_error_code_constant = 12;
pub const menoh_error_code_invalid_backend_name: menoh_error_code_constant = 13;
pub const menoh_error_code_unsupported_operator: menoh_error_code_constant = 14;
pub const menoh_error_code_failed_to_configure_operator: menoh_error_code_constant = 15;
pub const menoh_error_code_backend_error: menoh_error_code_constant = 16;
pub const menoh_error_code_same_named_variable_already_exist: menoh_error_code_constant = 17;
pub type menoh_error_code_constant = u32;
pub type menoh_error_code = i32;
extern "C" {
    pub fn menoh_get_last_error_message() -> *const ::std::os::raw::c_char;
}
# [ repr ( C ) ]
pub struct menoh_model_data {
    _unused: [u8; 0],
}
pub type menoh_model_data_handle = *mut menoh_model_data;
extern "C" {
    pub fn menoh_make_model_data_from_onnx(onnx_filename: *const ::std::os::raw::c_char, dst_handle: *mut menoh_model_data_handle) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_delete_model_data(model_data: menoh_model_data_handle);
}
# [ repr ( C ) ]
pub struct menoh_variable_profile_table_builder {
    _unused: [u8; 0],
}
pub type menoh_variable_profile_table_builder_handle = *mut menoh_variable_profile_table_builder;
extern "C" {
    pub fn menoh_make_variable_profile_table_builder(dst_handle: *mut menoh_variable_profile_table_builder_handle) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_delete_variable_profile_table_builder(builder: menoh_variable_profile_table_builder_handle);
}
extern "C" {
    pub fn menoh_variable_profile_table_builder_add_input_profile_dims_2(builder: menoh_variable_profile_table_builder_handle, name: *const ::std::os::raw::c_char, dtype: menoh_dtype, num: i32, size: i32) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_variable_profile_table_builder_add_input_profile_dims_4(builder: menoh_variable_profile_table_builder_handle, name: *const ::std::os::raw::c_char, dtype: menoh_dtype, num: i32, channel: i32, height: i32, width: i32) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_variable_profile_table_builder_add_output_profile(builder: menoh_variable_profile_table_builder_handle, name: *const ::std::os::raw::c_char, dtype: menoh_dtype) -> menoh_error_code;
}
# [ repr ( C ) ]
pub struct menoh_variable_profile_table {
    _unused: [u8; 0],
}
pub type menoh_variable_profile_table_handle = *mut menoh_variable_profile_table;
extern "C" {
    pub fn menoh_build_variable_profile_table(builder: menoh_variable_profile_table_builder_handle, model_data: menoh_model_data_handle, dst_handle: *mut menoh_variable_profile_table_handle) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_delete_variable_profile_table(variable_profile_table: menoh_variable_profile_table_handle);
}
extern "C" {
    pub fn menoh_variable_profile_table_get_dtype(variable_profile_table: menoh_variable_profile_table_handle, variable_name: *const ::std::os::raw::c_char, dst_dtype: *mut menoh_dtype) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_variable_profile_table_get_dims_size(variable_profile_table: menoh_variable_profile_table_handle, variable_name: *const ::std::os::raw::c_char, dst_size: *mut i32) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_variable_profile_table_get_dims_at(variable_profile_table: menoh_variable_profile_table_handle, variable_name: *const ::std::os::raw::c_char, index: i32, dst_size: *mut i32) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_model_data_optimize(model_data: menoh_model_data_handle, variable_profile_table: menoh_variable_profile_table_handle) -> menoh_error_code;
}
# [ repr ( C ) ]
pub struct menoh_model_builder {
    _unused: [u8; 0],
}
pub type menoh_model_builder_handle = *mut menoh_model_builder;
extern "C" {
    pub fn menoh_make_model_builder(variable_profile_table: menoh_variable_profile_table_handle, dst_handle: *mut menoh_model_builder_handle) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_delete_model_builder(model_builder: menoh_model_builder_handle);
}
extern "C" {
    pub fn menoh_model_builder_attach_external_buffer(builder: menoh_model_builder_handle, variable_name: *const ::std::os::raw::c_char, buffer_handle: *mut ::std::os::raw::c_void) -> menoh_error_code;
}
# [ repr ( C ) ]
pub struct menoh_model {
    _unused: [u8; 0],
}
pub type menoh_model_handle = *mut menoh_model;
extern "C" {
    pub fn menoh_build_model(builder: menoh_model_builder_handle, model_data: menoh_model_data_handle, backend_name: *const ::std::os::raw::c_char, backend_config: *const ::std::os::raw::c_char, dst_model_handle: *mut menoh_model_handle) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_delete_model(model: menoh_model_handle);
}
extern "C" {
    pub fn menoh_model_get_variable_buffer_handle(model: menoh_model_handle, variable_name: *const ::std::os::raw::c_char, dst_data: *mut *mut ::std::os::raw::c_void) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_model_get_variable_dtype(model: menoh_model_handle, variable_name: *const ::std::os::raw::c_char, dst_dtype: *mut menoh_dtype) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_model_get_variable_dims_size(model: menoh_model_handle, variable_name: *const ::std::os::raw::c_char, dst_size: *mut i32) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_model_get_variable_dims_at(model: menoh_model_handle, variable_name: *const ::std::os::raw::c_char, index: i32, dst_size: *mut i32) -> menoh_error_code;
}
extern "C" {
    pub fn menoh_model_run(model: menoh_model_handle) -> menoh_error_code;
}