Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
nrf_axon_nn_infer_test.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
12#pragma once
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <stdarg.h>
19#include <stdint.h>
20#include "nrf_axon_driver.h"
21#include "nrf_axon_nn_infer.h"
22
60
61#define NRF_AXON_LAYER_MODEL_INPUT_BATCH_CNT(compiled_model_ptr) \
62 (compiled_model_ptr->is_layer_model && (compiled_model_ptr->compiler_version >= 0x10209) ?\
63 ((nrf_axon_nn_compiled_model_layer_s *)compiled_model_ptr)->input_batch_cnt : 1)
64
65 #define NRF_AXON_LAYER_MODEL_OUTPUT_BATCH_CNT(compiled_model_ptr) \
66 (compiled_model_ptr->is_layer_model && (compiled_model_ptr->compiler_version >= 0x10209) ?\
67 ((nrf_axon_nn_compiled_model_layer_s *)compiled_model_ptr)->output_batch_cnt : 1)
68
74typedef struct {
76 const char *test_name;
84 const int8_t **layer_vectors;
86 uint16_t layer_cnt;
88
96 const char *test_name,
97 const int8_t **full_model_input_vectors,
98 const int8_t **full_model_expected_output_vectors,
99 uint16_t full_model_vector_count,
100 const int8_t **layer_vectors,
101 uint16_t layer_cnt);
102
119 const nrf_axon_nn_compiled_model_s **compiled_full_models,
120 const char *test_group_name, uint16_t models_count,
121 const nrf_axon_nn_compiled_model_layer_s **compiled_1_layer_models[],
122 uint16_t *model_layers_count,
123 const nrf_axon_nn_model_test_info_s *test_vectors);
124
131 const nrf_axon_nn_compiled_model_s *compiled_model,
132 int8_t *output_ptr,
133 uint32_t profiling_ticks);
134
142 nrf_axon_nn_compiled_model_layer_s *compiled_layer_model,
143 int8_t *to_buffer);
144
145#ifdef __cplusplus
146} /* extern "C" { */
147#endif
void nrf_axon_layer_model_results_to_buffer(nrf_axon_nn_compiled_model_layer_s *compiled_layer_model, int8_t *to_buffer)
Copies a padded layer model output to an unpadded buffer.
void nrf_axon_nn_populate_model_test_info_s(nrf_axon_nn_model_test_info_s *the_struct, const char *test_name, const int8_t **full_model_input_vectors, const int8_t **full_model_expected_output_vectors, uint16_t full_model_vector_count, const int8_t **layer_vectors, uint16_t layer_cnt)
Populates a nrf_axon_nn_model_test_info_s instance with the provided data.
int nrf_axon_nn_run_test_vectors(const nrf_axon_nn_compiled_model_s **compiled_full_models, const char *test_group_name, uint16_t models_count, const nrf_axon_nn_compiled_model_layer_s **compiled_1_layer_models[], uint16_t *model_layers_count, const nrf_axon_nn_model_test_info_s *test_vectors)
Run the inference test vectors for the passed models.
int nrf_axon_print_test_inference_results(const nrf_axon_nn_compiled_model_s *compiled_model, int8_t *output_ptr, uint32_t profiling_ticks)
Prints formatted test result.
uint16_t input_batch_cnt
Definition nrf_axon_nn_infer_test.h:50
uint16_t output_batch_cnt
Definition nrf_axon_nn_infer_test.h:57
int8_t input0_layer_ndx
Definition nrf_axon_nn_infer_test.h:40
nrf_axon_nn_compiled_model_s base
Definition nrf_axon_nn_infer_test.h:30
int8_t input1_layer_ndx
Definition nrf_axon_nn_infer_test.h:45
uint8_t layer_ndx
Definition nrf_axon_nn_infer_test.h:35
Definition nrf_axon_nn_infer_test.h:28
Definition nrf_axon_nn_infer.h:103
uint16_t full_model_vector_count
Definition nrf_axon_nn_infer_test.h:82
const int8_t ** full_model_expected_output_vectors
Definition nrf_axon_nn_infer_test.h:80
const int8_t ** full_model_input_vectors
Definition nrf_axon_nn_infer_test.h:78
const char * test_name
Definition nrf_axon_nn_infer_test.h:76
const int8_t ** layer_vectors
Definition nrf_axon_nn_infer_test.h:84
uint16_t layer_cnt
Definition nrf_axon_nn_infer_test.h:86
Definition nrf_axon_nn_infer_test.h:74