Exemple #1
0
int main(int argc, char **argv)
{
  int n = N;
  double(*A)[N][N];
  A = (double(*)[N][N])polybench_alloc_data((N) * (N), sizeof(double));
  double(*x1)[N];
  x1 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*x2)[N];
  x2 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*y_1)[N];
  y_1 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*y_2)[N];
  y_2 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  init_array(n, *x1, *x2, *y_1, *y_2, *A);
  polybench_timer_start();
  kernel_mvt(n, *x1, *x2, *y_1, *y_2, *A);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *x1, *x2);
  free((void *)A);
  free((void *)x1);
  free((void *)x2);
  free((void *)y_1);
  free((void *)y_2);
  return 0;
}
Exemple #2
0
int main(int argc, char **argv) {
  int ni = NI;
  int nj = NJ;
  int nk = NK;
  int nl = NL;
  double alpha;
  double beta;
  double(*tmp)[NI][NJ];
  tmp = (double(*)[NI][NJ])polybench_alloc_data((NI) * (NJ), sizeof(double));
  double(*A)[NI][NK];
  A = (double(*)[NI][NK])polybench_alloc_data((NI) * (NK), sizeof(double));
  double(*B)[NK][NJ];
  B = (double(*)[NK][NJ])polybench_alloc_data((NK) * (NJ), sizeof(double));
  double(*C)[NJ][NL];
  C = (double(*)[NJ][NL])polybench_alloc_data((NJ) * (NL), sizeof(double));
  double(*D)[NI][NL];
  D = (double(*)[NI][NL])polybench_alloc_data((NI) * (NL), sizeof(double));
  init_array(ni, nj, nk, nl, &alpha, &beta, *A, *B, *C, *D);
  polybench_timer_start();
  kernel_2mm(ni, nj, nk, nl, alpha, beta, *tmp, *A, *B, *C, *D);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], "")) print_array(ni, nl, *D);
  free((void *)tmp);
  free((void *)A);
  free((void *)B);
  free((void *)C);
  free((void *)D);
  return 0;
}
Exemple #3
0
int main(int argc, char **argv)
{
  int n = N;
  int m = M;
  double(*A)[N][M];
  A = (double(*)[N][M])polybench_alloc_data((N) * (M), sizeof(double));
  double(*s)[M];
  s = (double(*)[M])polybench_alloc_data(M, sizeof(double));
  double(*q)[N];
  q = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*p)[M];
  p = (double(*)[M])polybench_alloc_data(M, sizeof(double));
  double(*r)[N];
  r = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  init_array(m, n, *A, *r, *p);
  polybench_timer_start();
  kernel_bicg(m, n, *A, *s, *q, *p, *r);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(m, n, *s, *q);
  free((void *)A);
  free((void *)s);
  free((void *)q);
  free((void *)p);
  free((void *)r);
  return 0;
}
Exemple #4
0
int main(int argc, char **argv)
{
  int n = N;
  double(*A)[N][N];
  A = (double(*)[N][N])polybench_alloc_data((N) * (N), sizeof(double));
  init_array(n, *A);
  polybench_timer_start();
  kernel_cholesky(n, *A);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *A);
  free((void *)A);
  return 0;
}
int main(int argc, char** argv) {
  int n = N;
  int tsteps = TSTEPS;
  double(*A)[N][N];
  A = (double(*)[N][N])polybench_alloc_data((N) * (N), sizeof(double));
  double(*B)[N][N];
  B = (double(*)[N][N])polybench_alloc_data((N) * (N), sizeof(double));
  init_array(n, *A, *B);
  polybench_timer_start();
  kernel_jacobi_2d(tsteps, n, *A, *B);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], "")) print_array(n, *A);
  free((void*)A);
  free((void*)B);
  return 0;
}
Exemple #6
0
int main(int argc, char **argv)
{
  int n = N;
  double alpha;
  double beta;
  double(*A)[N][N];
  A = (double(*)[N][N])polybench_alloc_data((N) * (N), sizeof(double));
  double(*u1)[N];
  u1 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*v1)[N];
  v1 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*u2)[N];
  u2 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*v2)[N];
  v2 = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*w)[N];
  w = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*x)[N];
  x = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*y)[N];
  y = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  double(*z)[N];
  z = (double(*)[N])polybench_alloc_data(N, sizeof(double));
  init_array(n, &alpha, &beta, *A, *u1, *v1, *u2, *v2, *w, *x, *y, *z);
  polybench_timer_start();
  kernel_gemver(n, alpha, beta, *A, *u1, *v1, *u2, *v2, *w, *x, *y, *z);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *w);
  free((void *)A);
  free((void *)u1);
  free((void *)v1);
  free((void *)u2);
  free((void *)v2);
  free((void *)w);
  free((void *)x);
  free((void *)y);
  free((void *)z);
  return 0;
}
Exemple #7
0
int main(int argc, char** argv)
{

  int m = 1900;
  int n = 2100;


  double (*A)[m + 0][n + 0]; A = (double(*)[m + 0][n + 0])polybench_alloc_data ((m + 0) * (n + 0), sizeof(double));;
  double (*x)[n + 0]; x = (double(*)[n + 0])polybench_alloc_data (n + 0, sizeof(double));;
  double (*y)[n + 0]; y = (double(*)[n + 0])polybench_alloc_data (n + 0, sizeof(double));;
  double (*tmp)[m + 0]; tmp = (double(*)[m + 0])polybench_alloc_data (m + 0, sizeof(double));;


  init_array (m, n, *A, *x);


  polybench_timer_start();


  kernel_atax (m, n,
        *A,
        *x,
        *y,
        *tmp);


  polybench_timer_stop();;
  polybench_timer_print();;



  if (argc > 42 && ! strcmp(argv[0], "")) print_array(n, *y);


  free((void*)A);;
  free((void*)x);;
  free((void*)y);;
  free((void*)tmp);;

  return 0;
}
int main(int argc, char** argv) {
  int tmax = TMAX;
  int nx = NX;
  int ny = NY;
  double(*ex)[NX][NY];
  ex = (double(*)[NX][NY])polybench_alloc_data((NX) * (NY), sizeof(double));
  double(*ey)[NX][NY];
  ey = (double(*)[NX][NY])polybench_alloc_data((NX) * (NY), sizeof(double));
  double(*hz)[NX][NY];
  hz = (double(*)[NX][NY])polybench_alloc_data((NX) * (NY), sizeof(double));
  double(*_fict_)[TMAX];
  _fict_ = (double(*)[TMAX])polybench_alloc_data(TMAX, sizeof(double));
  init_array(tmax, nx, ny, *ex, *ey, *hz, *_fict_);
  polybench_timer_start();
  kernel_fdtd_2d(tmax, nx, ny, *ex, *ey, *hz, *_fict_);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(nx, ny, *ex, *ey, *hz) free((void*)ex);
  free((void*)ey);
  free((void*)hz);
  free((void*)_fict_);
  return 0;
}
int main(int argc, char** argv) {
  int w = W;
  int h = H;
  float alpha;
  float(*imgIn)[W][H];
  imgIn = (float(*)[W][H])polybench_alloc_data((W) * (H), sizeof(float));
  float(*imgOut)[W][H];
  imgOut = (float(*)[W][H])polybench_alloc_data((W) * (H), sizeof(float));
  float(*y1)[W][H];
  y1 = (float(*)[W][H])polybench_alloc_data((W) * (H), sizeof(float));
  float(*y2)[W][H];
  y2 = (float(*)[W][H])polybench_alloc_data((W) * (H), sizeof(float));
  init_array(w, h, &alpha, *imgIn, *imgOut);
  polybench_timer_start();
  kernel_deriche(w, h, alpha, *imgIn, *imgOut, *y1, *y2);
  polybench_timer_stop();
  polybench_timer_print();
  if (argc > 42 && !strcmp(argv[0], "")) print_array(w, h, *imgOut);
  free((void*)imgIn);
  free((void*)imgOut);
  free((void*)y1);
  free((void*)y2);
  return 0;
}
void alnsb_timer_start ()
{
  polybench_timer_start ();
}