Changeset 432 for soft/giet_vm/applications/convol/main.c
- Timestamp:
- Oct 4, 2014, 4:33:31 PM (10 years ago)
- Location:
- soft/giet_vm/applications
- Files:
-
- 1 added
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/convol/main.c
r402 r432 94 94 int z; // vertical filter index for loops 95 95 96 // processor identifiers 97 unsigned int x; // x coordinate 98 unsigned int y; // y coordinate 99 unsigned int lpid; // local proc/task id 100 giet_proc_xyp( &x, &y, &lpid ); 101 96 102 int file = 0; // file descriptor 97 unsigned int pid = giet_procid(); // processor id98 103 unsigned int nprocs = NB_PROCS_MAX; // procs per cluster 99 104 unsigned int nclusters = NB_CLUSTERS; // number of clusters 100 unsigned int lpid = pid % nprocs; // local task id101 unsigned int cluster_xy = pid / nprocs; // cluster index102 unsigned int x = cluster_xy >> Y_WIDTH; // x coordinate103 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); // y coordinate104 105 unsigned int cluster_id = (x * Y_SIZE) + y; // continuous cluster index 105 106 unsigned int task_id = (cluster_id * nprocs) + lpid; // continuous task index … … 145 146 /////////////////////////////////////////////////////////////////// 146 147 147 if ( pid == 0)148 if ( (x==0) && (y==0) && (lpid==0) ) 148 149 { 149 150 giet_shr_printf("\n[CONVOL] task[0,0,0] starts barrier init at cycle %d\n" … … 237 238 // Other tasks are waiting on the init_ok condition. 238 239 ////////////////////////////////////////////////////////////////////////// 239 if ( pid == 0)240 if ( (x==0) && (y==0) && (lpid==0) ) 240 241 { 241 242 // open file … … 331 332 x, y, lpid, date ); 332 333 #else 333 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter" 334 " at cycle %d\n", date ); 334 if ( (x==0) && (y==0) && (lpid==0) ) 335 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter" 336 " at cycle %d\n", date ); 335 337 #endif 336 338 … … 404 406 x, y, lpid, date ); 405 407 #else 406 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter" 407 " at cycle %d\n", date ); 408 if ( (x==0) && (y==0) && (lpid==0) ) 409 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter" 410 " at cycle %d\n", date ); 408 411 #endif 409 412 … … 433 436 x, y, lpid, date ); 434 437 #else 435 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter" 436 " at cycle %d\n", date ); 438 if ( (x==0) && (y==0) && (lpid==0) ) 439 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter" 440 " at cycle %d\n", date ); 437 441 #endif 438 442 … … 522 526 x, y, lpid, date ); 523 527 #else 524 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter" 525 " at cycle %d\n", date ); 528 if ( (x==0) && (y==0) && (lpid==0) ) 529 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter" 530 " at cycle %d\n", date ); 526 531 #endif 527 532 … … 548 553 x, y, lpid, date); 549 554 #else 550 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display" 551 " at cycle %d\n", date ); 555 if ( (x==0) && (y==0) && (lpid==0) ) 556 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display" 557 " at cycle %d\n", date ); 552 558 #endif 553 559 … … 579 585 x, y, lpid, date); 580 586 #else 581 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display" 582 " at cycle %d\n", date ); 587 if ( (x==0) && (y==0) && (lpid==0) ) 588 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display" 589 " at cycle %d\n", date ); 583 590 #endif 584 591 … … 596 603 ///////////////////////////////////////////////////////// 597 604 598 if ( pid == 0)605 if ( (x==0) && (y==0) && (lpid==0) ) 599 606 { 600 607 date = giet_proctime();
Note: See TracChangeset
for help on using the changeset viewer.