-
Notifications
You must be signed in to change notification settings - Fork 1
/
ParseArgs.h
61 lines (49 loc) · 1.29 KB
/
ParseArgs.h
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
/*
*
* Author : Lipeng Wang
* E-mail : wang.lp@outlook.com
* Github : https://github.com/WANG-lp
*
*/
#ifndef PARSEARGS_H_
#define PARSEARGS_H_
#include <iostream>
#include <getopt.h>
#include <stdexcept>
#include <map>
#include <string>
#include <bitset>
#include <vector>
using std::string;
class ParseArgs {
public:
ParseArgs();
char *InputFile;
char *sourceVertexFile;
bool approx;
bool verify;
bool cpu_parallel;
bool printResult;
bool reduce_1_deg;
/*run_flags is a bitmap for selecting the running mode:
* 0000 0000 -> run nothing
* 0000 0001 -> run naive cpu version
* 0000 0010 -> run parallel cpu version
* 0000 0100 -> run parallel cpu version with 1-deg vertices reduction
* 0000 1000 -> run mic offload version
* 0001 0000 -> run mic offload version with 1-deg vertices reduction
* 0010 0000 -> run mic offload with both edge and vertices traversal method enabled
* 1000 0000 -> verify the results
*
*/
std::bitset<32> run_flags;
void Parser(int argc, char *argv[]);
void PrintUsage();
std::map<unsigned int, string> mode_name;
float traversal_thresold;
int num_devices;
int num_cores_mic;
int num_cores_cpu;
virtual ~ParseArgs();
};
#endif /* PARSEARGS_H_ */