-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysatorBasicParallel.cpp
More file actions
41 lines (35 loc) · 1.15 KB
/
Copy pathanalysatorBasicParallel.cpp
File metadata and controls
41 lines (35 loc) · 1.15 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
#include "utils.h"
#include "basicParallel.h"
using namespace std;
int main(){
string basePath = "./dataset/basePointcloud.xyz";
string targetPath = "./dataset/targetPointcloud.xyz";
Point basePointCloud[CLOUDSIZE];
Point targetPointCloud[CLOUDSIZE];
ifstream baseFile(basePath);
ifstream targetFile(targetPath);
clock_t start,end;
int dev = 1;
float serialRes;
float basicParaRes;
float optParaRes;
int count = 0;
while (count<CLOUDSIZE)
{
baseFile >> basePointCloud[count].x \
>> basePointCloud[count].y \
>> basePointCloud[count].z;
targetFile >> targetPointCloud[count].x \
>> targetPointCloud[count].y \
>> targetPointCloud[count].z;
count ++;
}
baseFile.close();
targetFile.close();
start = clock();
basicParaCompute(basePointCloud, targetPointCloud, &basicParaRes, dev);
end = clock();
cout << "Basic parallel program result: " << basicParaRes << endl;
cout << "Basic parallel program costs " << (end - start)*1000/float(CLOCKS_PER_SEC) << " ms" << endl;
return 0;
}