Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
nrf_axon_nn_op_extensions.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
7#pragma once
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12#include <stdint.h>
13#include <stdbool.h>
14#include "nrf_axon_driver.h"
15
25 (uint16_t arg_size, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
26
46typedef struct {
47 struct {
49 int8_t *input;
51 int8_t *output;
52 } ptr_args;
53 struct {
54 union {
61 };
62 union {
64 struct {
66 uint16_t height;
68 uint16_t width;
69 };
70 };
71 union {
73 struct {
75 uint16_t channel_cnt;
80 };
81 };
82 union {
84 struct {
93 };
94 };
95 } remaining_args;
97
98
117typedef struct {
118 struct {
121 int8_t *input;
123 int8_t *output;
124 } ptr_args;
125 struct {
126 union {
128 struct {
129 /*< height in elements of the input */
130 uint16_t input_height;
131 /*< width in elements of the input */
132 uint16_t input_width;
133 };
134 };
135 union {
137 struct {
138 /*< height in elements of the output */
140 /*< width in elements of the output */
141 uint16_t output_width;
142 };
143 };
144 union {
146 struct {
147 /*< channel count in elements of the input */
149 /*< channel count in elements of the output */
151 };
152 };
153 union {
155 struct {
157 uint16_t input_stride;
158 };
159 };
160 } remaining_args;
162
163
172 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
173
185 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
186
198 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
199
211 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
212
224 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
225
235 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
236
237
238
251typedef struct {
252 struct {
255 int8_t *input;
257 int8_t *output;
258 } ptr_args;
259 struct {
260 union {
262 struct {
264 uint16_t input_height;
266 uint16_t input_width;
267 };
268 };
269 union {
271 struct {
275 uint16_t output_width;
276 };
277 };
278 union {
280 struct {
285 };
286 };
287 union {
289 struct {
291 uint16_t input_stride;
294 };
295 };
296 } remaining_args;
298
309 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
310
311
312
325typedef struct {
326 struct {
329 int8_t *space;
331 int8_t *batch;
332 } ptr_args;
333 struct {
334 union {
336 struct {
338 uint16_t space_height;
340 uint16_t space_width;
341 };
342 };
343 union {
345 struct {
347 uint16_t batch_height;
349 uint16_t batch_width;
350 };
351 };
352 union {
354 struct {
356 uint16_t channel_cnt;
358 uint16_t zero_point;
359 };
360 };
361 union {
363 struct {
369 uint16_t input_stride;
371 uint16_t batch_cnt;
372 };
373 };
374 union {
376 struct {
381 uint8_t pad_top;
382 uint8_t pad_bottom;
383 uint8_t pad_left;
384 uint8_t pad_right;
385 };
386 };
387 union {
389 struct {
390 uint16_t block_height;
391 uint16_t block_width;
392 };
393 };
394 } remaining_args;
396
407 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
408
419 uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args);
420
421#ifdef __cplusplus
422} /* extern "C" { */
423#endif
nrf_axon_result_e
Axon driver return codes.
Definition nrf_axon_driver.h:86
uint32_t NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE
Definition nrf_axon_driver.h:76
nrf_axon_result_e nrf_axon_nn_op_extension_sigmoid(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements sigmoid operator.
nrf_axon_result_e nrf_axon_nn_op_extension_tanh(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements tanh operator.
nrf_axon_result_e nrf_axon_nn_op_extension_tanh_v2(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements tanh operator.
nrf_axon_result_e(* axon_op_extension_func)(uint16_t arg_size, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Function prototype for all operation extension functions.
Definition nrf_axon_nn_op_extensions.h:25
nrf_axon_result_e nrf_axon_nn_op_extension_resize_nearest_neighbor(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements resize_nearest_neighbor operator.
nrf_axon_result_e nrf_axon_nn_op_extension_reshape(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements reshape operator.
nrf_axon_result_e nrf_axon_nn_op_extension_sigmoid_v2(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements sigmoid operator.
nrf_axon_result_e nrf_axon_nn_op_extension_softmax(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements softmax operator.
nrf_axon_result_e nrf_axon_nn_cpu_op_batch_to_space(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements batch_to_space operator.
nrf_axon_result_e nrf_axon_nn_cpu_op_space_to_batch(uint16_t argc, NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE *args)
Implements space_to_batch operator.
int8_t * output
Definition nrf_axon_nn_op_extensions.h:51
uint8_t output_bytewidth
Definition nrf_axon_nn_op_extensions.h:86
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer3
Definition nrf_axon_nn_op_extensions.h:83
uint16_t channel_cnt
Definition nrf_axon_nn_op_extensions.h:75
uint16_t height
Definition nrf_axon_nn_op_extensions.h:66
int8_t output_zeropoint
Definition nrf_axon_nn_op_extensions.h:79
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer2
Definition nrf_axon_nn_op_extensions.h:72
uint16_t width
Definition nrf_axon_nn_op_extensions.h:68
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer1
Definition nrf_axon_nn_op_extensions.h:63
uint8_t output_rounding
Definition nrf_axon_nn_op_extensions.h:77
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer0
Definition nrf_axon_nn_op_extensions.h:55
bool quantization_enabled
Definition nrf_axon_nn_op_extensions.h:88
uint32_t output_multiplier
Definition nrf_axon_nn_op_extensions.h:60
int8_t * input
Definition nrf_axon_nn_op_extensions.h:49
bool input_is_packed
Definition nrf_axon_nn_op_extensions.h:92
Structure compiled into the command buffer then passed to some CPU op extension functions.
Definition nrf_axon_nn_op_extensions.h:46
uint16_t input_height
Definition nrf_axon_nn_op_extensions.h:130
int8_t * input
Definition nrf_axon_nn_op_extensions.h:121
uint16_t input_width
Definition nrf_axon_nn_op_extensions.h:132
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer2
Definition nrf_axon_nn_op_extensions.h:145
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer0
Definition nrf_axon_nn_op_extensions.h:127
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer3
Definition nrf_axon_nn_op_extensions.h:154
uint16_t input_channel_cnt
Definition nrf_axon_nn_op_extensions.h:148
uint16_t input_stride
Definition nrf_axon_nn_op_extensions.h:157
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer1
Definition nrf_axon_nn_op_extensions.h:136
uint16_t output_height
Definition nrf_axon_nn_op_extensions.h:139
uint16_t output_width
Definition nrf_axon_nn_op_extensions.h:141
uint16_t output_channel_cnt
Definition nrf_axon_nn_op_extensions.h:150
int8_t * output
Definition nrf_axon_nn_op_extensions.h:123
Structure compiled into the command buffer then passed to some CPU op extension functions.
Definition nrf_axon_nn_op_extensions.h:117
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer1
Definition nrf_axon_nn_op_extensions.h:270
uint16_t input_width
Definition nrf_axon_nn_op_extensions.h:266
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer2
Definition nrf_axon_nn_op_extensions.h:279
uint16_t output_channel_cnt
Definition nrf_axon_nn_op_extensions.h:284
uint16_t output_height
Definition nrf_axon_nn_op_extensions.h:273
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer3
Definition nrf_axon_nn_op_extensions.h:288
int8_t * input
Definition nrf_axon_nn_op_extensions.h:255
uint16_t input_stride
Definition nrf_axon_nn_op_extensions.h:291
uint16_t output_width
Definition nrf_axon_nn_op_extensions.h:275
int8_t * output
Definition nrf_axon_nn_op_extensions.h:257
uint16_t input_height
Definition nrf_axon_nn_op_extensions.h:264
uint16_t input_channel_cnt
Definition nrf_axon_nn_op_extensions.h:282
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer0
Definition nrf_axon_nn_op_extensions.h:261
bool half_pixel_centers
Definition nrf_axon_nn_op_extensions.h:293
bool align_corners
Definition nrf_axon_nn_op_extensions.h:292
Structure compiled into the command buffer then passed to the CPU op extension function resize_neares...
Definition nrf_axon_nn_op_extensions.h:251
uint16_t batch_width
Definition nrf_axon_nn_op_extensions.h:349
uint16_t space_height
Definition nrf_axon_nn_op_extensions.h:338
uint16_t batch_height
Definition nrf_axon_nn_op_extensions.h:347
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE space5
Definition nrf_axon_nn_op_extensions.h:388
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer2
Definition nrf_axon_nn_op_extensions.h:353
uint16_t input_stride
Definition nrf_axon_nn_op_extensions.h:369
uint16_t batch_cnt
Definition nrf_axon_nn_op_extensions.h:371
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer4
Definition nrf_axon_nn_op_extensions.h:375
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer0
Definition nrf_axon_nn_op_extensions.h:335
uint8_t pad_right
Definition nrf_axon_nn_op_extensions.h:384
uint16_t zero_point
Definition nrf_axon_nn_op_extensions.h:358
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer3
Definition nrf_axon_nn_op_extensions.h:362
uint16_t block_width
Definition nrf_axon_nn_op_extensions.h:391
uint8_t pad_top
Definition nrf_axon_nn_op_extensions.h:381
uint16_t block_height
Definition nrf_axon_nn_op_extensions.h:390
NRF_AXON_PLATFORM_BITWIDTH_UNSIGNED_TYPE spacer1
Definition nrf_axon_nn_op_extensions.h:344
int8_t * batch
Definition nrf_axon_nn_op_extensions.h:331
int8_t * space
Definition nrf_axon_nn_op_extensions.h:329
uint16_t space_width
Definition nrf_axon_nn_op_extensions.h:340
uint16_t channel_cnt
Definition nrf_axon_nn_op_extensions.h:356
uint8_t pad_bottom
Definition nrf_axon_nn_op_extensions.h:382
uint8_t pad_left
Definition nrf_axon_nn_op_extensions.h:383
Structure compiled into the command buffer then passed to the CPU op extension functions space_to_bat...
Definition nrf_axon_nn_op_extensions.h:325