QDP++
qdp_sse_spin_evaluates.h
Go to the documentation of this file.
1#ifndef QDP_SSE_SPIN_EVALUATES_H
2#define QDP_SSE_SPIN_EVALUATES_H
4using namespace QDP;
5namespace QDP {
6
7// Typedefs
10
11// Four spinor (Ns * Nc * Ncomplex ) Ncomplex fastest
12typedef REAL32 SpinColFull[4][3][2];
13
14// Half spinor (Ns/2 * Nc * Ncomplex ) Ncomplex fastest
15typedef REAL32 SpinColHalf[2][3][2];
16// d = SpinProjectDir0Plus(Vec);
19// Threading evaluates
20//
21// by Xu Guo, EPCC, 13 October, 2008
22
23
24// the wrappers for the functions to be threaded
27
28
29template<class A, class B>
30inline
32 const OpAssign& op,
33 const QDPExpr<
36 OLattice< HVec32 > > &rhs,
37 const Subset& s)
38{
39
40 // Get at pointer for 4 vec
41 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
43 if( s.hasOrderedRep() ) {
45 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
46 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
47
48 int total_n_vec = s.end() - s.start() +1;
49
53
55 // Original code
57 //unsigned int n_vec=s.end() - s.start()+1;
58
59 //inlineSpinProjDir0Plus(aptr, bptr, n_vec);
60 }
61 else {
62 const int* tab = s.siteTable().slice();
63
64 int totalSize = s.numSiteTable();
65
67
69
71 // Original code
73 /*
74 for(int j=0; j < s.numSiteTable(); j++) {
75 int i = tab[j];
76 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
77 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
78
79 inlineSpinProjDir0Plus(aptr, bptr, 1);
80
81 }*/
82 }
83
84}
85
86// d = SpinProjectDir1Plus(Vec);
87template<class A, class B>
88inline
90 const OpAssign& op,
91 const QDPExpr<
94 OLattice< HVec32 > > &rhs,
95 const Subset& s)
96{
97
98
99 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
100
101 if( s.hasOrderedRep() ) {
102 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
103 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
104
105 int total_n_vec = s.end() - s.start() +1;
106
108
110
112 // Original code
114 //unsigned int n_vec=s.end() - s.start()+1;
115 //inlineSpinProjDir1Plus(aptr, bptr, n_vec);
116 }
117 else {
118 const int* tab = s.siteTable().slice();
119
120 int totalSize = s.numSiteTable();
121
123
125
127 // Original code
129 /*
130 for(int j=0; j < s.numSiteTable(); j++) {
131 int i = tab[j];
132 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
133 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
134 inlineSpinProjDir1Plus(aptr, bptr, 1);
135 }*/
136 }
137
138}
139
140// d = SpinProjectDir2Plus(Vec);
141template<class A, class B>
142inline
144 const OpAssign& op,
145 const QDPExpr<
148 OLattice< HVec32 > > &rhs,
149 const Subset& s)
150{
151
152 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
153
154 if( s.hasOrderedRep() ) {
155 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
156 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
157
158 int total_n_vec = s.end() - s.start() +1;
159
161
163
165 // Original code
167 //unsigned int n_vec=s.end() - s.start()+1;
168 //inlineSpinProjDir2Plus(aptr, bptr, n_vec);
169 }
170 else {
171 const int* tab = s.siteTable().slice();
172
173 int totalSize = s.numSiteTable();
174
176
178
180 // Original code
182 /*
183 for(int j=0; j < s.numSiteTable(); j++) {
184 int i = tab[j];
185 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
186 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
187 inlineSpinProjDir2Plus(aptr, bptr, 1);
188 }*/
189 }
190
191}
192
193// d = SpinProjectDir3Plus(Vec);
194template<class A, class B>
195inline
197 const OpAssign& op,
198 const QDPExpr<
201 OLattice< HVec32 > > &rhs,
202 const Subset& s)
203{
204 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
205
206 if( s.hasOrderedRep() ) {
207 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
208 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
209
210 int total_n_vec = s.end() - s.start() +1;
211
213
215
217 // Original code
219 //unsigned int n_vec=s.end() - s.start()+1;
220 //inlineSpinProjDir3Plus(aptr, bptr, n_vec);
221 }
222 else {
223 const int* tab = s.siteTable().slice();
224
225 int totalSize = s.numSiteTable();
226
228
230
232 // Original code
234 /*
235 for(int j=0; j < s.numSiteTable(); j++) {
236 int i = tab[j];
237 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
238 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
239 inlineSpinProjDir3Plus(aptr, bptr, 1);
240 }*/
241 }
242}
243
244// d = SpinProjectDir0Minus(Vec);
245template<class A, class B>
246inline
248 const OpAssign& op,
249 const QDPExpr<
252 OLattice< HVec32 > > &rhs,
253 const Subset& s)
254{
255
256 // Get at pointer for 4 vec
257 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
258 if( s.hasOrderedRep() ) {
259 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
260 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
261
262 int total_n_vec = s.end() - s.start() +1;
263
265
267
269 // Original code
271 //unsigned int n_vec=s.end() - s.start()+1;
272 //inlineSpinProjDir0Minus(aptr, bptr, n_vec);
273 }
274 else {
275 const int* tab = s.siteTable().slice();
276
277 int totalSize = s.numSiteTable();
278
280
282
284 // Original code
286 /*
287 for(int j=0; j < s.numSiteTable(); j++) {
288 int i = tab[j];
289 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
290 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
291
292 inlineSpinProjDir0Minus(aptr, bptr, 1);
293 }*/
294 }
295}
296
297// d = SpinProjectDir1Minus(Vec);
298template<class A, class B>
299inline
301 const OpAssign& op,
302 const QDPExpr<
305 OLattice< HVec32 > > &rhs,
306 const Subset& s)
307{
308
309 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
310
311 if(s.hasOrderedRep() ) {
312 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
313 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
314
315 int total_n_vec = s.end() - s.start() +1;
316
318
320
322 // Original code
324 //unsigned int n_vec=s.end() - s.start()+1;
325 //inlineSpinProjDir1Minus(aptr, bptr, n_vec);
326 }
327 else {
328 const int* tab = s.siteTable().slice();
329
330 int totalSize = s.numSiteTable();
331
333
335
337 // Original code
339 /*
340 for(int j=0; j < s.numSiteTable(); j++) {
341 int i = tab[j];
342 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
343 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
344 inlineSpinProjDir1Minus(aptr, bptr, 1);
345 }*/
346 }
347}
348
349// d = SpinProjectDir2Minus(Vec);
350template<class A, class B>
351inline
353 const OpAssign& op,
354 const QDPExpr<
357 OLattice< HVec32 > > &rhs,
358 const Subset& s)
359{
360
361
362 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
363
364 if( s.hasOrderedRep() ) {
365 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
366 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
367
368 int total_n_vec = s.end() - s.start() +1;
369
371
373
375 // Original code
377 //unsigned int n_vec=s.end() - s.start()+1;
378 //inlineSpinProjDir2Minus(aptr, bptr, n_vec);
379 }
380 else {
381 const int* tab = s.siteTable().slice();
382
383 int totalSize = s.numSiteTable();
384
386
388
390 // Original code
392 /*
393 for(int j=0; j < s.numSiteTable(); j++) {
394 int i = tab[j];
395 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
396 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
397 inlineSpinProjDir2Minus(aptr, bptr, 1);
398 }*/
399 }
400
401}
402
403// d = SpinProjectDir3Minus(Vec);
404template<class A, class B>
405inline
407 const OpAssign& op,
408 const QDPExpr<
411 OLattice< HVec32 > > &rhs,
412 const Subset& s)
413{
414 const OLattice< FVec32 >& a = static_cast<const OLattice< FVec32 > &>(rhs.expression().child());
415
416 if(s.hasOrderedRep()) {
417 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
418 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
419
420 int total_n_vec = s.end() - s.start() +1;
421
423
425
427 // Original code
429 //unsigned int n_vec=s.end() - s.start()+1;
430 //inlineSpinProjDir3Minus(aptr, bptr, n_vec);
431 }
432 else {
433 const int* tab = s.siteTable().slice();
434
435 int totalSize = s.numSiteTable();
436
438
440
442 // Original code
444 /*
445 for(int j=0; j < s.numSiteTable(); j++) {
446 int i = tab[j];
447 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
448 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
449 inlineSpinProjDir3Minus(aptr, bptr, 1);
450 }*/
451 }
452
453}
454
455
456
457
458// d = SpinReconstructDir0Plus(Vec);
459template<class A, class B>
460inline
462 const OpAssign& op,
463 const QDPExpr<
466 OLattice< FVec32 > > &rhs,
467 const Subset& s)
468{
469
470 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
471
472 if( s.hasOrderedRep() ) {
473 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
474 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
475
476 int total_n_vec = s.end() - s.start() +1;
477
479
481
483 // Original code
485 //unsigned int n_vec=s.end() - s.start()+1;
486 //inlineSpinReconDir0Plus(aptr, bptr, n_vec);
487 }
488 else {
489 const int* tab = s.siteTable().slice();
490
491 int totalSize = s.numSiteTable();
492
494
496
498 // Original code
500 /*
501 for(int j=0; j < s.numSiteTable(); j++) {
502 int i = tab[j];
503 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
504 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
505 inlineSpinReconDir0Plus(aptr, bptr, 1);
506 }*/
507 }
508
509
510}
511
512// d = SpinReconstructDir1Plus(Vec);
513template<class A, class B>
514inline
516 const OpAssign& op,
517 const QDPExpr<
520 OLattice< FVec32 > > &rhs,
521 const Subset& s)
522{
523
524 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
525
526 if( s.hasOrderedRep() ) {
527 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
528 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
529
530 int total_n_vec = s.end() - s.start() +1;
531
533
535
537 // Original code
539 //unsigned int n_vec=s.end() - s.start()+1;
540 //inlineSpinReconDir1Plus(aptr, bptr, n_vec);
541 }
542 else {
543 const int* tab = s.siteTable().slice();
544
545 int totalSize = s.numSiteTable();
546
548
550
552 // Original code
554 /*
555 for(int j=0; j < s.numSiteTable(); j++) {
556 int i = tab[j];
557 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
558 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
559 inlineSpinReconDir1Plus(aptr, bptr, 1);
560 }*/
561 }
562
563
564}
565
566// d = SpinReconstructDir2Plus(Vec);
567template<class A, class B>
568inline
570 const OpAssign& op,
571 const QDPExpr<
574 OLattice< FVec32 > > &rhs,
575 const Subset& s)
576{
577
578
579 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
580
581 if( s.hasOrderedRep()) {
582 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
583 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
584
585 int total_n_vec = s.end() - s.start() +1;
586
588
590
592 // Original code
594 //unsigned int n_vec=s.end() - s.start()+1;
595 //inlineSpinReconDir2Plus(aptr, bptr, n_vec);
596 }
597 else {
598 const int* tab = s.siteTable().slice();
599
600 int totalSize = s.numSiteTable();
601
603
605
607 // Original code
609 /*
610 for(int j=0; j < s.numSiteTable(); j++) {
611 int i = tab[j];
612 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
613 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
614 inlineSpinReconDir2Plus(aptr, bptr, 1);
615 }*/
616 }
617
618}
619
620// d = SpinReconstructDir3Plus(Vec);
621template<class A, class B>
622inline
624 const OpAssign& op,
625 const QDPExpr<
628 OLattice< FVec32 > > &rhs,
629 const Subset& s)
630{
631
632 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
633
634 if( s.hasOrderedRep() ) {
635 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
636 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
637
638 int total_n_vec = s.end() - s.start() +1;
639
641
643
645 // Original code
647 //unsigned int n_vec=s.end() - s.start()+1;
648 //inlineSpinReconDir3Plus(aptr, bptr, n_vec);
649 }
650 else {
651 const int* tab = s.siteTable().slice();
652
653 int totalSize = s.numSiteTable();
654
656
658
660 // Original code
662 /*
663 for(int j=0; j < s.numSiteTable(); j++) {
664 int i = tab[j];
665 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
666 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
667 inlineSpinReconDir3Plus(aptr, bptr, 1);
668 }*/
669 }
670
671}
672
673// d = SpinReconstructDir0Minus(Vec);
674template<class A, class B>
675inline
677 const OpAssign& op,
678 const QDPExpr<
681 OLattice< FVec32 > > &rhs,
682 const Subset& s)
683{
684
685 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
686
687 if( s.hasOrderedRep() ) {
688 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
689 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
690
691 int total_n_vec = s.end() - s.start() +1;
692
694
696
698 // Original code
700 //unsigned int n_vec=s.end() - s.start()+1;
701 //inlineSpinReconDir0Minus(aptr, bptr, n_vec);
702 }
703 else {
704 const int* tab = s.siteTable().slice();
705
706 int totalSize = s.numSiteTable();
707
709
711
713 // Original code
715 /*
716 for(int j=0; j < s.numSiteTable(); j++) {
717 int i = tab[j];
718 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
719 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
720 inlineSpinReconDir0Minus(aptr, bptr, 1);
721 }*/
722 }
723
724
725}
726
727// d = SpinReconstructDir1Minus(Vec);
728template<class A, class B>
729inline
731 const OpAssign& op,
732 const QDPExpr<
735 OLattice< FVec32 > > &rhs,
736 const Subset& s)
737{
738
739 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
740
741 if( s.hasOrderedRep() ) {
742 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
743 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
744
745 int total_n_vec = s.end() - s.start() +1;
746
748
750
752 // Original code
754 //unsigned int n_vec=s.end() - s.start()+1;
755 //inlineSpinReconDir1Minus(aptr, bptr, n_vec);
756 }
757 else {
758 const int* tab = s.siteTable().slice();
759
760 int totalSize = s.numSiteTable();
761
763
765
767 // Original code
769 /*
770 for(int j=0; j < s.numSiteTable(); j++) {
771 int i = tab[j];
772 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
773 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
774 inlineSpinReconDir1Minus(aptr, bptr, 1);
775 }*/
776 }
777
778}
779
780// d = SpinReconstructDir2Minus(Vec);
781template<class A, class B>
782inline
784 const OpAssign& op,
785 const QDPExpr<
788 OLattice< FVec32 > > &rhs,
789 const Subset& s)
790{
791
792
793 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
794
795 if( s.hasOrderedRep() ) {
796 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
797 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
798
799 int total_n_vec = s.end() - s.start() +1;
800
802
804
806 // Original code
808 //unsigned int n_vec=s.end() - s.start()+1;
809 //inlineSpinReconDir2Minus(aptr, bptr, n_vec);
810 }
811 else {
812 const int* tab = s.siteTable().slice();
813
814 int totalSize = s.numSiteTable();
815
817
819
821 // Original code
823 /*
824 for(int j=0; j < s.numSiteTable(); j++) {
825 int i = tab[j];
826 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
827 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
828 inlineSpinReconDir2Minus(aptr, bptr, 1);
829 }*/
830 }
831
832}
833
834// d = SpinReconstructDir3Minus(Vec);
835template<class A, class B>
836inline
838 const OpAssign& op,
839 const QDPExpr<
842 OLattice< FVec32 > > &rhs,
843 const Subset& s)
844{
845
846 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
847
848 if( s. hasOrderedRep() ) {
849 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
850 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
851
852 int total_n_vec = s.end() - s.start() +1;
853
855
857
859 // Original code
861 //unsigned int n_vec=s.end() - s.start()+1;
862 //inlineSpinReconDir3Minus(aptr, bptr, n_vec);
863 }
864 else {
865 const int* tab = s.siteTable().slice();
866
867 int totalSize = s.numSiteTable();
868
870
872
874 // Original code
876 /*
877 for(int j=0; j < s.numSiteTable(); j++) {
878 int i = tab[j];
879 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
880 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
881 inlineSpinReconDir3Minus(aptr, bptr, 1);
882 }*/
883 }
884
885}
886
887
888
889// d += SpinReconstructDir0Plus(Vec);
890template<class A, class B>
891inline
893 const OpAddAssign& op,
894 const QDPExpr<
897 OLattice< FVec32 > > &rhs,
898 const Subset& s)
899{
900
901
902 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
903
904 if( s.hasOrderedRep() ) {
905 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
906 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
907
908 int total_n_vec = s.end() - s.start() +1;
909
911
913
915 // Original code
917 //unsigned int n_vec=s.end() - s.start()+1;
918 //inlineAddSpinReconDir0Plus(aptr, bptr, n_vec);
919 }
920 else {
921 const int* tab = s.siteTable().slice();
922
923 int totalSize = s.numSiteTable();
924
926
928
930 // Original code
932 /*
933 for(int j=0; j < s.numSiteTable(); j++) {
934 int i = tab[j];
935 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
936 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
937 inlineAddSpinReconDir0Plus(aptr, bptr, 1);
938 }*/
939 }
940
941}
942
943// d += SpinReconstructDir1Plus(Vec);
944template<class A, class B>
945inline
947 const OpAddAssign& op,
948 const QDPExpr<
951 OLattice< FVec32 > > &rhs,
952 const Subset& s)
953{
954
955 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
956
957 if(s.hasOrderedRep() ) {
958 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
959 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
960
961 int total_n_vec = s.end() - s.start() +1;
962
964
966
968 // Original code
970 //unsigned int n_vec=s.end() - s.start()+1;
971 //inlineAddSpinReconDir1Plus(aptr, bptr, n_vec);
972 }
973 else {
974 const int* tab = s.siteTable().slice();
975
976 int totalSize = s.numSiteTable();
977
979
981
983 // Original code
985 /*
986 for(int j=0; j < s.numSiteTable(); j++) {
987 int i = tab[j];
988 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
989 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
990 inlineAddSpinReconDir1Plus(aptr, bptr, 1);
991 }*/
992 }
993
994}
995
996// d += SpinReconstructDir2Plus(Vec);
997template<class A, class B>
998inline
1000 const OpAddAssign& op,
1001 const QDPExpr<
1004 OLattice< FVec32 > > &rhs,
1005 const Subset& s)
1006{
1007
1008 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
1009
1010 if( s.hasOrderedRep() ) {
1011 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
1012 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
1013
1014 int total_n_vec = s.end() - s.start() +1;
1015
1017
1019
1021 // Original code
1023 //unsigned int n_vec=s.end() - s.start()+1;
1024 //inlineAddSpinReconDir2Plus(aptr, bptr, n_vec);
1025 }
1026 else {
1027 const int* tab = s.siteTable().slice();
1028
1029 int totalSize = s.numSiteTable();
1030
1032
1034
1036 // Original code
1038 /*
1039 for(int j=0; j < s.numSiteTable(); j++) {
1040 int i = tab[j];
1041 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
1042 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
1043 inlineAddSpinReconDir2Plus(aptr, bptr, 1);
1044 }*/
1045 }
1046
1047}
1048
1049// d += SpinReconstructDir3Plus(Vec);
1050template<class A, class B>
1051inline
1053 const OpAddAssign& op,
1054 const QDPExpr<
1057 OLattice< FVec32 > > &rhs,
1058 const Subset& s)
1059{
1060
1061 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
1062
1063 if( s.hasOrderedRep() ) {
1064 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
1065 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
1066
1067 int total_n_vec = s.end() - s.start() +1;
1068
1070
1072
1074 // Original code
1076 //unsigned int n_vec=s.end() - s.start()+1;
1077 //inlineAddSpinReconDir3Plus(aptr, bptr, n_vec);
1078 }
1079 else {
1080 const int* tab = s.siteTable().slice();
1081
1082 int totalSize = s.numSiteTable();
1083
1085
1087
1089 // Original code
1091 /*
1092 for(int j=0; j < s.numSiteTable(); j++) {
1093 int i = tab[j];
1094 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
1095 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
1096 inlineAddSpinReconDir3Plus(aptr, bptr, 1);
1097 }*/
1098 }
1099
1100}
1101
1102// d += SpinReconstructDir0Minus(Vec);
1103template<class A, class B>
1104inline
1106 const OpAddAssign& op,
1107 const QDPExpr<
1110 OLattice< FVec32 > > &rhs,
1111 const Subset& s)
1112{
1113
1114
1115 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
1116
1117 if( s.hasOrderedRep() ) {
1118 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
1119 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
1120
1121 int total_n_vec = s.end() - s.start() +1;
1122
1124
1126
1128 // Original code
1130 //unsigned int n_vec=s.end() - s.start()+1;
1131 //inlineAddSpinReconDir0Minus(aptr, bptr, n_vec);
1132 }
1133 else {
1134 const int* tab = s.siteTable().slice();
1135
1136 int totalSize = s.numSiteTable();
1137
1139
1141
1143 // Original code
1145 /*
1146 for(int j=0; j < s.numSiteTable(); j++) {
1147 int i = tab[j];
1148 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
1149 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
1150 inlineAddSpinReconDir0Minus(aptr, bptr, 1);
1151 }*/
1152 }
1153
1154
1155}
1156
1157// d += SpinReconstructDir1Minus(Vec);
1158template<class A, class B>
1159inline
1161 const OpAddAssign& op,
1162 const QDPExpr<
1165 OLattice< FVec32 > > &rhs,
1166 const Subset& s)
1167{
1168
1169 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
1170
1171 if( s.hasOrderedRep() ) {
1172 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
1173 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
1174
1175 int total_n_vec = s.end() - s.start() +1;
1176
1178
1180
1182 // Original code
1184 //unsigned int n_vec=s.end() - s.start()+1;
1185 //inlineAddSpinReconDir1Minus(aptr, bptr, n_vec);
1186 }
1187 else {
1188 const int* tab = s.siteTable().slice();
1189
1190 int totalSize = s.numSiteTable();
1191
1193
1195
1197 // Original code
1199 /*
1200 for(int j=0; j < s.numSiteTable(); j++) {
1201 int i = tab[j];
1202 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
1203 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
1204 inlineAddSpinReconDir1Minus(aptr, bptr, 1);
1205 }*/
1206 }
1207
1208}
1209
1210// d += SpinReconstructDir2Minus(Vec);
1211template<class A, class B>
1212inline
1214 const OpAddAssign& op,
1215 const QDPExpr<
1218 OLattice< FVec32 > > &rhs,
1219 const Subset& s)
1220{
1221
1222
1223 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
1224
1225 if( s.hasOrderedRep()) {
1226 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
1227 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
1228
1229 int total_n_vec = s.end() - s.start() +1;
1230
1232
1234
1236 // Original code
1238 //unsigned int n_vec=s.end() - s.start()+1;
1239 //inlineAddSpinReconDir2Minus(aptr, bptr, n_vec);
1240 }
1241 else {
1242 const int* tab = s.siteTable().slice();
1243
1244 int totalSize = s.numSiteTable();
1245
1247
1249
1251 // Original code
1253 /*
1254 for(int j=0; j < s.numSiteTable(); j++) {
1255 int i = tab[j];
1256 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
1257 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
1258 inlineAddSpinReconDir2Minus(aptr, bptr, 1);
1259 }*/
1260 }
1261
1262}
1263
1264// d += SpinReconstructDir3Minus(Vec);
1265template<class A, class B>
1266inline
1268 const OpAddAssign& op,
1269 const QDPExpr<
1272 OLattice< FVec32 > > &rhs,
1273 const Subset& s)
1274{
1275
1276
1277 const OLattice< HVec32 >& a = static_cast<const OLattice< HVec32 > &>(rhs.expression().child());
1278
1279 if( s.hasOrderedRep() ) {
1280 REAL32 *aptr =(REAL32 *)&(a.elem(s.start()).elem(0).elem(0).real());
1281 REAL32 *bptr =(REAL32 *)&(b.elem(s.start()).elem(0).elem(0).real());
1282
1283 int total_n_vec = s.end() - s.start() +1;
1284
1286
1288
1290 // Original code
1292 //unsigned int n_vec=s.end() - s.start()+1;
1293 //inlineAddSpinReconDir3Minus(aptr, bptr, n_vec);
1294 }
1295 else {
1296 const int* tab = s.siteTable().slice();
1297
1298 int totalSize = s.numSiteTable();
1299
1301
1303
1305 // Original code
1307 /*
1308 for(int j=0; j < s.numSiteTable(); j++) {
1309 int i = tab[j];
1310 REAL32 *aptr =(REAL32 *)&(a.elem(i).elem(0).elem(0).real());
1311 REAL32 *bptr =(REAL32 *)&(b.elem(i).elem(0).elem(0).real());
1312 inlineAddSpinReconDir3Minus(aptr, bptr, 1);
1313 }*/
1314 }
1315
1316}
1317
1318} // namespace QDP;
1319
1320#endif
Outer grid Lattice type.
Definition qdp_outer.h:264
T & elem(int i)
Definition qdp_outer.h:400
Primitive spin Vector class.
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 >, 2 > HVec32
PSpinVector< PColorVector< RComplex< REAL32 >, 3 >, 4 > FVec32
void inlineSpinReconDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_0).
void ordered_sse_spin_project_evaluate_function(int lo, int hi, int myId, ordered_sse_spin_project_user_arg *arg)
void inlineAddSpinReconDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_1).
void inlineAddSpinReconDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_2).
void inlineAddSpinReconDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_1).
void unordered_sse_spin_project_evaluate_function(int lo, int hi, int myId, unordered_sse_spin_project_user_arg< A, B > *arg)
void inlineSpinReconDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_2).
void inlineSpinReconDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_1).
void inlineSpinProjDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_0).
void inlineSpinProjDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_0).
void inlineAddSpinReconDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma3).
void inlineSpinProjDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_1).
void inlineSpinReconDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_2).
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 inlineAddSpinReconDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma3).
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 inlineSpinReconDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma3).
void inlineAddSpinReconDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_0).
void inlineAddSpinReconDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_2).
void inlineSpinReconDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma3).
void inlineSpinProjDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_2).
void inlineAddSpinReconDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_0).
void inlineSpinReconDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_1).
void inlineSpinReconDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_0).