Changeset 432 for soft/giet_vm/applications/transpose
- Timestamp:
- Oct 4, 2014, 4:33:31 PM (10 years ago)
- Location:
- soft/giet_vm/applications
- Files:
-
- 1 added
- 1 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/transpose/main.c
r398 r432 66 66 unsigned int c; // cluster index for loops 67 67 68 unsigned int proc_id = giet_procid(); // global processor id69 unsigned int lpid = proc_id % NB_PROCS_MAX; // local processor id70 unsigned int cluster_xy = proc_id / NB_PROCS_MAX; // 8 bits format71 unsigned int x = cluster_xy >> Y_WIDTH; // x coordinate72 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); // y coordinate68 // get processor identifiers 69 unsigned int x; // x cluster coordinate 70 unsigned int y; // y cluster coordinate 71 unsigned int lpid; // local processor index 72 giet_proc_xyp( &x, &y, &lpid); 73 73 74 74 unsigned int npixels = NN * NN; // pixels per image … … 83 83 // It includes parameters checking, barriers initialization, 84 84 // distributed buffers allocation, and file open 85 if ( proc_id == 0)85 if ( (x==0) && (y==0) && (lpid==0) ) 86 86 { 87 87 // Parameters checking … … 140 140 if (file < 0) 141 141 { 142 giet_shr_printf("\n[TRANSPOSE ERROR] Proc essor[%d,%d,%d]"142 giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d]" 143 143 " cannot open file misc/images.raw", 144 144 x, y, lpid ); … … 147 147 else 148 148 { 149 giet_shr_printf("\n[TRANSPOSE] Proc essor[0,0,0] open file misc/images.raw\n");149 giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file misc/images.raw\n"); 150 150 } 151 151 init_ok = 0; … … 154 154 { 155 155 while ( init_ok == 1 ); 156 giet_shr_printf("\n[TRANSPOSE] Processor[%d,%d,%d] starts at cycle %d\n", x, y, lpid); 156 157 } 157 158 158 159 159 ///////////////////////// 160 160 // Main loop (on images) … … 173 173 ((image*nblocks) + ((nblocks*cluster_id)/NB_CLUSTERS)) ); 174 174 175 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d, 0] completes load"175 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes load" 176 176 " for image %d at cycle %d\n", 177 x, y, image, giet_proctime() );177 x, y, lpid, image, giet_proctime() ); 178 178 } 179 179 … … 307 307 barrier_wait( &barrier ); 308 308 309 // instrumentation done by processor [0,0,0] 310 311 if ( (proc_id == 0) && INSTRUMENTATION_OK ) 309 // instrumentation done by processor [0,0,0] 310 if ( (x==0) && (y==0) && (lpid==0) && INSTRUMENTATION_OK ) 312 311 { 313 312 int cc, pp; … … 377 376 378 377 // Processor[0,0,0] releases the Distributed buffers 379 if ( proc_id == 0)378 if ( (x==0) && (y==0) && (lpid==0) ) 380 379 { 381 380 for ( c = 0 ; c < NB_CLUSTERS ; c++ )
Note: See TracChangeset
for help on using the changeset viewer.