23#ifndef NRF_AXON_MODEL_APP_STORAGE
24# define NRF_AXON_MODEL_APP_STORAGE
200 uint16_t input_no,
const int8_t *input_vector)
202 if (input_no < compiled_model->input_cnt) {
269 const int8_t *input_vector,
270 int8_t *output_buffer);
307 int8_t *output_buffer);
400 const int8_t *input_vector,
401 int8_t *output_buffer,
403 void *callback_context);
407 const int8_t **input_vector_list,
408 int8_t *output_buffer,
410 void *callback_context);
428 const int8_t *packed_output,
429 const char **label, int32_t *score);
nrf_axon_result_e
Axon driver return codes.
Definition nrf_axon_driver.h:131
uint32_t NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE
Definition nrf_axon_driver.h:105
nrf_axon_result_e nrf_axon_nn_model_infer_sync_multi_inputs(const nrf_axon_nn_compiled_model_s *compiled_model, int8_t *output_buffer)
Blocking inference function of a compiled model with multiple inputs.
nrf_axon_result_e nrf_axon_nn_model_infer_async_multi_inputs(nrf_axon_nn_model_async_inference_wrapper_s *model_wrapper, const int8_t **input_vector_list, int8_t *output_buffer, void(*inference_callback)(nrf_axon_result_e result, void *callback_context), void *callback_context)
void nrf_axon_nn_copy_output_to_packed_buffer(const nrf_axon_nn_compiled_model_s *compiled_model, int8_t *to_buffer)
Copies and packs the model inference output from the common interlayer buffer to the user's dedicated...
int nrf_axon_nn_offset_to_output_ndx(const nrf_axon_nn_compiled_model_s *compiled_model, uint8_t output_ndx)
Returns the offset into the packed output buffer filled for the start of a particular output node ind...
struct nrf_axon_compiled_model_output_tag_s nrf_axon_compiled_model_output_s
nrf_axon_result_e nrf_axon_nn_model_infer_sync(const nrf_axon_nn_compiled_model_s *compiled_model, const int8_t *input_vector, int8_t *output_buffer)
Blocking inference function of a compiled model that has only one input.
nrf_axon_result_e nrf_axon_nn_model_async_init(nrf_axon_nn_model_async_inference_wrapper_s *model_wrapper, const nrf_axon_nn_compiled_model_s *compiled_model)
Initialize a model for asynchronous inference. Calls nrf_axon_nn_model_validate then binds the model ...
int nrf_axon_nn_model_init_vars(const nrf_axon_nn_compiled_model_s *compiled_model)
Initialize all the persistent var buffers in a streaming-style model (with VarHandle/ReadVariable/Ass...
struct nrf_axon_nn_compiled_model_tag_s nrf_axon_nn_compiled_model_s
nrf_axon_nn_async_inference_status_e
Asynchronous inference states.
Definition nrf_axon_nn_infer.h:314
@ NRF_AXON_NN_ASYNC_INFERENCE_STATUS_IDLE
Definition nrf_axon_nn_infer.h:316
@ NRF_AXON_NN_ASYNC_INFERENCE_STATUS_COMPLETE
Definition nrf_axon_nn_infer.h:320
@ NRF_AXON_NN_ASYNC_INFERENCE_STATUS_ACTIVE
Definition nrf_axon_nn_infer.h:318
nrf_axon_result_e nrf_axon_nn_model_infer_async(nrf_axon_nn_model_async_inference_wrapper_s *model_wrapper, const int8_t *input_vector, int8_t *output_buffer, void(*inference_callback)(nrf_axon_result_e result, void *callback_context), void *callback_context)
static void nrf_axon_nn_set_input_vector(const nrf_axon_nn_compiled_model_s *compiled_model, uint16_t input_no, const int8_t *input_vector)
Populates input_vector_list[input_no] with input_vector.
Definition nrf_axon_nn_infer.h:199
nrf_axon_nn_async_inference_status_e nrf_axon_nn_get_model_async_infer_status(const nrf_axon_nn_model_async_inference_wrapper_s *model_wrapper)
Returns the model inference status of an asynchronous inference.
struct nrf_axon_nn_compiled_model_input_tag_s nrf_axon_nn_compiled_model_input_s
int16_t nrf_axon_nn_get_classification(const nrf_axon_nn_compiled_model_s *compiled_model, const int8_t *packed_output, const char **label, int32_t *score)
Gets the inference results for a classification model.
nrf_axon_result_e nrf_axon_nn_populate_input_vectors(const nrf_axon_nn_compiled_model_s *compiled_model)
Copies model input from input_vector to the location in the interlayer buffer the model expects.
nrf_axon_result_e nrf_axon_nn_model_validate(const nrf_axon_nn_compiled_model_s *compiled_model)
Sanity check of a compiled model.
Internal structure supplied by user but managed by the driver to track execution progress.
Definition nrf_axon_driver.h:173
uint32_t packed_buffer_offset
Definition nrf_axon_nn_infer.h:92
int8_t * ptr
Definition nrf_axon_nn_infer.h:90
uint16_t stride
Definition nrf_axon_nn_infer.h:114
uint32_t packed_size
Definition nrf_axon_nn_infer.h:94
int16_t node_id
Definition nrf_axon_nn_infer.h:105
nrf_axon_nn_model_layer_dimensions_s dimensions
Definition nrf_axon_nn_infer.h:95
uint32_t dequant_mult
Definition nrf_axon_nn_infer.h:103
uint8_t dequant_round
Definition nrf_axon_nn_infer.h:107
int8_t dequant_zp
Definition nrf_axon_nn_infer.h:109
Definition nrf_axon_nn_infer.h:88
int8_t * buf_ptr
Definition nrf_axon_nn_infer.h:166
struct nrf_axon_nn_compiled_model_tag_s::@3 persistent_vars
const nrf_axon_nn_model_persistent_var_s * vars
Definition nrf_axon_nn_infer.h:170
uint32_t model_const_size
Definition nrf_axon_nn_infer.h:158
const NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE * cmd_buffer_ptr
Definition nrf_axon_nn_infer.h:154
uint16_t output_cnt
Definition nrf_axon_nn_infer.h:175
uint32_t interlayer_buffer_needed
Definition nrf_axon_nn_infer.h:148
uint32_t psum_buffer_needed
Definition nrf_axon_nn_infer.h:152
int8_t * packed_output_buf
Definition nrf_axon_nn_infer.h:181
bool is_layer_model
Definition nrf_axon_nn_infer.h:188
int16_t input_cnt
Definition nrf_axon_nn_infer.h:144
uint32_t compiler_version
Definition nrf_axon_nn_infer.h:126
uint32_t buf_size
Definition nrf_axon_nn_infer.h:168
const nrf_axon_nn_compiled_model_input_s * inputs
Definition nrf_axon_nn_infer.h:135
const int8_t ** input_vector_list
Definition nrf_axon_nn_infer.h:142
uint16_t count
Definition nrf_axon_nn_infer.h:172
const nrf_axon_compiled_model_output_s * outputs
Definition nrf_axon_nn_infer.h:177
uint32_t min_driver_version_required
Definition nrf_axon_nn_infer.h:183
const char * model_name
Definition nrf_axon_nn_infer.h:128
uint32_t cmd_buffer_len
Definition nrf_axon_nn_infer.h:160
const char ** labels
Definition nrf_axon_nn_infer.h:133
const void * model_const_ptr
Definition nrf_axon_nn_infer.h:156
Definition nrf_axon_nn_infer.h:121
const nrf_axon_nn_compiled_model_s * compiled_model
Definition nrf_axon_nn_infer.h:330
nrf_axon_nn_async_inference_status_e infer_status
Definition nrf_axon_nn_infer.h:347
nrf_axon_queued_cmd_info_wrapper_s queued_cmd_buf_wrapper
Definition nrf_axon_nn_infer.h:334
void * callback_context
Definition nrf_axon_nn_infer.h:338
nrf_axon_cmd_buffer_info_s cmd_buf_info
Definition nrf_axon_nn_infer.h:332
int8_t * output_buffer
Definition nrf_axon_nn_infer.h:343
Combines the compiled model info with other structures to support asynchronous inferencing....
Definition nrf_axon_nn_infer.h:328
int16_t batch_cnt
Definition nrf_axon_nn_infer.h:33
uint16_t width
Definition nrf_axon_nn_infer.h:31
uint16_t height
Definition nrf_axon_nn_infer.h:30
uint16_t channel_cnt
Definition nrf_axon_nn_infer.h:32
uint8_t byte_width
Definition nrf_axon_nn_infer.h:34
Definition nrf_axon_nn_infer.h:29
int32_t initial_value
Definition nrf_axon_nn_infer.h:74
int8_t * buf_ptr
Definition nrf_axon_nn_infer.h:70
uint32_t buf_size
Definition nrf_axon_nn_infer.h:72
uint8_t byte_width
Definition nrf_axon_nn_infer.h:76
Definition nrf_axon_nn_infer.h:68
Used as a parameter to nrf_axon_queue_cmd_buf for asynchronous execution.
Definition nrf_axon_driver.h:225