@@ -42,16 +42,16 @@ unsigned int PMU_set_voltage(unsigned int Voltage, unsigned int CheckFrequencies
42
42
43
43
44
44
void application (void * arg) {
45
- /*
46
- Opening of Filesystem and Ram
47
- */
48
- % if l3_supported:
45
+ % if l3_supported:
46
+ // Opening of Filesystem and Ram
49
47
mem_init ();
50
- ${prefix} network_initialize ();
48
+
51
49
% endif
52
- /*
53
- Allocating space for input
54
- */
50
+ // Initializing network
51
+ ${prefix}network_t network;
52
+ ${prefix}network_initialize (&network);
53
+
54
+ // Allocating space for input
55
55
void * l2_buffer = pi_l2_malloc (${l2_buffer_size});
56
56
if (NULL == l2_buffer) {
57
57
#if def VERBOSE
@@ -64,7 +64,6 @@ void application(void * arg) {
64
64
# endif
65
65
size_t l2_input_size = ${int (DORY_HW_graph[0 ].tiling_dimensions["L2" ]["input_activation_memory" ])};
66
66
size_t input_size = 1000000 ;
67
- int initial_dir = 1 ;
68
67
% if l3_supported:
69
68
70
69
void * ram_input = ram_malloc (input_size);
@@ -80,15 +79,25 @@ void application(void * arg) {
80
79
% if l3_supported:
81
80
ram_read (l2_buffer, ram_input, l2_input_size);
82
81
% endif
83
- ${prefix}network_run (l2_buffer, ${l2_buffer_size}, l2_buffer, ${"0" if single_input else "exec" }, initial_dir${f", {prefix}L2_input_h{' + exec * l2_input_size' if not single_input else ''}" if not l3_supported else "" });
82
+ ${prefix}network_args_t args = {
83
+ .l2_buffer = l2_buffer,
84
+ .l2_buffer_size = ${l2_buffer_size},
85
+ .l2_final_output = l2_buffer,
86
+ .exec = ${"0" if single_input else "exec" },
87
+ .initial_allocator_dir = 1 ,
88
+ % if not l3_supported:
89
+ .l2_input_h = ${prefix}L2_input_h${' + exec * l2_input_size' if not single_input else '' }
90
+ % endif
91
+ };
92
+ ${prefix}network_run (&network, &args);
84
93
85
94
% if not single_input:
86
95
}
87
96
% endif
88
97
% if l3_supported:
89
98
ram_free (ram_input, input_size);
90
- ${prefix}network_terminate ();
91
99
% endif
100
+ ${prefix}network_terminate (&network);
92
101
pi_l2_free (l2_buffer, ${l2_buffer_size});
93
102
}
94
103
0 commit comments