-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample_def.h
151 lines (127 loc) · 8.74 KB
/
sample_def.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#ifndef __SAMPLE_DEF_DEFINED
#define __SAMPLE_DEF_DEFINED
#ifdef FUS_SAMPLE
#define SAMPLE_EXEC(xxx,www,yyy,ddd) T_START\
cudaMemset(qp, 0, sizeof(uintT)*4);\
sampling_phase1_fusionX<xxx<yyy,ddd>,www<yyy,ddd>><<<grid_size_final, tb_size>>>(tot_elt, *d_input);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
gen_ff<<<grid_size_final, tb_size>>>(d_input->V, *d_input, q, qp);\
cudaMemcpy(&hqp, qp, sizeof(uintT), cudaMemcpyDeviceToHost);\
sampling_phase33<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<CEIL(hqp*4, tb_size), tb_size>>>(tot_elt, q, hqp, *d_input);\
if(d_input->is_sym == 0) {\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->sym_off = d_input->E;\
sampling_inv_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
} \
CC_GPU(yyy);\
T_END\
break;
#define SAMPLE_EXEC_SUBOPT(xxx,www,yyy,ddd) T_START\
sampling_phase1_fusionX<xxx<yyy,ddd>,www<yyy,ddd>><<<grid_size_final, tb_size>>>(tot_elt, *d_input);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
sampling_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
if(d_input->is_sym == 0) {\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->sym_off = d_input->E;\
sampling_inv_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
} \
CC_GPU(yyy);\
T_END\
break;
#define SAMPLE_EXEC0(xxx,www,yyy,ddd) T_START\
for(int i=0;i<d_input->sample_k;i++) {\
sampling_phase1<xxx<yyy,ddd>,www<yyy,ddd>><<<grid_size_final, tb_size>>>(tot_elt, *d_input, i);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
}\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
sampling_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
if(d_input->is_sym == 0) {\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->sym_off = d_input->E;\
sampling_inv_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
} \
CC_GPU(yyy);\
T_END\
break;
#define RAND_SAMPLE_EXEC(xxx,www,yyy,ddd) T_START\
rand_gen<<<CEIL(d_input->E,32*tb_size), tb_size>>>(*d_input, d_input->_Efront);\
sampling_phase1_fusion<xxx<yyy,ddd>,www<yyy,ddd>><<<grid_size_final*2, tb_size>>>(tot_elt, *d_input);\
compL_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<1>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
sampling_phase3_all<xxx<yyy,ddd>,www<yyy,ddd>,1, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
if(d_input->is_sym == 0) {\
compL_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->sym_off = d_input->E;\
sampling_inv_phase3<xxx<yyy,ddd>,www<yyy,ddd>,1, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
} \
CC_GPU(yyy);\
T_END\
break;
#define SIM_SAMPLE_EXEC(fff,vvv,eee,aaa,rrr,STR) T_START\
sampling_phase1_fusion<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>><<<grid_size_final*2, tb_size>>>(tot_elt, *d_input);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
union_find_tarjan<STR<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>,sampling_inv_phase3<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>, vvv,eee,aaa,rrr, 1>(d_input->V, *d_input);\
CC_GPU(find_compress);\
T_END\
break;
#define STER_SAMPLE_EXEC(fff,vvv,eee,aaa,rrr,STR) T_START\
cudaMemcpy(&d_input->parent[d_input->V], &d_input->parent[0], sizeof(uintT) * d_input->V, cudaMemcpyDeviceToDevice);\
sampling_phase1_fusion<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>><<<grid_size_final*2, tb_size>>>(tot_elt, *d_input);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
union_find_ster<STR<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>,sampling_inv_phase3<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>, vvv,eee,aaa,rrr, 1>(d_input->V, *d_input);\
CC_GPU(find_compress);\
T_END\
break;
#define SV_SAMPLE_EXEC(fff,vvv,eee,aaa,rrr,STR) T_START\
sampling_phase1_fusion<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>><<<grid_size_final*2, tb_size>>>(tot_elt, *d_input);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
union_find_sv<STR<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>,sampling_inv_phase3<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>, vvv,eee,aaa,rrr, 1>(d_input->V, *d_input);\
CC_GPU(find_compress);\
T_END\
break;
#define LP_SAMPLE_EXEC(fff,vvv,eee,aaa,rrr,STR) T_START\
sampling_phase1_fusion<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>><<<grid_size_final*2, tb_size>>>(tot_elt, *d_input);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
union_find_lp<STR<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>,sampling_inv_phase3<blank_fun<find_naive,blank_fun2>,fff<find_naive,blank_fun2>, 0, 1>, vvv,eee,aaa,rrr, 1>(d_input->V, *d_input);\
CC_GPU(find_compress);\
T_END\
break;
#endif
#ifdef NOT_FUS_SAMPLE
#define SAMPLE_EXEC(xxx,www,yyy,ddd) T_START\
for(int i=0;i<d_input->sample_k;i++) {\
sampling_phase1<xxx<yyy,ddd>,www<yyy,ddd>><<<grid_size_final, tb_size>>>(tot_elt, *d_input, i);\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
}\
d_input->max_c = find_largest_component<0>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
sampling_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
if(d_input->is_sym == 0) {\
comp_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
sampling_inv_phase3<xxx<yyy,ddd>,www<yyy,ddd>,0, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
} \
CC_GPU(yyy);\
T_END\
break;
#define RAND_SAMPLE_EXEC(xxx,www,yyy,ddd) T_START\
rand_gen<<<CEIL(d_input->E,32*tb_size), tb_size>>>(*d_input, d_input->_Efront);\
for(int i=0;i<d_input->sample_k;i++) {\
sampling_phase1<xxx<yyy,ddd>,www<yyy,ddd>><<<grid_size_final, tb_size>>>(tot_elt, *d_input, i);\
compL_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
}\
d_input->max_c = find_largest_component<1>(d_input->V, d_input->sample_size, d_input->parent, d_input->lparent, sample, _sample);\
sampling_phase3<xxx<yyy,ddd>,www<yyy,ddd>,1, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
if(d_input->is_sym == 0) {\
compL_tree<<<grid_size_final, tb_size>>>(d_input->V, *d_input);\
sampling_inv_phase3<xxx<yyy,ddd>,www<yyy,ddd>,1, 0><<<grid_size_union, tb_size>>>(tot_elt, *d_input);\
}\
CC_GPU(yyy);\
T_END\
break;
#endif
#endif