Changeset 444 for soft/giet_vm/applications/transpose
- Timestamp:
- Nov 3, 2014, 12:40:50 PM (10 years ago)
- Location:
- soft/giet_vm/applications/transpose
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/transpose/main.c
r432 r444 1 ///////////////////////////////////////////////////////////////////////////////////////////// //1 ///////////////////////////////////////////////////////////////////////////////////////////// 2 2 // File : main.c (for transpose application) 3 3 // Date : february 2014 4 4 // author : Alain Greiner 5 // 6 // This application makes a transpose for a NN*NN pixels sequence of images. 5 ///////////////////////////////////////////////////////////////////////////////////////////// 6 // This multi-threaded application makes a transpose for a NN*NN pixels sequence of images. 7 // It can run on a multi-processors, multi-clusters architecture, with one thread 8 // per processor. It uses the he following hardware parameters, that must be defined 9 // in the hard_config.h file: 10 // - X_SIZE : number of clusters in a row 11 // - Y_SIZE : number of clusters in a column 12 // - NB_PROCS_MAX : number of processors per cluster 13 // - FBUF_X_SIZE : number of pixels per line in frame buffer 14 // - FBUF_Y_SIZE : number of lines in frame buffer 15 // 7 16 // The image sequence is read from a file (one byte per pixel). 8 17 // The input and output buffers containing the image are distributed in all clusters. 9 18 // 10 // - The image size NN must be a power of 2 .19 // - The image size NN must be a power of 2 and must fit the frame buffer size. 11 20 // - The number of clusters containing processors must be a power of 2. 12 // - The number of processors per cluster (NB_PROCS_MAX)must be a power of 2.21 // - The number of processors per cluster must be a power of 2. 13 22 // - The image size NN must be larger or equal to the total number of processor. 14 23 // 15 24 // For each image the application makes a self test (checksum for each line). 16 25 // The actual display on the frame buffer depends on frame buffer availability. 17 ///////////////////////////////////////////////////////////////////////////////////////////// //26 ///////////////////////////////////////////////////////////////////////////////////////////// 18 27 19 28 #include "hard_config.h" … … 23 32 24 33 #define NN 128 // image size : nlines = npixels = 128 25 #define NB_IMAGES 2// number of images to be handled34 #define NB_IMAGES 5 // number of images to be handled 26 35 #define FILE_PATHNAME "misc/images.raw" // file pathname on disk 27 36 #define NB_CLUSTERS (X_SIZE * Y_SIZE) // number of clusters … … 54 63 giet_barrier_t barrier; 55 64 56 volatile unsigned int init_ok = 1;65 volatile unsigned int init_ok = 0; 57 66 58 67 ////////////////////////////////////////// … … 86 95 { 87 96 // Parameters checking 97 if ( (NN != FBUF_X_SIZE) || (NN != FBUF_Y_SIZE) ) 98 { 99 giet_exit("[TRANSPOSE ERROR] Frame buffer size does not fit image size"); 100 } 88 101 if ((NB_PROCS_MAX != 1) && (NB_PROCS_MAX != 2) && (NB_PROCS_MAX != 4)) 89 102 { … … 149 162 giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file misc/images.raw\n"); 150 163 } 151 init_ok = 0;164 init_ok = 1; 152 165 } 153 166 else // others processors wait initialisation completion 154 167 { 155 while ( init_ok == 1 ); 156 giet_shr_printf("\n[TRANSPOSE] Processor[%d,%d,%d] starts at cycle %d\n", x, y, lpid); 168 while ( init_ok == 0 ); 169 giet_shr_printf("\n[TRANSPOSE] Processor[%d,%d,%d] starts at cycle %d\n", 170 x, y, lpid, giet_proctime() ); 157 171 } 158 172 … … 247 261 unsigned int npt = npixels / ntasks; // number of pixels per task 248 262 249 giet_fb _sync_write( npt * task_id,250 &buf_out[cluster_id][lpid*npt],251 npt );263 giet_fbf_sync_write( npt * task_id, 264 &buf_out[cluster_id][lpid*npt], 265 npt ); 252 266 253 267 if ( lpid == 0 ) -
soft/giet_vm/applications/transpose/transpose.py
r432 r444 25 25 x_size = mapping.x_size 26 26 y_size = mapping.y_size 27 nprocs = mapping.nprocs27 nprocs = mapping.nprocs 28 28 x_width = mapping.x_width 29 29 y_width = mapping.y_width
Note: See TracChangeset
for help on using the changeset viewer.