1010/**
1111 * @file Common example runner functions
1212 *
13- * @brief Set of functions(runners) to organize MLI Library examples in a common way
13+ * @brief Set of functions(runners) to organize MLI Library examples in a common
14+ * way
1415 */
1516
16- #include <stdint.h>
17-
1817#include "mli_api.h"
19- #include "tests_aux.h"
2018#include "mli_config.h"
19+ #include "tests_aux.h"
20+
21+ #include <stdint.h>
2122
2223#ifdef __cplusplus
2324extern "C" {
@@ -42,39 +43,48 @@ typedef void (*model_inference_t)(const char *);
4243 * @detail Function calls sequentially *preprocess* function for
4344 * input data and *inference* function passing
4445 * *inf_param* to it.
45- * After inference it calls measure_ref_to_pred function for ref_out and model_output.
46+ * After inference it calls measure_ref_to_pred function for ref_out and
47+ * model_output.
4648 *
47- * @param[in] data_in - Array with input data. Must be applicable for *preprocess* function
48- * @param[in] ref_out - Array with model reference output for provided input (data_in).
49- * Against this data error measurements will be calculated
50- * @param[in/out] model_input - Pointer to MLI tensor structure for *inference* input.
51- * Must be applicable for *preprocess* function and used by *inference* function
52- * @param[in/out] model_output - Pointer to MLI tensor structure for *inference* output.
53- * Must be used by *inference* function
54- * @param[in] preprocess - data preprocessor function. will be called before inference function
49+ * @param[in] data_in - Array with input data. Must be applicable for
50+ * *preprocess* function
51+ * @param[in] ref_out - Array with model reference output for provided input
52+ * (data_in). Against this data error measurements will be calculated
53+ * @param[in/out] model_input - Pointer to MLI tensor structure for *inference*
54+ * input. Must be applicable for *preprocess* function and used by *inference*
55+ * function
56+ * @param[in/out] model_output - Pointer to MLI tensor structure for *inference*
57+ * output. Must be used by *inference* function
58+ * @param[in] preprocess - data preprocessor function. will be called before
59+ * inference function
5560 * @param[in] inference - model inference function. Will be called once
5661 * @param[in] inf_param - Parameter for passing to the inference function
5762 *
5863 * @return Operation status code (tests_aux.h)
5964 */
6065enum test_status model_run_single_in (const void * data_in , const float * ref_out ,
61- mli_tensor * model_input ,
62- mli_tensor * model_output , preproc_func_t preprocess ,
63- model_inference_t inference , const char * inf_param );
66+ mli_tensor * model_input ,
67+ mli_tensor * model_output ,
68+ preproc_func_t preprocess ,
69+ model_inference_t inference ,
70+ const char * inf_param );
6471
6572/** @brief Run preprocessor and inference function in cycle
6673 * for all input dataset with accuracy calculation
6774 *
68- * @detail Function opens input_idx_path dataset and for each entiti calls sequentially *preprocess*
69- * and *inference* function passing *inf_param* to it. It also calculates accuracy according
70- * to labels_idx_path file and print intermediate result after passing each 10% of all data
75+ * @detail Function opens input_idx_path dataset and for each entiti calls
76+ * sequentially *preprocess* and *inference* function passing *inf_param* to it.
77+ * It also calculates accuracy according to labels_idx_path file and print
78+ * intermediate result after passing each 10% of all data
7179 *
7280 * @param[in] input_idx_path - path to IDX dataset file for the model
73- * @param[in] labels_idx_path - path to IDX reference labels of *input_idx_path* dataset
74- * @param[in/out] model_input - Pointer to MLI tensor structure for *inference* input.
75- * Must be applicable for *preprocess* function and used by *inference* function
76- * @param[in/out] model_output - Pointer to MLI tensor structure for *inference* output.
77- * Must be used by *inference* function
81+ * @param[in] labels_idx_path - path to IDX reference labels of *input_idx_path*
82+ * dataset
83+ * @param[in/out] model_input - Pointer to MLI tensor structure for *inference*
84+ * input. Must be applicable for *preprocess* function and used by *inference*
85+ * function
86+ * @param[in/out] model_output - Pointer to MLI tensor structure for *inference*
87+ * output. Must be used by *inference* function
7888 * @param[in] preprocess - data preprocessor function.
7989 * will be called in cycle for each input from dataset.
8090 * @param[in] inference - model inference function.
@@ -83,25 +93,27 @@ enum test_status model_run_single_in(const void *data_in, const float *ref_out,
8393 *
8494 * @return Operation status code (tests_aux.h)
8595 */
86- enum test_status model_run_acc_on_idx_base (const char * input_idx_path , const char * labels_idx_path ,
87- mli_tensor * model_input , mli_tensor * model_output ,
88- preproc_func_t preprocess , model_inference_t inference ,
89- const char * inf_param );
96+ enum test_status
97+ model_run_acc_on_idx_base (const char * input_idx_path ,
98+ const char * labels_idx_path , mli_tensor * model_input ,
99+ mli_tensor * model_output , preproc_func_t preprocess ,
100+ model_inference_t inference , const char * inf_param );
90101
91- /** @brief Run preprocessor and inference function in cycle for all input dataset.
92- * Outputs result to the IDX file
102+ /** @brief Run preprocessor and inference function in cycle for all input
103+ * dataset. Outputs result to the IDX file
93104 *
94- * @detail Function opens input_idx_path dataset and calls sequentially *preprocess*
95- * and *inference* function for each entiti passing *inf_param* to it.
96- * It fills output_idx_path by model_output values of each inference.
105+ * @detail Function opens input_idx_path dataset and calls sequentially
106+ * *preprocess* and *inference* function for each entiti passing *inf_param* to
107+ * it. It fills output_idx_path by model_output values of each inference.
97108 *
98109 * @param[in] input_idx_path - path to IDX dataset file for the model
99- * @param[in] output_idx_path - path to output IDX file for storing results of each inference
100- * @param[in/out] model_input - Pointer to MLI tensor structure for *inference* input.
101- * Must be applicable for *preprocess* function
102- * and used by *inference* function
103- * @param[in/out] model_output - Pointer to MLI tensor structure for *inference* output.
104- * Must be used by *inference* function
110+ * @param[in] output_idx_path - path to output IDX file for storing results of
111+ * each inference
112+ * @param[in/out] model_input - Pointer to MLI tensor structure for *inference*
113+ * input. Must be applicable for *preprocess* function and used by *inference*
114+ * function
115+ * @param[in/out] model_output - Pointer to MLI tensor structure for *inference*
116+ * output. Must be used by *inference* function
105117 * @param[in] preprocess - data preprocessor function.
106118 * will be called in cycle for each input from dataset.
107119 * @param[in] inference - model inference function.
@@ -111,10 +123,12 @@ enum test_status model_run_acc_on_idx_base(const char *input_idx_path, const cha
111123 * @return Operation status code (tests_aux.h)
112124 */
113125enum test_status model_run_idx_base_to_idx_out (const char * input_idx_path ,
114- const char * output_idx_path ,
115- mli_tensor * model_input , mli_tensor * model_output ,
116- preproc_func_t preprocess , model_inference_t inference ,
117- const char * inf_param );
126+ const char * output_idx_path ,
127+ mli_tensor * model_input ,
128+ mli_tensor * model_output ,
129+ preproc_func_t preprocess ,
130+ model_inference_t inference ,
131+ const char * inf_param );
118132
119133#if (PLATFORM == V2DSP_XY )
120134#define FAST_TYPE (t ) __xy t
0 commit comments