-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·63 lines (56 loc) · 1.14 KB
/
Copy pathmain.cpp
File metadata and controls
executable file
·63 lines (56 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include "matrix.h"
#include <unistd.h>
#include <stdlib.h>
#include "omp.h"
#include "timer.h"
//~ #include "testbench.h"
using namespace std;
int thread = 4;
int main(int argc, char* argv[])
{
if(argc != 3)
{
cout << "mdr" << argc << endl;
return -1;
}
//~
//~ int n = atoi(argv[1]);
//~ int m = atoi(argv[2]);
//~ thread = atoi(argv[3]);
//~ int log = atoi(argv[4]);
//~ omp_set_num_threads(thread);
//~ cout << "Number of threads : "<< thread << endl;
//~ Matrix ma(n, m);
//~ ma.init(2);
//~
//~ Matrix m2 = ma;
//~ m2.init(4);
//~
//~ Matrix m4 = ((ma*m2)*2+ma);
//~ unsigned long long int sum = m4.sum();
//~ if(log)
//~ {
//~ cout << ma;
//~ cout << m2;
//~ cout << m4;
//~ }
//~ cout << sum << endl;
// int iter = atoi(argv[1]);
// int matrix_size = atoi(argv[2]);
// TestBench tb(iter, matrix_size);
// tb.print_result();
// tb.print_csv();
omp_set_num_threads(thread);
cout << "Number of threads : "<< thread << endl;
Matrix ma(1000, 1000);
ma.init(2);
Matrix m2 = ma;
m2.init(4);
Timer t;
t.start();
Matrix m4 = ((ma*m2)*2+ma);
t.stop();
cout << t.time() << endl;
return 0;
}