-
Notifications
You must be signed in to change notification settings - Fork 4
/
ProfileCommon.h
98 lines (92 loc) · 2.14 KB
/
ProfileCommon.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef __PROFILE_COMMON_H__
#define __PROFILE_COMMON_H__
#include <string>
enum ProfilePhase{
INSPECT_TIME,
EXPAND_TIME,
INIT_GRAPH_CALC_TIME,
DYNA_GRAPH_CALC_TIME,
EXCLUDE_GRAPH_UPDATE_TIME,
SORT_TIME,
REDUCE_TIME,
REPAIR_FRONTIER_TIME,
INC_UPDATE_TIME,
PUSH_TIME,
TOTAL_TIME,
PPR_TIME,
PPR_UPDATE_TIME,
PPR_QUERY_TIME,
PROFILE_PHASE_NUM
};
enum ProfileCount{
TRAVERSE_COUNT,
EXPAND_COUNT,
UPDATE_POS_RESIDUAL_COUNT,
UPDATE_NEG_RESIDUAL_COUNT,
UPDATE_RANDOM_WALK_COUNT,
PROFILE_COUNT_TYPE_NUM
};
static std::string GetPhaseString(size_t p){
if (p == INSPECT_TIME){
return "inspect_time";
}
else if (p == EXPAND_TIME){
return "expand_time";
}
else if (p == INIT_GRAPH_CALC_TIME){
return "init_graph_calculation_time";
}
else if (p == DYNA_GRAPH_CALC_TIME){
return "dynamic_graph_calculation_time";
}
else if (p == INC_UPDATE_TIME){
return "inc_update_time";
}
else if (p == PUSH_TIME){
return "push_time";
}
else if (p == SORT_TIME){
return "sort_time";
}
else if (p == REDUCE_TIME){
return "reduce_time";
}
else if (p == REPAIR_FRONTIER_TIME){
return "repair_frontier_time";
}
else if (p == EXCLUDE_GRAPH_UPDATE_TIME){
return "exclude_graph_update_time";
}
else if (p == TOTAL_TIME){
return "total_time";
}
else if (p == PPR_TIME){
return "ppr_time";
}
else if (p == PPR_UPDATE_TIME){
return "ppr_update_time";
}
else if (p == PPR_QUERY_TIME){
return "ppr_query_time";
}
return "";
}
static std::string GetCountString(size_t p){
if (p == TRAVERSE_COUNT){
return "traverse_count";
}
else if (p == EXPAND_COUNT){
return "expand_count";
}
else if (p == UPDATE_POS_RESIDUAL_COUNT){
return "update_pos_residual_count";
}
else if (p == UPDATE_NEG_RESIDUAL_COUNT){
return "update_neg_residual_count";
}
else if (p == UPDATE_RANDOM_WALK_COUNT){
return "update_random_walk_count";
}
return "";
}
#endif