21#define INCLUDE_FILE(section, filename, symbol) asm (\
23 ".globl _"#symbol"_start\n"
\
24 ".globl _"#symbol"_data\n"
\
25 "_"#symbol"_start:\n"
\
26 "_"#symbol"_data:\n"
\
27 ".incbin \""filename"\"\n"
\
28 ".globl _"#symbol"_end\n"
\
32#define INCLUDE_FILE(section, filename, symbol) asm (\
33 ".section "#section"\n"
\
35 ".global "#symbol"_start\n"
\
36 ".global "#symbol"_data\n"
\
39 ".incbin \""filename"\"\n"
\
40 ".global "#symbol"_end\n"
\
43 ".section \".text\"\n")
54static inline void nn_assert(
int condition,
char *message) {
56 printf(
"Assertion failed: ");
57 printf(
"%s\n", message);
73 for (
size_t i = 0; i < ndim; i += 1) {
74 printf(
"%d", (
int)shape[i]);
110 long int_part = (long)v;
111 float fractional_part = v - int_part;
114 printf(
"%ld", int_part);
116 if (num_digits > 0) {
121 while (num_digits > 0) {
123 fractional_part *= 10;
124 int digit = (int)(fractional_part);
126 fractional_part -= digit;
132#ifdef CONFIG_DTYPE_ENABLE_F16
136#ifdef CONFIG_DTYPE_ENABLE_I32
void nn_print_f32(float v, int16_t num_digits)
Definition: nn.h:91
void nn_print_shape(size_t ndim, const size_t *shape)
Definition: nn.h:71
static void nn_assert(int condition, char *message)
Definition: nn.h:54