Compressed Sparse Blocks  1.2
 All Classes Files Functions Variables Typedefs Friends Macros Pages
benchmark.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <omp.h>
3 using namespace std;
4 
5 int main(int argc, char* argv[])
6 {
7  if(argc < 3)
8  {
9  cout << "Usage: ./membm <datasize> <blocksize> <threadcount>" << endl;
10  return 0;
11  }
12 
13  int size = atoi(argv[0]);
14  int bloc = atoi(argv[1]);
15  int thrs = atoi(argv[2]);
16  omp_set_num_threads(thrs);
17  double * array = new double[size];
18 
19  int iters = size / bloc;
20 
21  #pragma omp parallel for
22  for(int i=0; i< iters; ++i)
23  {
24  double accumulator = 0.0;
25  for(int j=0; j < bloc; ++j)
26  {
27  accumulator += array[];
28  }
29  }
30  return 0;
31 
32 }
33 
34 
int main(int argc, char *argv[])
Definition: benchmark.cpp:5