Edge AI Add-on API 2.3.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
37
38#define NRF_AXON_LAYER_MODEL_INPUT_BATCH_CNT(compiled_model_ptr) \
39 (compiled_model_ptr->is_layer_model && (compiled_model_ptr->compiler_version >= 0x10209) ?\
40 ((nrf_axon_nn_compiled_model_layer_s *)compiled_model_ptr)->input_batch_cnt : 1)
41
42 #define NRF_AXON_LAYER_MODEL_OUTPUT_BATCH_CNT(compiled_model_ptr) \
43 (compiled_model_ptr->is_layer_model && (compiled_model_ptr->compiler_version >= 0x10209) ?\
44 ((nrf_axon_nn_compiled_model_layer_s *)compiled_model_ptr)->output_batch_cnt : 1)
45
51typedef struct {
53 const char *test_name;
61 const int8_t **layer_vectors;
63 uint16_t layer_cnt;
65
78 const char *test_name,
79 const int8_t **full_model_input_vectors,
80 const int8_t **full_model_expected_output_vectors,
81 uint16_t full_model_vector_count,
82 const int8_t **layer_vectors,
83 uint16_t layer_cnt);
84
101 const nrf_axon_nn_compiled_model_s **compiled_full_models,
102 const char *test_group_name, uint16_t models_count,
103 const nrf_axon_nn_compiled_model_layer_s **compiled_1_layer_models[],
104 uint16_t *model_layers_count,
105 const nrf_axon_nn_model_test_info_s *test_vectors);
106
113 const nrf_axon_nn_compiled_model_s *compiled_model,
114 int8_t *output_ptr,
115 uint32_t profiling_ticks);
116
124 nrf_axon_nn_compiled_model_layer_s *compiled_layer_model,
125 int8_t *to_buffer);
126
127#ifdef __cplusplus
128} /* extern "C" { */
129#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 layer_ndx
Definition nrf_axon_nn_infer_test.h:35
nrf_axon_nn_compiled_model_s base
Definition nrf_axon_nn_infer_test.h:30
Definition nrf_axon_nn_infer_test.h:28
Definition nrf_axon_nn_infer.h:121
uint16_t full_model_vector_count
Definition nrf_axon_nn_infer_test.h:59
const int8_t ** full_model_expected_output_vectors
Definition nrf_axon_nn_infer_test.h:57
const int8_t ** full_model_input_vectors
Definition nrf_axon_nn_infer_test.h:55
const char * test_name
Definition nrf_axon_nn_infer_test.h:53
const int8_t ** layer_vectors
Definition nrf_axon_nn_infer_test.h:61
uint16_t layer_cnt
Definition nrf_axon_nn_infer_test.h:63
Definition nrf_axon_nn_infer_test.h:51