Changeset 398 for soft/giet_vm


Ignore:
Timestamp:
Aug 12, 2014, 10:46:21 AM (10 years ago)
Author:
alain
Message:

Releases dynamically allocated buffers at the end of the transpose application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/transpose/main.c

    r393 r398  
    2323
    2424#define NN                  128                 // image size : nlines = npixels = 128
    25 #define NB_IMAGES           5                   // number of images to be handled
     25#define NB_IMAGES           2                   // number of images to be handled
    2626#define FILE_PATHNAME       "misc/images.raw"   // file pathname on disk
    2727#define NB_CLUSTERS         (X_SIZE * Y_SIZE)   // number of clusters
     
    8080    unsigned int task_id    = (cluster_id * NB_PROCS_MAX) + lpid;  // "continuous" task index
    8181
    82     // processor [0,0,0] makes nitialisation
     82    // Processor [0,0,0] makes initialisation
    8383    // It includes parameters checking, barriers initialization,
    8484    // distributed buffers allocation, and file open
     
    376376    } // end while image     
    377377
     378    // Processor[0,0,0] releases the Distributed buffers
     379    if ( proc_id == 0 )
     380    {
     381        for ( c = 0 ; c < NB_CLUSTERS ; c++ )
     382        {
     383            free( buf_in[c] );
     384            free( buf_in[c] );
     385        }
     386    }
     387
    378388    giet_exit("Completed");
    379389
Note: See TracChangeset for help on using the changeset viewer.