Menoh
Macros | Typedefs | Enumerations | Functions
menoh.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define MENOH_API
 
#define MENOH_SUPPORTED_ONNX_OPSET_VERSION   8
 
#define MENOH_ERROR_MESSAGE_MAX_LENGTH   1024
 
#define MENOH_DEPRECATED_ATTRIBUTE(message)
 

Typedefs

typedef int32_t menoh_dtype
 
typedef int32_t menoh_error_code
 
typedef struct menoh_model_datamenoh_model_data_handle
 
typedef struct menoh_variable_profile_table_buildermenoh_variable_profile_table_builder_handle
 
typedef struct menoh_variable_profile_tablemenoh_variable_profile_table_handle
 
typedef struct menoh_model_buildermenoh_model_builder_handle
 
typedef struct menoh_modelmenoh_model_handle
 

Enumerations

enum  menoh_dtype_constant { menoh_dtype_float }
 
enum  menoh_error_code_constant {
  menoh_error_code_success, menoh_error_code_std_error, menoh_error_code_unknown_error, menoh_error_code_invalid_filename,
  menoh_error_code_unsupported_onnx_opset_version, menoh_error_code_onnx_parse_error, menoh_error_code_invalid_dtype, menoh_error_code_invalid_attribute_type,
  menoh_error_code_unsupported_operator_attribute, menoh_error_code_dimension_mismatch, menoh_error_code_variable_not_found, menoh_error_code_index_out_of_range,
  menoh_error_code_json_parse_error, menoh_error_code_invalid_backend_name, menoh_error_code_unsupported_operator, menoh_error_code_failed_to_configure_operator,
  menoh_error_code_backend_error, menoh_error_code_same_named_variable_already_exist, menoh_error_code_unsupported_input_dims, menoh_error_code_same_named_parameter_already_exist,
  menoh_error_code_same_named_attribute_already_exist, menoh_error_code_invalid_backend_config_error
}
 

Functions

MENOH_API const char * menoh_get_last_error_message ()
 Users can get detailed message about last error. More...
 
void MENOH_API menoh_delete_model_data (menoh_model_data_handle model_data)
 Model_data delete function. More...
 
menoh_error_code MENOH_API menoh_make_model_data_from_onnx (const char *onnx_filename, menoh_model_data_handle *dst_handle)
 Load onnx file and make model_data. More...
 
menoh_error_code MENOH_API menoh_make_model_data_from_onnx_data_on_memory (const uint8_t *onnx_data, int32_t size, menoh_model_data_handle *dst_handle)
 make model_data from onnx binary data on memory More...
 
menoh_error_code MENOH_API menoh_make_model_data (menoh_model_data_handle *dst_handle)
 Make empty model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_parameter (menoh_model_data_handle model_data, const char *parameter_name, menoh_dtype dtype, int32_t dims_size, const int32_t *dims, void *buffer_handle)
 Add a new parameter in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_new_node (menoh_model_data_handle model_data, const char *op_type)
 Add a new node to model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_input_name_to_current_node (menoh_model_data_handle model_data, const char *input_name)
 Add a new input name to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_output_name_to_current_node (menoh_model_data_handle model_data, const char *output_name)
 Add a new output name to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_int_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, int32_t value)
 Add a new int attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_float_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, float value)
 Add a new float attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_ints_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, int32_t size, const int32_t *value)
 Add a new int array attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_floats_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, int32_t size, const float *value)
 Add a new float array attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_make_variable_profile_table_builder (menoh_variable_profile_table_builder_handle *dst_handle)
 Factory function for variable_profile_table_builder. More...
 
void MENOH_API menoh_delete_variable_profile_table_builder (menoh_variable_profile_table_builder_handle builder)
 Delete function for variable_profile_table_builder. More...
 
menoh_error_code MENOH_API menoh_variable_profile_table_builder_add_input_profile (menoh_variable_profile_table_builder_handle builder, const char *name, menoh_dtype dtype, int32_t dims_size, const int32_t *dims)
 Add input profile. More...
 
deprecated menoh_error_code MENOH_API menoh_variable_profile_table_builder_add_input_profile_dims_2 (menoh_variable_profile_table_builder_handle builder, const char *name, menoh_dtype dtype, int32_t num, int32_t size)
 Add 2D input profile. More...
 
