Ignore:
Timestamp:
May 6, 2016, 3:06:29 PM (9 years ago)
Author:
meunier
Message:
  • Added several versions of rosenfeld: { SLOW, FAST } x { FEATURES, NO_FEATURES }
  • Added native linux compilation support
  • Added a script to check results natively
  • Started to refactor nrc code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/src-par/mca_matrix_dist.c

    r805 r821  
    1414#include <malloc.h>
    1515
    16 #ifdef CLI
    1716#include "nrc_os_config.h"
    1817#include "nrc.h"
    19 #endif
    2018
    2119
     
    6159}
    6260
     61#if TARGET_OS == GIETVM
     62// ---------------------------------------------------------------------------
     63uint32 ** remote_dist_ui32matrix(int i0, int i1, int j0, int j1, int x, int y)
     64// ---------------------------------------------------------------------------
     65{
     66    int i;
     67    int nrow = i1 - i0 + 1;
     68    int ncol = j1 - j0 + 1;
     69    uint32 ** m;
     70   
     71    // allocate pointers to rows
     72    m = (uint32 **) remote_malloc((nrow + 2) * sizeof(uint32 *), x, y);
     73    if (!m) {
     74        nrerror("allocation failure 1 in dist_ui32matrix()");
     75    }
     76    m -= i0;
     77    m += 1;
     78   
     79    // allocate rows and set pointers to them
     80    m[i0] = (uint32 *) remote_malloc((nrow * ncol + 1) * sizeof(uint32), x, y);
     81    if (!m[i0]) {
     82        nrerror("allocation failure 2 in dist_ui32matrix()");
     83    }
     84    m[i0] -= j0;
     85   
     86    for (i = i0 + 1; i <= i1; i++) {
     87        m[i] = m[i - 1] + ncol;
     88    }
     89   
     90    // make borders to point to first and last lines
     91    m[i0 - 1] = m[i0];
     92    m[i1 + 1] = m[i1];
     93   
     94    return m;
     95}
     96#endif
     97
     98
    6399
    64100// -------------------------------------------------------------------
     
    66102// -------------------------------------------------------------------
    67103{
    68     free((FREE_ARG) (m[i0] + j0));
    69     free((FREE_ARG) (m + i0 - 1));
     104    free(m[i0] + j0);
     105    free(m + i0 - 1);
    70106}
    71107
Note: See TracChangeset for help on using the changeset viewer.