File tree Expand file tree Collapse file tree
DeeployTest/Platforms/GAP9/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717#define SLAVESTACKSIZE 3800
1818
1919struct pi_device cluster_dev ;
20+ uint32_t total_cycles = 0 ;
2021
2122typedef struct {
2223 void * expected ;
@@ -68,7 +69,12 @@ void InitNetworkWrapper(void *args) {
6869
6970void RunNetworkWrapper (void * args ) {
7071 (void )args ;
72+ // Initialize performance counter in cluster context
73+ ResetTimer ();
74+ StartTimer ();
7175 RunNetwork (pi_core_id (), pi_cl_cluster_nb_cores ());
76+ total_cycles = getCycles ();
77+ StopTimer ();
7278}
7379
7480int main (void ) {
@@ -113,10 +119,7 @@ int main(void) {
113119
114120 pi_cluster_task (& cluster_task , RunNetworkWrapper , NULL );
115121 cluster_task .slave_stack_size = SLAVESTACKSIZE ;
116- ResetTimer ();
117- StartTimer ();
118122 pi_cluster_send_task_to_cl (& cluster_dev , & cluster_task );
119- StopTimer ();
120123
121124#ifndef CI
122125 printf ("Output:\r\n" );
@@ -175,7 +178,7 @@ int main(void) {
175178 }
176179 }
177180
178- printf ("Runtime: %u cycles\r\n" , getCycles () );
181+ printf ("Runtime: %u cycles\r\n" , total_cycles );
179182 printf ("Errors: %u out of %u \r\n" , tot_err , tot_tested );
180183
181184 return 0 ;
You can’t perform that action at this time.
0 commit comments