QDP++
qdp_sse_fused_spin_proj_evaluates.h
Go to the documentation of this file.
1#ifndef QDP_SSE_FUSED_SPIN_PROJ_H
2#define QDP_SSE_FUSED_SPIN_PROJ_H
4#include "sse_mult_adj_su3_mat_hwvec.h"
5
6/* Evaluates for things like adj(u)*spinProjectDir0Plus(y) */
7using namespace QDP;
8namespace QDP {
9
11
14// Threading evaluates
15//
16// by Xu Guo, EPCC, 20 October, 2008
18
19// the wrappers for the functions to be threaded
21
22
23// HalfVec = adj(u)*SpinProjectDir0Plus(Vec);
24template<>
25inline
27 const OpAssign& op,
28 const QDPExpr<
31
34
37 >,
39 >&rhs,
40 const Subset& s)
41{
42 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
43 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
44
45 if( s.hasOrderedRep() ) {
46
47 int totalSize = s.end() - s.start() +1;
48
50
54 // Original code
56 /*
57 for(int site = s.start() ; site <= s.end(); site++) {
58 HVec32 tmp ;
59 inlineSpinProjDir0Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
60 (REAL32 *)&(tmp.elem(0).elem(0).real()),
61 1);
63 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
64 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
65 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
66
67 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
68 }*/
69 }
70 else {
71 const int* tab = s.siteTable().slice();
72
73 int totalSize = s.numSiteTable();
74
76
78
80 // Original code
82 /*
83 for(int j=0; j < s.numSiteTable(); j++) {
84 int site=tab[j];
85 HVec32 tmp ;
86 inlineSpinProjDir0Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
87 (REAL32 *)&(tmp.elem(0).elem(0).real()),
88 1);
89
90 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
91 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
92 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
93
94 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
95
96 }*/
97 }
98
99}
100
101// HalfVec = adj(u)*SpinProjectDir0Minus(Vec);
102template<>
103inline
105 const OpAssign& op,
106 const QDPExpr<
107 BinaryNode<
109
112
115 >,
117 >&rhs,
118 const Subset& s)
119{
120 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
121 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
122
123 if( s.hasOrderedRep() ) {
124
125 int totalSize = s.end() - s.start() +1;
126
128
130
132 // Original code
134 /*
135 for(int site = s.start() ; site <= s.end(); site++) {
136 HVec32 tmp ;
137 inlineSpinProjDir0Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
138 (REAL32 *)&(tmp.elem(0).elem(0).real()),
139 1);
140
141 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
142 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
143 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
144 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
145
146 }*/
147 }
148 else {
149 const int* tab = s.siteTable().slice();
150
151 int totalSize = s.numSiteTable();
152
154
156
158 // Original code
160 /*
161 for(int j=0; j < s.numSiteTable(); j++) {
162 int site=tab[j];
163
164 HVec32 tmp ;
165 inlineSpinProjDir0Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
166 (REAL32 *)&(tmp.elem(0).elem(0).real()),
167 1);
168
169 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
170 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
171 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
172 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
173
174 }*/
175 }
176
177}
178
179// HalfVec = adj(u)*SpinProjectDir1Plus(Vec);
180template<>
181inline
183 const OpAssign& op,
184 const QDPExpr<
185 BinaryNode<
187
190
193 >,
195 >&rhs,
196 const Subset& s)
197{
198 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
199 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
200
201
202 if( s.hasOrderedRep() ) {
203
204 int totalSize = s.end() - s.start() +1;
205
207
209
211 // Original code
213 /*
214 for(int site = s.start() ; site <= s.end(); site++) {
215 HVec32 tmp ;
216 inlineSpinProjDir1Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
217 (REAL32 *)&(tmp.elem(0).elem(0).real()),
218 1);
219
220 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
221 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
222 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
223 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
224
225
226 }*/
227 }
228 else {
229
230 const int* tab = s.siteTable().slice();
231
232 int totalSize = s.numSiteTable();
233
235
237
239 // Original code
241 /*
242 for(int j=0; j < s.numSiteTable(); j++) {
243 int site=tab[j];
244
245 HVec32 tmp ;
246 inlineSpinProjDir1Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
247 (REAL32 *)&(tmp.elem(0).elem(0).real()),
248 1);
249
250 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
251 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
252 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
253 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
254
255 }*/
256 }
257}
258
259// HalfVec = adj(u)*SpinProjectDir1Minus(Vec);
260template<>
261inline
263 const OpAssign& op,
264 const QDPExpr<
265 BinaryNode<
267
270
273 >,
275 >&rhs,
276 const Subset& s)
277{
278 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
279 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
280
281 if( s.hasOrderedRep() ) {
282
283 int totalSize = s.end() - s.start() +1;
284
286
288
290 // Original code
292 /*
293 for(int site = s.start() ; site <= s.end(); site++) {
294 HVec32 tmp ;
295 inlineSpinProjDir1Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
296 (REAL32 *)&(tmp.elem(0).elem(0).real()),
297 1);
298
299 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
300 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
301 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
302 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
303
304 }*/
305 }
306 else {
307
308 const int* tab = s.siteTable().slice();
309
310 int totalSize = s.numSiteTable();
311
313
315
317 // Original code
319 /*
320 for(int j=0; j < s.numSiteTable(); j++) {
321 int site=tab[j];
322
323 HVec32 tmp ;
324 inlineSpinProjDir1Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
325 (REAL32 *)&(tmp.elem(0).elem(0).real()),
326 1);
327
328 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
329 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
330 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
331 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
332
333 }*/
334 }
335}
336
337
338// HalfVec = adj(u)*SpinProjectDir2Plus(Vec);
339template<>
340inline
342 const OpAssign& op,
343 const QDPExpr<
344 BinaryNode<
346
349
352 >,
354 >&rhs,
355 const Subset& s)
356{
357 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
358 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
359
360 if( s.hasOrderedRep() ) {
361
362 int totalSize = s.end() - s.start() +1;
363
365
367
369 // Original code
371 /*
372 for(int site = s.start() ; site <= s.end(); site++) {
373 HVec32 tmp ;
374 inlineSpinProjDir2Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
375 (REAL32 *)&(tmp.elem(0).elem(0).real()),
376 1);
377 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
378 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
379 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
380 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
381
382 }*/
383 }
384 else {
385 const int* tab = s.siteTable().slice();
386
387 int totalSize = s.numSiteTable();
388
390
392
394 // Original code
396 /*
397 for(int j=0; j < s.numSiteTable(); j++) {
398 int site=tab[j];
399 HVec32 tmp ;
400 inlineSpinProjDir2Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
401 (REAL32 *)&(tmp.elem(0).elem(0).real()),
402 1);
403
404 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
405 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
406 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
407 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
408
409 }*/
410 }
411}
412
413// HalfVec = adj(u)*SpinProjectDir2Minus(Vec);
414template<>
415inline
417 const OpAssign& op,
418 const QDPExpr<
419 BinaryNode<
421
424
427 >,
429 >&rhs,
430 const Subset& s)
431{
432 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
433 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
434
435 if( s.hasOrderedRep() ) {
436
437 int totalSize = s.end() - s.start() +1;
438
440
442
444 // Original code
446 /*
447 for(int site = s.start() ; site <= s.end(); site++) {
448 HVec32 tmp ;
449 inlineSpinProjDir2Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
450 (REAL32 *)&(tmp.elem(0).elem(0).real()),
451 1);
452 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
453 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
454 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
455 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
456
457
458 }*/
459 }
460 else {
461
462 const int* tab = s.siteTable().slice();
463
464 int totalSize = s.numSiteTable();
465
467
469
471 // Original code
473 /*
474 for(int j=0; j < s.numSiteTable(); j++) {
475 int site=tab[j];
476
477 HVec32 tmp ;
478 inlineSpinProjDir2Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
479 (REAL32 *)&(tmp.elem(0).elem(0).real()),
480 1);
481
482
483 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
484 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
485 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
486 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
487
488
489 }*/
490 }
491}
492
493// HalfVec = adj(u)*SpinProjectDir3Plus(Vec);
494template<>
495inline
497 const OpAssign& op,
498 const QDPExpr<
499 BinaryNode<
501
504
507 >,
509 >&rhs,
510 const Subset& s)
511{
512 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
513 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
514
515 if( s.hasOrderedRep() ) {
516
517 int totalSize = s.end() - s.start() +1;
518
520
522
524 // Original code
526 /*
527 for(int site = s.start() ; site <= s.end(); site++) {
528 HVec32 tmp ;
529 inlineSpinProjDir3Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
530 (REAL32 *)&(tmp.elem(0).elem(0).real()),
531 1);
532 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
533 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
534 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
535 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
536
537
538 }*/
539 }
540 else {
541
542 const int* tab = s.siteTable().slice();
543
544 int totalSize = s.numSiteTable();
545
547
549
551 // Original code
553 /*
554 for(int j=0; j < s.numSiteTable(); j++) {
555 int site=tab[j];
556 HVec32 tmp ;
557 inlineSpinProjDir3Plus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
558 (REAL32 *)&(tmp.elem(0).elem(0).real()),
559 1);
560
561 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
562 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
563 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
564 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
565
566
567 }*/
568 }
569}
570
571// HalfVec = adj(u)*SpinProjectDir3Minus(Vec);
572template<>
573inline
575 const OpAssign& op,
576 const QDPExpr<
577 BinaryNode<
579
582
585 >,
587 >&rhs,
588 const Subset& s)
589{
590 const OLattice< SU3Mat32 >& u = static_cast< const OLattice< SU3Mat32 >& >(rhs.expression().left().child());
591 const OLattice< FVec32 >& a = static_cast< const OLattice< FVec32 >& >(rhs.expression().right().child());
592
593
594 if( s.hasOrderedRep() ) {
595
596 int totalSize = s.end() - s.start() +1;
597
599
601
603 // Original code
605 /*
606 for(int site = s.start() ; site <= s.end(); site++) {
607 HVec32 tmp ;
608 inlineSpinProjDir3Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
609 (REAL32 *)&(tmp.elem(0).elem(0).real()),
610 1);
611
612 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
613 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
614 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
615 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
616
617
618 }*/
619 }
620 else {
621
622 const int* tab = s.siteTable().slice();
623
624 int totalSize = s.numSiteTable();
625
627
629
631 // Original code
633 /*
634 for(int j=0; j < s.numSiteTable(); j++) {
635 int site=tab[j];
636
637 HVec32 tmp ;
638 inlineSpinProjDir3Minus( (REAL32 *)&(a.elem(site).elem(0).elem(0).real()),
639 (REAL32 *)&(tmp.elem(0).elem(0).real()),
640 1);
641
642 su3_matrixf* um = (su3_matrixf *)&(u.elem(site).elem().elem(0,0).real());
643 half_wilson_vectorf *tmph = (half_wilson_vectorf *)&( tmp.elem(0).elem(0).real());
644 half_wilson_vectorf *dh = (half_wilson_vectorf *)&( d.elem(site).elem(0).elem(0).real());
645 intrin_sse_mult_adj_su3_mat_hwvec(um, tmph, dh);
646
647 }*/
648 }
649
650}
651
652} // namespace QDP;
653
654#endif
Outer grid Lattice type.
Definition qdp_outer.h:264
Primitive Scalar.
Expression class for QDP.
Definition qdp_qdpexpr.h:16
QDPType - major type class/container for all QDP objects.
Definition qdp_qdptype.h:29
Subsets - controls how lattices are looped.
Definition qdp_subset.h:39
int end() const
Definition qdp_subset.h:81
const multi1d< int > & siteTable() const
Definition qdp_subset.h:83
int numSiteTable() const
Definition qdp_subset.h:84
bool hasOrderedRep() const
Definition qdp_subset.h:79
int start() const
Definition qdp_subset.h:80
const T * slice() const
Return ref to a column slice.
Definition qdp_multi.h:225
void evaluate(OLattice< DCol > &d, const OpAssign &op, const QDPExpr< BinaryNode< OpMultiply, Reference< QDPType< DCol, OLattice< DCol > > >, Reference< QDPType< DCol, OLattice< DCol > > > >, OLattice< DCol > > &rhs, const Subset &s)
Yet another random number generator.
void dispatch_to_threads(int numSiteTable, Arg a, void(*func)(int, int, int, Arg *))
PSpinVector< PColorVector< RComplex< REAL32 >, 3 >, 4 > FVec32
void ordered_sse_fused_spin_proj_evaluate_function(int lo, int hi, int myId, ordered_sse_fused_spin_proj_user_arg *arg)
void inlineSpinProjDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_0).
void unordered_sse_fused_spin_proj_evaluate_function(int lo, int hi, int myId, unordered_sse_fused_spin_proj_user_arg *arg)
void inlineSpinProjDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_0).
PScalar< PColorMatrix< RComplex< REAL32 >, 3 > > SU3Mat32
void inlineSpinProjDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_1).
void inlineSpinProjDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_1).
void inlineSpinProjDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_3).
void inlineSpinProjDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_3).
void inlineSpinProjDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_2).
void inlineSpinProjDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_2).