-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (25 loc) · 736 Bytes
/
Copy pathmain.cpp
File metadata and controls
31 lines (25 loc) · 736 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
31
#include <iostream>
#include <pthread.h>
#include <cstdlib>
#include "PrimeComputer.h"
#include <omp.h>
using namespace std;
const int N = 1000*10000*1;
//const int N = 10*1;
int main(void) {
double begin,end;
// begin = omp_get_wtime();
// cout << PrimeComputer::computeSerial(N).size() <<endl;
// end = omp_get_wtime();
// cout<<"serial delta time:"<< end-begin <<endl;
//
// begin = omp_get_wtime();
// cout << PrimeComputer::computeParallel(N).size() <<endl;
// end = omp_get_wtime();
// cout<<"parallel delta time:"<< end-begin <<endl;
begin = omp_get_wtime();
PrimeComputer::computeOpenmp(N);
end = omp_get_wtime();
cout<<"parallel delta time:"<< end-begin <<endl;
return 0;
}