QDP++
qdp_scalarsite_generic_cblas_wrapper.h
Go to the documentation of this file.
1#ifndef QDP_SCALARSITE_GENERIC_CBLAS_WRAPPER_H
2#define QDP_SCALARSITE_GENERIC_CBLAS_WRAPPER_H
3
5// Threading evaluates wrappers
6//
7// by Xu Guo, EPCC, 26 August, 2008
9
10//
11// vcscal
12//
13
14// structure for vcscal of having order
20
21// user func for vcscal of having order
22inline
24
25 REAL* Out = a->Out;
26 REAL* scalep = a->scalep;
27 REAL* In = a->In;
28
29 int n_3vec = hi - lo;
30 int index = lo * 24;
31 Out = &Out[index];
32 In = &In[index];
33 vcscal(Out, scalep, In, n_3vec);
34}
35
36// structure for vcscal of NOT having order
39 const OLattice< CTVec > &x_,
40 OLattice< CTVec >& d_,
41 REAL* scalep_,
42 const int* tab_) : x(x_), d(d_), scalep(scalep_), tab(tab_) {}
43
44 const OLattice< CTVec > &x;
45 OLattice< CTVec >& d;
47 const int* tab;
48};
49
50// user func for vcscal of NOT having order
51inline
53 const OLattice< CTVec > &x = a->x;
54 OLattice< CTVec >& d = a->d;
55 REAL* scalep = a->scalep;
56 const int* tab = a->tab;
57
58 for(int j=lo; j < hi; j++) {
59 int i=tab[j];
60 REAL *d_start = &(d.elem(i).elem(0).elem(0).real());
61 REAL *x_start = (REAL *) &(x.elem(i).elem(0).elem(0).real());
62 vcscal(d_start, scalep, x_start, 1);
63 }
64
65}
66
67
68
69
70//
71// vcaxpy3
72//
73
74// structure for vcaxpy3 of having order
81
82// user func for vcaxpy3 of having order
83inline
85
86 REAL* Out = a->Out;
87 REAL* scalep = a->scalep;
88 REAL* InScale = a->InScale;
89 REAL* Add = a->Add;
90
91 int n_3vec = hi - lo;
92 int index = lo * 24;
93 Out = &Out[index];
94 InScale = &InScale[index];
95 Add = &Add[index];
96 vcaxpy3(Out, scalep, InScale, Add, n_3vec);
97}
98
99// structure for vcaxpy3 of NOT having order (with y pointer only)
102 const OLattice< CTVec > &x_,
103 OLattice< CTVec >& d_,
104 REAL* scalep_,
105 const int* tab_) : x(x_), d(d_), scalep(scalep_), tab(tab_) {}
106
107 const OLattice< CTVec > &x;
108 OLattice< CTVec >& d;
110 const int* tab;
111};
112
113// user func for vcaxpy3 of NOT having order (with y pointer only)
114inline
116 const OLattice< CTVec > &x = a->x;
117 OLattice< CTVec >& d = a->d;
118 REAL* scalep = a->scalep;
119 const int* tab = a->tab;
120
121 for(int j=lo; j < hi; j++) {
122 int i=tab[j];
123
124 REAL* xptr = (REAL *)&(x.elem(i).elem(0).elem(0).real());
125 REAL* yptr = &(d.elem(i).elem(0).elem(0).real());
126
127 vcaxpy3(yptr, scalep, xptr, yptr, 1);
128
129 }
130
131}
132
133// structure for vcaxpy3 of NOT having order (with z pointer)
136 const OLattice< CTVec > &x_,
137 const OLattice< CTVec >& y_,
138 OLattice< CTVec >& d_,
139 REAL* scalep_,
140 const int* tab_) : x(x_), y(y_), d(d_), scalep(scalep_), tab(tab_) {}
141
142 const OLattice< CTVec > &x;
143 const OLattice< CTVec >& y;
144 OLattice< CTVec >& d;
146 const int* tab;
147};
148
149// user func for vcaxpy3 of NOT having order (with z pointer)
150inline
152 const OLattice< CTVec > &x = a->x;
153 const OLattice< CTVec >& y = a->y;
154 OLattice< CTVec >& d = a->d;
155 REAL* scalep = a->scalep;
156 const int* tab = a->tab;
157
158 for(int j=lo; j < hi; j++) {
159 int i=tab[j];
160
161 REAL *xptr = (REAL *) &(x.elem(i).elem(0).elem(0).real());
162 REAL *yptr = (REAL *) &(y.elem(i).elem(0).elem(0).real());
163 REAL *zptr = &(d.elem(i).elem(0).elem(0).real());
164
165 // Get the no of 3vecs. s.start() and s.end() are inclusive so add +1
166 vcaxpy3(zptr, scalep, xptr, yptr, 1);
167 }
168
169}
170
171
172
173
174
175//
176// vcaxmy3
177//
178
179// structure for vcaxmy3 of having order
186
187// user func for vcaxmy3 of having order
188inline
190
191 REAL* Out = a->Out;
192 REAL* scalep = a->scalep;
193 REAL* InScale = a->InScale;
194 REAL* Sub = a->Sub;
195
196 int n_3vec = hi - lo;
197 int index = lo * 24;
198 Out = &Out[index];
199 InScale = &InScale[index];
200 Sub = &Sub[index];
201 vcaxmy3(Out, scalep, InScale, Sub, n_3vec);
202}
203
204// structure for vcaxmy3 of NOT having order
207 const OLattice< CTVec > &x_,
208 const OLattice< CTVec >& y_,
209 OLattice< CTVec >& d_,
210 REAL* scalep_,
211 const int* tab_) : x(x_),y(y_),d(d_),scalep(scalep_), tab(tab_) {}
212
213 const OLattice< CTVec > &x;
214 const OLattice< CTVec >& y;
215 OLattice< CTVec >& d;
217 const int* tab;
218};
219
220// user func for vcaxmy3 of NOT having order
221inline
223 const OLattice< CTVec > &x = a->x;
224 const OLattice< CTVec >& y = a->y;
225 OLattice< CTVec >& d = a->d;
226 REAL* scalep = a->scalep;
227 const int* tab = a->tab;
228
229 for(int j=lo; j < hi; j++) {
230 int i=tab[j];
231
232 REAL *xptr = (REAL *) &(x.elem(i).elem(0).elem(0).real());
233 REAL *yptr = (REAL *) &(y.elem(i).elem(0).elem(0).real());
234 REAL *zptr = &(d.elem(i).elem(0).elem(0).real());
235
236 // Get the no of 3vecs. s.start() and s.end() are inclusive so add +1
237 vcaxmy3(zptr, scalep, xptr, yptr, 1);
238 }
239
240}
241
242
243
244//
245// vcaxpby3
246//
247
248// structure for vcaxpby3 of having order
256
257// user func for vcaxpby3 of having order
258inline
260
261 REAL* Out = a->Out;
262 REAL* ap = a->ap;
263 REAL* xp = a->xp;
264 REAL* bp = a->bp;
265 REAL* yp = a->yp;
266
267 int n_3vec = hi - lo;
268 int index = lo * 24;
269 Out = &Out[index];
270 xp = &xp[index];
271 yp = &yp[index];
272 vcaxpby3(Out, ap, xp, bp, yp, n_3vec);
273}
274
275// structure for vcaxpby3 of NOT having order
278 const OLattice< CTVec > &x_,
279 const OLattice< CTVec >& y_,
280 OLattice< CTVec >& d_,
281 REAL* aptr_,
282 REAL* bptr_,
283 const int* tab_) : x(x_), y(y_),d(d_),aptr(aptr_), bptr(bptr_), tab(tab_) {}
284
285 const OLattice< CTVec > &x;
286 const OLattice< CTVec >& y;
287 OLattice< CTVec >& d;
290 const int* tab;
291};
292
293// user func for vcaxpby3 of NOT having order
294inline
296 const OLattice< CTVec > &x = a->x;
297 const OLattice< CTVec >& y = a->y;
298 OLattice< CTVec >& d = a->d;
299 REAL* aptr = a->aptr;
300 REAL* bptr = a->bptr;
301 const int* tab = a->tab;
302
303 for(int j=lo; j < hi; j++) {
304 int i=tab[j];
305
306 REAL *xptr = (REAL *) &(x.elem(i).elem(0).elem(0).real());
307 REAL *yptr = (REAL *) &(y.elem(i).elem(0).elem(0).real());
308 REAL *zptr = &(d.elem(i).elem(0).elem(0).real());
309
310 // Get the no of 3vecs. s.start() and s.end() are inclusive so add +1
311 vcaxpby3(zptr, aptr, xptr, bptr, yptr, 1);
312 }
313
314}
315
316
317
318//
319// vcaxmby3
320//
321
322// structure for vcaxmby3 of having order
330
331// user func for vcaxmby3 of having order
332inline
334
335 REAL* Out = a->Out;
336 REAL* ap = a->ap;
337 REAL* xp = a->xp;
338 REAL* bp = a->bp;
339 REAL* yp = a->yp;
340
341 int n_3vec = hi - lo;
342 int index = lo * 24;
343 Out = &Out[index];
344 xp = &xp[index];
345 yp = &yp[index];
346 vcaxmby3(Out, ap, xp, bp, yp, n_3vec);
347}
348
349// structure for vcaxmby3 of NOT having order
352 const OLattice< CTVec > &x_,
353 const OLattice< CTVec >& y_,
354 OLattice< CTVec >& d_,
355 REAL* aptr_,
356 REAL* bptr_,
357 const int* tab_): x(x_),y(y_),d(d_),aptr(aptr_),bptr(bptr_),tab(tab_) {}
358
359 const OLattice< CTVec > &x;
360 const OLattice< CTVec >& y;
361 OLattice< CTVec >& d;
364 const int* tab;
365};
366
367// user func for vcaxmby3 of NOT having order
368inline
370 const OLattice< CTVec > &x = a->x;
371 const OLattice< CTVec >& y = a->y;
372 OLattice< CTVec >& d = a->d;
373 REAL* aptr = a->aptr;
374 REAL* bptr = a->bptr;
375 const int* tab = a->tab;
376
377 for(int j=lo; j < hi; j++) {
378 int i=tab[j];
379
380 REAL *xptr = (REAL *) &(x.elem(i).elem(0).elem(0).real());
381 REAL *yptr = (REAL *) &(y.elem(i).elem(0).elem(0).real());
382 REAL *zptr = &(d.elem(i).elem(0).elem(0).real());
383
384 // Get the no of 3vecs. s.start() and s.end() are inclusive so add +1
385 vcaxmby3(zptr, aptr, xptr, bptr, yptr, 1);
386 }
387
388}
389
390
391
392#endif
MakeReturn< UnaryNode< FnReal, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnReal >::Type_t >::Expression_t real(const QDPExpr< T1, C1 > &l)
REAL32 REAL
void ordered_vcaxpby3_evaluate_function(int lo, int hi, int myId, ordered_vcaxpby3_user_arg *a)
void ordered_vcaxpy3_evaluate_function(int lo, int hi, int myId, ordered_vcaxpy3_user_arg *a)
void ordered_vcaxmy3_evaluate_function(int lo, int hi, int myId, ordered_vcaxmy3_user_arg *a)
void unordered_vcaxmby3_evaluate_function(int lo, int hi, int myId, unordered_vcaxmby3_user_arg *a)
void unordered_vcaxpy3_y_evaluate_function(int lo, int hi, int myId, unordered_vcaxpy3_y_user_arg *a)
void unordered_vcaxpy3_z_evaluate_function(int lo, int hi, int myId, unordered_vcaxpy3_z_user_arg *a)
void ordered_vcaxmby3_evaluate_function(int lo, int hi, int myId, ordered_vcaxmby3_user_arg *a)
void unordered_vcaxmy3_evaluate_function(int lo, int hi, int myId, unordered_vcaxmy3_user_arg *a)
void ordered_vcscal_evaluate_function(int lo, int hi, int myId, ordered_vcscal_user_arg *a)
void unordered_vcscal_evaluate_function(int lo, int hi, int myId, unordered_vcscal_user_arg *a)
void unordered_vcaxpby3_evaluate_function(int lo, int hi, int myId, unordered_vcaxpby3_user_arg *a)
unordered_vcaxmby3_user_arg(const OLattice< CTVec > &x_, const OLattice< CTVec > &y_, OLattice< CTVec > &d_, REAL *aptr_, REAL *bptr_, const int *tab_)
unordered_vcaxmy3_user_arg(const OLattice< CTVec > &x_, const OLattice< CTVec > &y_, OLattice< CTVec > &d_, REAL *scalep_, const int *tab_)
unordered_vcaxpby3_user_arg(const OLattice< CTVec > &x_, const OLattice< CTVec > &y_, OLattice< CTVec > &d_, REAL *aptr_, REAL *bptr_, const int *tab_)
unordered_vcaxpy3_y_user_arg(const OLattice< CTVec > &x_, OLattice< CTVec > &d_, REAL *scalep_, const int *tab_)
unordered_vcaxpy3_z_user_arg(const OLattice< CTVec > &x_, const OLattice< CTVec > &y_, OLattice< CTVec > &d_, REAL *scalep_, const int *tab_)
unordered_vcscal_user_arg(const OLattice< CTVec > &x_, OLattice< CTVec > &d_, REAL *scalep_, const int *tab_)