![]() |
Edge AI Add-on API 2.2.0
|
| 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.
If input_vector is NULL, the user has to copy the model input to the correct location in the interlayer buffer (specified by the compiled_model). In a dynamic system where there are other threads utilizing axon and/or asynchronous inference is occurring, the user must 1st call nrf_axon_platform_reserve_for_user() prior to accessing the interlayer_buffer, then invoke this function.
Similarly, output_buffer cannot be NULL in a dynamic system as there is no way to retain control of axon after inference completes.
Cannot be called from interrupt context.
| [in] | compiled_model | The compiled model to perform inference on that has been validated by calling nrf_axon_nn_model_validate(compiled_model). |
| [in] | input_vector | Packed input that is copied to the model's input_ptr prior to inference. Can be NULL (see above). |
| [out] | output_buffer | Buffer to hold the packed output result. Can be NULL (see above). |
| 0 | on success, are a negative error code. |