Ejemplo n.º 1
0
main(int argc, char *argv[])
{
  int *iterations;
  void SOR(vec_ptr v, int *iterations);
  void SOR_blocked(vec_ptr v, int *iterations, int b);

  long int i, j;
  long int block_size;
  uint64_t acc;
  long int MAXSIZE = N;

  // declare and initialize the vector structure
  vec_ptr v0 = new_vec(MAXSIZE);
  iterations = (int *) malloc(sizeof(int));

  //Get blocked SOR data
  for(i=1000; i<=N; i+=1000) {
    //long int this_size = i - ((i-2)%IDEAL_BLOCK);
    long int this_size = i;
    acc=0;
    for(j=0; j<ITERS; j++) {
      fprintf(stderr, "\n(%d %d)", this_size, j);
      init_vector_rand(v0, this_size);
      set_vec_length(v0, this_size);
      tick();
      SOR(v0, iterations);
      //SOR_blocked(v0, iterations, IDEAL_BLOCK);
      tock();
      acc += get_execution_time();
    }
    //length, time(ns)
    printf("%d, %lld\n", this_size, acc/ ITERS + 0.5);
  }

  printf("\n");
  
}
Ejemplo n.º 2
0
void run(int cnt) {
    set_vec_length(data, cnt);
    benchmarks[current_benchmark].cfunct(data, data, &combine_result);
}