Changeset 317 for soft/giet_vm
- Timestamp:
- Jun 10, 2014, 12:16:29 PM (10 years ago)
- Location:
- soft/giet_vm/transpose
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/transpose/main.c
r307 r317 100 100 } 101 101 102 barrier_init( &barrier_0, ntasks ); 103 barrier_init( &barrier_1, ntasks ); 104 barrier_init( &barrier_2, ntasks ); 105 barrier_init( &barrier_3, ntasks ); 106 barrier_init( &barrier_4, ntasks ); 107 108 giet_shr_printf("\n*** Proc [%d,%d,%d] completes barrier init at cycle %d\n", 102 if ( ntasks > 1 ) 103 { 104 barrier_init( &barrier_0, ntasks ); 105 barrier_init( &barrier_1, ntasks ); 106 barrier_init( &barrier_2, ntasks ); 107 barrier_init( &barrier_3, ntasks ); 108 barrier_init( &barrier_4, ntasks ); 109 } 110 111 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes barrier init at cycle %d\n", 109 112 0, 0, 0, giet_proctime() ); 113 giet_shr_printf(" - nclusters = %d\n", nclusters ); 114 giet_shr_printf(" - ntasks = %d\n", ntasks ); 110 115 111 116 init_ok = 0; … … 124 129 // get heap vaddr in cluster[0,0] 125 130 unsigned int heap_base; 126 giet_vobj_get_vbase( "transpose", " heap_0_0", &heap_base );131 giet_vobj_get_vbase( "transpose", "trsp_heap_0_0", &heap_base ); 127 132 128 133 // allocate buffers in cluster[x,y] … … 130 135 buf_out[cluster_id] = buf_in[cluster_id] + NN*NN/nclusters; 131 136 132 giet_shr_printf("\n ***Proc [%d,%d,%d] completes buffer allocation at cycle %d\n"137 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes buffer allocation at cycle %d\n" 133 138 " - buf_in = %x\n" 134 139 " - buf_out = %x\n", … … 147 152 giet_exit(" open() failure"); 148 153 } 154 else 155 { 156 giet_shr_printf("\n[TRANSPOSE] Processor[%d,%d,%d]" 157 " open file misc/images.raw\n", 158 x, y, lpid ); 159 } 149 160 } 150 161 151 /////////////////////////// 152 barrier_wait( &barrier_0 );162 ///////////////////////////////////////////// 163 if ( ntasks > 1 ) barrier_wait( &barrier_0 ); 153 164 154 165 // Main loop (on images) … … 167 178 ((image*nblocks) + ((nblocks*cluster_id)/nclusters)) ); 168 179 169 giet_shr_printf("\n*** Proc [%d,%d,0] completes load for image %d at cycle %d\n", 180 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,0] completes load" 181 " for image %d at cycle %d\n", 170 182 x, y, image, giet_proctime() ); 171 183 } … … 173 185 LOAD_END[cluster_id][lpid] = giet_proctime(); 174 186 175 /////////////////////////// 176 barrier_wait( &barrier_1 );187 ///////////////////////////////////////////// 188 if ( ntasks > 1 ) barrier_wait( &barrier_1 ); 177 189 178 190 // parallel transpose from buf_in to buf_out … … 221 233 if ( lpid == 0 ) 222 234 { 223 giet_shr_printf("\n*** proc [%d,%d,0] completes transpose for image %d at cycle %d\n", 224 x, y, image, giet_proctime() ); 235 giet_shr_printf("\n[TRANSPOSE] proc [%d,%d,0] completes transpose" 236 " for image %d at cycle %d\n", 237 x, y, image, giet_proctime() ); 225 238 226 239 } 227 240 TRSP_END[cluster_id][lpid] = giet_proctime(); 228 241 229 /////////////////////////// 230 barrier_wait( &barrier_2 );242 ///////////////////////////////////////////// 243 if ( ntasks > 1 ) barrier_wait( &barrier_2 ); 231 244 232 245 // optional parallel display from local buf_out to frame buffer … … 245 258 if ( lpid == 0 ) 246 259 { 247 giet_shr_printf("\n*** Proc [%d,%d,0] completes display for image %d at cycle %d\n", 260 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,0] completes display" 261 " for image %d at cycle %d\n", 248 262 x, y, image, giet_proctime() ); 249 263 } … … 251 265 DISP_END[cluster_id][lpid] = giet_proctime(); 252 266 253 /////////////////////////// 254 barrier_wait( &barrier_3 );267 ///////////////////////////////////////////// 268 if ( ntasks > 1 ) barrier_wait( &barrier_3 ); 255 269 } 256 270 … … 283 297 if ( success ) 284 298 { 285 giet_shr_printf("\n*** proc [%d,%d,0] : checksum OK for image %d\n", 299 giet_shr_printf("\n[TRANSPOSE] proc [%d,%d,0] checksum OK" 300 " for image %d\n", 286 301 x, y, image ); 287 302 } 288 303 else 289 304 { 290 giet_shr_printf("\n*** proc [%d,%d,0] : checksum KO for image %d\n", 305 giet_shr_printf("\n[TRANSPOSE] proc [%d,%d,0] checksum KO" 306 " for image %d\n", 291 307 x, y, image ); 292 308 } … … 360 376 // all tasks wait instrumentation completion 361 377 ////////////////////////////////////////////////// 362 barrier_wait( &barrier_4 );378 if ( ntasks > 1 ) barrier_wait( &barrier_4 ); 363 379 364 380 } // end while image
Note: See TracChangeset
for help on using the changeset viewer.