-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoperations.cpp
227 lines (189 loc) · 11.5 KB
/
operations.cpp
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#include "sm.h"
void ArrayCopySetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ArrayOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void SpmvDIASetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ArraySumSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ScalarCopySetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ScalarOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ScalarArrayOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ReturnSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void SpmvDIA2DSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array2DOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array2DCopySetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ScalarArray2DOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Stencil2DMVMSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array2DSumSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ExtractSnapshotsSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array3DCopySetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void CgemmBatchSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ScalarArray3DOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void SolveBatchSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void GammaWeightsSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void InnerProductsSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void WarpImg2DSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void RedArray2DSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void BlackArray2DSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ApplyHSPreconditionerSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array2DScalarOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array2DSqrtSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void SetBroxMatrixSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ApplyBroxPreconditionerSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void SetBroxRedblackMatrixSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void LKLeastSquaresSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void Array3DOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ArrayScalarOpSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void SpmvCSRSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ScalarSqrtSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void ArraySqrtSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void HSMatrixPowersSetupLaunch(std::vector<EStmt*> & e, std::vector<Variable*> vars, std::map<std::string, Variable*> & symbolTable, std::map<std::string, Constant*> & constantTable, cl_vars_t clv, Stmt * stmt);
void setFunctionPointer(Stmt * stmt)
{
if(stmt->properties["name"] == "ArrayCopy")
{
stmt->setupLaunch = &ArrayCopySetupLaunch;
}
if(stmt->properties["name"] == "ArrayOp")
{
stmt->setupLaunch = &ArrayOpSetupLaunch;
}
if(stmt->properties["name"] == "SpmvDIA")
{
stmt->setupLaunch = &SpmvDIASetupLaunch;
}
if(stmt->properties["name"] == "ArraySum")
{
stmt->setupLaunch = &ArraySumSetupLaunch;
}
if(stmt->properties["name"] == "ScalarCopy")
{
stmt->setupLaunch = &ScalarCopySetupLaunch;
}
if(stmt->properties["name"] == "ScalarOp")
{
stmt->setupLaunch = &ScalarOpSetupLaunch;
}
if(stmt->properties["name"] == "ScalarArrayOp")
{
stmt->setupLaunch = &ScalarArrayOpSetupLaunch;
}
if(stmt->properties["name"] == "Return")
{
stmt->setupLaunch = &ReturnSetupLaunch;
}
if(stmt->properties["name"] == "SpmvDIA2D")
{
stmt->setupLaunch = &SpmvDIA2DSetupLaunch;
}
if(stmt->properties["name"] == "Array2DOp")
{
stmt->setupLaunch = &Array2DOpSetupLaunch;
}
if(stmt->properties["name"] == "Array2DCopy")
{
stmt->setupLaunch = &Array2DCopySetupLaunch;
}
if(stmt->properties["name"] == "ScalarArray2DOp")
{
stmt->setupLaunch = &ScalarArray2DOpSetupLaunch;
}
if(stmt->properties["name"] == "Stencil2DMVM")
{
stmt->setupLaunch = &Stencil2DMVMSetupLaunch;
}
if(stmt->properties["name"] == "Array2DSum")
{
stmt->setupLaunch = &Array2DSumSetupLaunch;
}
if(stmt->properties["name"] == "ExtractSnapshots")
{
stmt->setupLaunch = &ExtractSnapshotsSetupLaunch;
}
if(stmt->properties["name"] == "Array3DCopy")
{
stmt->setupLaunch = &Array3DCopySetupLaunch;
}
if(stmt->properties["name"] == "CgemmBatch")
{
stmt->setupLaunch = &CgemmBatchSetupLaunch;
}
if(stmt->properties["name"] == "ScalarArray3DOp")
{
stmt->setupLaunch = &ScalarArray3DOpSetupLaunch;
}
if(stmt->properties["name"] == "SolveBatch")
{
stmt->setupLaunch = &SolveBatchSetupLaunch;
}
if(stmt->properties["name"] == "GammaWeights")
{
stmt->setupLaunch = &GammaWeightsSetupLaunch;
}
if(stmt->properties["name"] == "InnerProducts")
{
stmt->setupLaunch = &InnerProductsSetupLaunch;
}
if(stmt->properties["name"] == "WarpImg2D")
{
stmt->setupLaunch = &WarpImg2DSetupLaunch;
}
if(stmt->properties["name"] == "RedArray2D")
{
stmt->setupLaunch = &RedArray2DSetupLaunch;
}
if(stmt->properties["name"] == "BlackArray2D")
{
stmt->setupLaunch = &BlackArray2DSetupLaunch;
}
if(stmt->properties["name"] == "ApplyHSPreconditioner")
{
stmt->setupLaunch = &ApplyHSPreconditionerSetupLaunch;
}
if(stmt->properties["name"] == "Array2DScalarOp")
{
stmt->setupLaunch = &Array2DScalarOpSetupLaunch;
}
if(stmt->properties["name"] == "Array2DSqrt")
{
stmt->setupLaunch = &Array2DSqrtSetupLaunch;
}
if(stmt->properties["name"] == "SetBroxMatrix")
{
stmt->setupLaunch = &SetBroxMatrixSetupLaunch;
}
if(stmt->properties["name"] == "ApplyBroxPreconditioner")
{
stmt->setupLaunch = &ApplyBroxPreconditionerSetupLaunch;
}
if(stmt->properties["name"] == "SetBroxRedblackMatrix")
{
stmt->setupLaunch = &SetBroxRedblackMatrixSetupLaunch;
}
if(stmt->properties["name"] == "LKLeastSquares")
{
stmt->setupLaunch = &LKLeastSquaresSetupLaunch;
}
if(stmt->properties["name"] == "Array3DOp")
{
stmt->setupLaunch = &Array3DOpSetupLaunch;
}
if(stmt->properties["name"] == "ArrayScalarOp")
{
stmt->setupLaunch = &ArrayScalarOpSetupLaunch;
}
if(stmt->properties["name"] == "SpmvCSR")
{
stmt->setupLaunch = &SpmvCSRSetupLaunch;
}
if(stmt->properties["name"] == "ScalarSqrt")
{
stmt->setupLaunch = &ScalarSqrtSetupLaunch;
}
if(stmt->properties["name"] == "ArraySqrt")
{
stmt->setupLaunch = &ArraySqrtSetupLaunch;
}
if(stmt->properties["name"] == "HSMatrixPowers")
{
stmt->setupLaunch = &HSMatrixPowersSetupLaunch;
}
}