deprecated menoh_error_code MENOH_API menoh_variable_profile_table_builder_add_input_profile_dims_4 (menoh_variable_profile_table_builder_handle builder, const char *name, menoh_dtype dtype, int32_t num, int32_t channel, int32_t height, int32_t width)
 Add 4D input profile. More...
 
menoh_error_code MENOH_API menoh_variable_profile_table_builder_add_output_name (menoh_variable_profile_table_builder_handle builder, const char *name)
 Add output name. More...
 
deprecated menoh_error_code MENOH_API menoh_variable_profile_table_builder_add_output_profile (menoh_variable_profile_table_builder_handle builder, const char *name, menoh_dtype dtype)
 Add output profile. More...
 
menoh_error_code MENOH_API menoh_build_variable_profile_table (const menoh_variable_profile_table_builder_handle builder, const menoh_model_data_handle model_data, menoh_variable_profile_table_handle *dst_handle)
 Factory function for variable_profile_table. More...
 
void MENOH_API menoh_delete_variable_profile_table (menoh_variable_profile_table_handle variable_profile_table)
 Delete function for variable_profile_table. More...
 
menoh_error_code MENOH_API menoh_variable_profile_table_get_dtype (const menoh_variable_profile_table_handle variable_profile_table, const char *variable_name, menoh_dtype *dst_dtype)
 Accessor function for variable_profile_table. More...
 
menoh_error_code MENOH_API menoh_variable_profile_table_get_dims_size (const menoh_variable_profile_table_handle variable_profile_table, const char *variable_name, int32_t *dst_size)
 Accessor function for variable_profile_table. More...
 
menoh_error_code MENOH_API menoh_variable_profile_table_get_dims_at (const menoh_variable_profile_table_handle variable_profile_table, const char *variable_name, int32_t index, int32_t *dst_size)
 Accessor function for variable_profile_table. More...
 
menoh_error_code MENOH_API menoh_model_data_optimize (menoh_model_data_handle model_data, const menoh_variable_profile_table_handle variable_profile_table)
 Optimize function for menoh_model_data. More...
 
menoh_error_code MENOH_API menoh_make_model_builder (const menoh_variable_profile_table_handle variable_profile_table, menoh_model_builder_handle *dst_handle)
 Factory function for menoh_model_builder. More...
 
void MENOH_API menoh_delete_model_builder (menoh_model_builder_handle model_builder)
 Delete function for model_builder. More...
 
menoh_error_code MENOH_API menoh_model_builder_attach_external_buffer (menoh_model_builder_handle builder, const char *variable_name, void *buffer_handle)
 Attach a buffer which allocated by users. More...
 
menoh_error_code MENOH_API menoh_build_model (const menoh_model_builder_handle builder, const menoh_model_data_handle model_data, const char *backend_name, const char *backend_config, menoh_model_handle *dst_model_handle)
 Factory function for menoh_model. More...
 
void MENOH_API menoh_delete_model (menoh_model_handle model)
 Delete function for model. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_buffer_handle (const menoh_model_handle model, const char *variable_name, void **dst_data)
 Get a buffer handle attached to target variable. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_dtype (const menoh_model_handle model, const char *variable_name, menoh_dtype *dst_dtype)
 Get dtype of target variable. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_dims_size (const menoh_model_handle model, const char *variable_name, int32_t *dst_size)
 Get size of dims of target variable. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_dims_at (const menoh_model_handle model, const char *variable_name, int32_t index, int32_t *dst_size)
 Get an element of dims of target variable specified by index. More...
 
menoh_error_code MENOH_API menoh_model_run (menoh_model_handle model)
 Run model inference. More...
 

Macro Definition Documentation

◆ MENOH_API

#define MENOH_API

◆ MENOH_DEPRECATED_ATTRIBUTE

#define MENOH_DEPRECATED_ATTRIBUTE (   message)

◆ MENOH_ERROR_MESSAGE_MAX_LENGTH

#define MENOH_ERROR_MESSAGE_MAX_LENGTH   1024

◆ MENOH_SUPPORTED_ONNX_OPSET_VERSION

#define MENOH_SUPPORTED_ONNX_OPSET_VERSION   8