-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (23 loc) · 693 Bytes
/
main.cpp
File metadata and controls
30 lines (23 loc) · 693 Bytes
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
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <immintrin.h>
#include <omp.h>
#include "matrix_multiplication.h"
using namespace std;
int main(int argc, char *argv[]){
int size = 1024 * 1;
int threadsNum;
double executionTime, GFlops;
threadsNum = atoi(argv[1]);
MatrixMultiplication matMul(size, threadsNum);
executionTime = matMul.measurement();
//matMul.showMatrixData();
matMul.memoryFree();
cout << "Time is " << fixed << executionTime << endl;
GFlops = ( ((double)size/1000 * (double)size/1000 * (double)size/1000) * 2 ) / executionTime;
cout << "GFlops is " << fixed << GFlops << endl;
return 0;
}