examples/omp/benchmarks/kastors-1.1/strassen/src/strassen.c
static void init_matrix(int n, REAL *A, int an, unsigned int bs)
{
     int i, j;

#pragma omp parallel
#pragma omp master
     for (i = 0; i < n; i+=bs)
        for (j = 0; j < n; j+=bs)
        {
#pragma omp task firstprivate(i,j,bs,an)
          {
            unsigned int seed = rand();
            int ii, jj;
            for (ii = i; ii < i+bs; ++ii)
                 for (jj = 0; jj < j+bs; ++jj)
                      ELEM(A, an, ii, jj) = ((double) rand_r(&seed) / RAND_MAX);
          }
        }
}
/*
 * Set an n by n matrix A to random values.  The distance between
 * rows is an
 */
Set an n by n matrix A to random values.  The distance between
rows is an
Set an n by n matrix A to random values . The distance between rows is an
static void init_matrix(int n, REAL *A, int an, unsigned int bs)
{
     int i, j;
#pragma omp parallel
#pragma omp master
     for (i = 0; i < n; i+=bs)
        for (j = 0; j < n; j+=bs)
        {
#pragma omp task firstprivate(i,j,bs,an)
          {
            unsigned int seed = rand();
            int ii, jj;
            for (ii = i; ii < i+bs; ++ii)
                 for (jj = 0; jj < j+bs; ++jj)
                      ELEM(A, an, ii, jj) = ((double) rand_r(&seed) / RAND_MAX);
          }
        }
}
static void init_matrix ( int n , REAL * A , int an , unsigned int bs ) { int i , j ; #pragma  omp parallel #pragma  omp master for ( i = 0 ; i < n ; i += bs ) for ( j = 0 ; j < n ; j += bs ) { #pragma  omp task firstprivate(i,j,bs,an) { unsigned int seed = rand ( ) ; int ii , jj ; for ( ii = i ; ii < i + bs ; ++ ii ) for ( jj = 0 ; jj < j + bs ; ++ jj ) ELEM ( A , an , ii , jj ) = ( ( double ) rand_r ( & seed ) / RAND_MAX ) ; } } }
Set an n by n matrix A to random values.
Set an n by n matrix A to random values .