QDP++
qdp_scalarsite_linalg_double.cc
Go to the documentation of this file.
1
7
8
9#include "qdp.h"
10
11
12// These SSE asm instructions are only supported under GCC/G++
14
15namespace QDP {
16
17
18
19//-------------------------------------------------------------------
20// Specialization to optimize the case
21// LatticeColorMatrix[ Subset] = LatticeColorMatrix * LatticeColorMatrix
22
23// Threading hoist
30
31 inline
32 void ordered_ssed_3mat_evaluate_func(int lo, int hi, int myId,
34 {
35 void (*func)(REAL64*, REAL64*, REAL64*, int) = a->func;
36
37 int n_3mat = (hi - lo);
38 int index = lo*18; // 3*3*2 doubles
39 REAL64* lm = &(a->lm[index]);
40 REAL64* rm = &(a->rm[index]);
41 REAL64* dm = &(a->dm[index]);
42
43 func(dm,lm,rm, n_3mat);
44 }
45
48 const OLattice<DCol>& r_,
50 const int *tab_,
51 void (*func_)(REAL64*, REAL64*, REAL64*, int) ) :
52 l(l_),r(r_),d(d_),tab(tab_),func(func_) {}
53
57 const int *tab;
58 void (*func)(REAL64*, REAL64*, REAL64*, int);
59 };
60
61 inline
62 void unordered_ssed_3mat_evaluate_func(int lo, int hi, int myId,
64 {
65 void (*func)(REAL64*, REAL64*, REAL64*, int) = a->func;
66 for(int site=lo; site < hi; site++) {
67 int i = a->tab[site];
68 REAL64 *lm = (REAL64 *)&(a->l.elem(i).elem().elem(0,0).real());
69 REAL64 *rm = (REAL64 *)&(a->r.elem(i).elem().elem(0,0).real());
70 REAL64 *dm = (REAL64 *)&(a->d.elem(i).elem().elem(0,0).real());
71 func(dm,lm, rm, 1);
72 }
73 }
74
75
76
77template<>
79 const OpAssign& op,
83 OLattice< DCol > >& rhs,
84 const Subset& s)
85{
86// cout << "call single site QDP_M_eq_M_times_M" << endl;
87
88 typedef OLattice< DCol > C;
89
90 const C& l = static_cast<const C&>(rhs.expression().left());
91 const C& r = static_cast<const C&>(rhs.expression().right());
92
93 if( s.hasOrderedRep() ) {
94 int n_3mat=s.end() - s.start() + 1;
95 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
96 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
97 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
98
101
102 //ssed_m_eq_mm(dm,lm,rm, n_3mat);
103 }
104 else {
105 const int *tab = s.siteTable().slice();
108
109 //for(int j=0; j < s.numSiteTable(); ++j) {
110 // int i = tab[j];
111 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
112 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
113 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
114 // ssed_m_eq_mm(dm,lm, rm, 1);
115 // }
116 }
117}
118
119
120// Specialization to optimize the case
121// LatticeColorMatrix[Subset] = adj(LatticeColorMatrix) * LatticeColorMatrix
122template<>
124 const OpAssign& op,
128 OLattice< DCol > >& rhs,
129 const Subset& s)
130{
131// cout << "call single site QDP_M_eq_aM_times_M" << endl;
132
133 typedef OLattice< DCol > C;
134
135 const C& l = static_cast<const C&>(rhs.expression().left().child());
136 const C& r = static_cast<const C&>(rhs.expression().right());
137
138 if( s.hasOrderedRep() ) {
139 int n_3mat = s.end()-s.start()+1;
140 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
141 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
142 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
145
146 //ssed_m_eq_hm(dm,lm,rm,n_3mat);
147 }
148 else {
149 const int *tab = s.siteTable().slice();
152
153 //for(int j=0; j < s.numSiteTable(); ++j) {
154 //
155 // int i = tab[j];
156 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
157 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
158 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
159 // ssed_m_eq_hm(dm, lm, rm, 1);
160 // }
161 }
162
163}
164
165
166// Specialization to optimize the case
167// LatticeColorMatrix[Subset] = LatticeColorMatrix * adj(LatticeColorMatrix)
168template<>
170 const OpAssign& op,
174 OLattice< DCol > >& rhs,
175 const Subset& s)
176{
177// cout << "call single site QDP_M_eq_M_times_aM" << endl;
178
179 typedef OLattice< DCol > C;
180
181 const C& l = static_cast<const C&>(rhs.expression().left());
182 const C& r = static_cast<const C&>(rhs.expression().right().child());
183
184 if( s.hasOrderedRep() ) {
185 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
186 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
187 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
188 int n_3mat = s.end()-s.start()+1;
191
192 //ssed_m_eq_mh(dm,lm,rm,n_3mat);
193 }
194 else {
195
196 const int *tab = s.siteTable().slice();
199
200 // for(int j=0; j < s.numSiteTable(); ++j) {
201 // int i = tab[j];
202 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
203 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
204 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
205 // ssed_m_eq_mh(dm, lm, rm, 1);
206 //
207 // }
208 }
209}
210
211
212// Specialization to optimize the case
213// LatticeColorMatrix[Subset] = adj(LatticeColorMatrix) * adj(LatticeColorMatrix)
214template<>
216 const OpAssign& op,
220 OLattice< DCol > >& rhs,
221 const Subset& s)
222{
223// cout << "call single site QDP_M_eq_Ma_times_Ma" << endl;
224
225 typedef OLattice< DCol > C;
226
227 const C& l = static_cast<const C&>(rhs.expression().left().child());
228 const C& r = static_cast<const C&>(rhs.expression().right().child());
229
230 if( s.hasOrderedRep() ) {
231 int n_3mat = s.end() - s.start() + 1;
232 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
233 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
234 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
237
238 //ssed_m_eq_hh(dm,lm,rm,n_3mat);
239 }
240 else {
241 const int *tab = s.siteTable().slice();
244
245 // for(int j=0; j < s.numSiteTable(); ++j) {
246 // int i = tab[j];
247 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
248 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
249 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
250 //
251 // ssed_m_eq_hh(dm,lm,rm,1);
252 //}
253 }
254}
255
256//-------------------------------------------------------------------
257
258// Specialization to optimize the case
259// LatticeColorMatrix[Subset] += LatticeColorMatrix * LatticeColorMatrix
260// Threading hoist
268
269 inline
270 void ordered_ssed_3mat_const_evaluate_func(int lo, int hi, int myId,
272 {
273 void (*func)(REAL64*, REAL64*, REAL64*, REAL64*, int) = a->func;
274
275 int n_3mat = (hi - lo);
276 int index = lo*18; // 3*3*2 doubles
277 REAL64* lm = &(a->lm[index]);
278 REAL64* rm = &(a->rm[index]);
279 REAL64* dm = &(a->dm[index]);
280 REAL64* c = a->c; // The const
281
282 func(dm,c,lm,rm, n_3mat);
283 }
284
287 const OLattice<DCol>& r_,
288 OLattice<DCol>& d_,
289 REAL64 *c_,
290 const int *tab_,
291 void (*func_)(REAL64*, REAL64*, REAL64*, REAL64*, int) ) :
292 l(l_), r(r_),d(d_),c(c_),tab(tab_),func(func_) {}
293
298 const int *tab;
299 void (*func)(REAL64*, REAL64*, REAL64*, REAL64*, int);
300 };
301
302 inline
303 void unordered_ssed_3mat_const_evaluate_func(int lo, int hi, int myId,
305 {
306 void (*func)(REAL64*, REAL64*, REAL64*, REAL64*, int) = a->func;
307 for(int site=lo; site < hi; site++) {
308 int i = a->tab[site];
309 REAL64 *lm = (REAL64 *)&(a->l.elem(i).elem().elem(0,0).real());
310 REAL64 *rm = (REAL64 *)&(a->r.elem(i).elem().elem(0,0).real());
311 REAL64 *dm = (REAL64 *)&(a->d.elem(i).elem().elem(0,0).real());
312 func(dm,a->c, lm, rm, 1);
313 }
314 }
315
316
317template<>
319 const OpAddAssign& op,
323 OLattice< DCol > >& rhs,
324 const Subset& s)
325{
326// cout << "call single site QDP_M_peq_M_times_M" << endl;
327
328 typedef OLattice< DCol > C;
329
330 const C& l = static_cast<const C&>(rhs.expression().left());
331 const C& r = static_cast<const C&>(rhs.expression().right());
332
333 REAL64 one=(REAL64)1;
334
335 if( s.hasOrderedRep() ) {
336 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
337 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
338 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
339 int n_3mat=s.end()-s.start()+1;
342 }
343 else {
344 const int *tab = s.siteTable().slice();
347 // const int *tab = s.siteTable().slice();
348 // for(int j=0; j < s.numSiteTable(); ++j) {
349 // int i = tab[j];
350 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
351 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
352 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
353 // ssed_m_peq_amm(dm,&one,lm,rm,1);
354 // }
355 }
356}
357
358
359// Specialization to optimize the case
360// LatticeColorMatrix[Subset] += adj(LatticeColorMatrix) * LatticeColorMatrix
361template<>
363 const OpAddAssign& op,
367 OLattice< DCol > >& rhs,
368 const Subset& s)
369{
370// cout << "call single site QDP_M_peq_aM_times_M" << endl;
371
372 typedef OLattice< DCol > C;
373
374 const C& l = static_cast<const C&>(rhs.expression().left().child());
375 const C& r = static_cast<const C&>(rhs.expression().right());
376
377
378 REAL64 one = (REAL64)1;
379 if( s.hasOrderedRep() ) {
380 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
381 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
382 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
383
384 int n_3mat=s.end()-s.start()+1;
387 // ssed_m_peq_ahm(dm,&one,lm,rm,n_3mat);
388 }
389 else {
390 const int *tab = s.siteTable().slice();
393 //const int *tab = s.siteTable().slice();
394 //for(int j=0; j < s.numSiteTable(); ++j) {
395 // int i = tab[j];
396 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
397 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
398 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
399 // ssed_m_peq_ahm(dm,&one,lm,rm,1);
400 //}
401 }
402}
403
404
405// Specialization to optimize the case
406// LatticeColorMatrix[Subset] += LatticeColorMatrix * adj(LatticeColorMatrix)
407template<>
409 const OpAddAssign& op,
413 OLattice< DCol > >& rhs,
414 const Subset& s)
415{
416// cout << "call single site QDP_M_peq_M_times_aM" << endl;
417
418 typedef OLattice< DCol > C;
419
420 const C& l = static_cast<const C&>(rhs.expression().left());
421 const C& r = static_cast<const C&>(rhs.expression().right().child());
422
423 REAL64 one=(REAL64)1;
424
425 if( s.hasOrderedRep() ) {
426 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
427 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
428 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
429 int n_3mat=s.end()-s.start()+1;
432 // ssed_m_peq_amh(dm,&one,lm,rm,n_3mat);
433 }
434 else {
435 const int *tab = s.siteTable().slice();
438 // const int *tab = s.siteTable().slice();
439 // for(int j=0; j < s.numSiteTable(); ++j) {
440 // int i = tab[j];
441 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
442 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
443 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
444 // ssed_m_peq_amh(dm,&one,lm,rm,1);
445 // }
446 }
447}
448
449
450// Specialization to optimize the case
451// LatticeColorMatrix[Subset] += adj(LatticeColorMatrix) * adj(LatticeColorMatrix)
452template<>
454 const OpAddAssign& op,
458 OLattice< DCol > >& rhs,
459 const Subset& s)
460{
461// cout << "call single site QDP_M_peq_Ma_times_Ma" << endl;
462
463 typedef OLattice< DCol > C;
464
465 const C& l = static_cast<const C&>(rhs.expression().left().child());
466 const C& r = static_cast<const C&>(rhs.expression().right().child());
467
468 REAL64 one=(REAL64)1;
469
470
471 if( s.hasOrderedRep() ) {
472
473 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
474 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
475 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
476 int n_3mat=s.end()-s.start()+1;
479
480 //ssed_m_peq_ahh(dm,&one,lm,rm,n_3mat);
481
482 }
483 else {
484 const int *tab = s.siteTable().slice();
487 // const int *tab = s.siteTable().slice();
488 // for(int j=0; j < s.numSiteTable(); ++j) {
489 // int i = tab[j];
490 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
491 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
492 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
493 // ssed_m_peq_ahh(dm,&one,lm,rm,1);
494 // }
495 }
496}
497
498//-------------------------------------------------------------------
499// Specialization to optimize the case
500// LatticeColorMatrix = LatticeColorMatrix
501// Implement as m1 = a*m2 (a=1)
502
509
510 inline
511 void ordered_ssed_2mat_const_evaluate_func(int lo, int hi, int myId,
513 {
514 void (*func)(REAL64*, REAL64*, REAL64*, int) = a->func;
515
516 int n_3mat = (hi - lo);
517 int index = lo*18; // 3*3*2 doubles
518 REAL64* src = &(a->src[index]);
519 REAL64* target = &(a->target[index]);
520 REAL64* c = a->c; // The const
521
522 func(target,c,src, n_3mat);
523 }
524
527 const OLattice<DCol>& src_,
528 OLattice<DCol>& target_,
529 REAL64*c_,
530 const int* tab_,
531 void (*func_)(REAL64*, REAL64*, REAL64*, int) ) :
532 src(src_), target(target_),c(c_),tab(tab_),func(func_) {}
533
537 const int* tab;
538 void (*func)(REAL64*, REAL64*, REAL64*, int);
539 };
540
541 inline
542 void unordered_ssed_2mat_const_evaluate_func(int lo, int hi, int myId,
544 {
545 void (*func)(REAL64*, REAL64*, REAL64*, int) = a->func;
546 REAL64* c = a->c; // The const
547
548
549 // Loop through the sites
550 for(int j=lo; j < hi; j++) {
551 int i = a->tab[j];
552 REAL64* d_ptr =&(a->target.elem(i).elem().elem(0,0).real());
553 REAL64* l_ptr =(REAL64*)&(a->src.elem(i).elem().elem(0,0).real());
554 func(d_ptr,a->c,l_ptr,1);
555 }
556
557
558 }
559
560
561template<>
563 const OpAssign& op,
564 const QDPExpr<
566 OLattice< DCol > >& rhs,
567 const Subset& s)
568{
569 typedef OLattice<DCol> C;
570 const C& l = static_cast<const C&>(rhs.expression().child());
571 REAL64 one=(REAL64)1;
572
573 if( s.hasOrderedRep() ) {
574 int n_3mat=s.end()-s.start()+1;
575 REAL64* d_ptr =&(d.elem(s.start()).elem().elem(0,0).real());
576 REAL64* l_ptr =(REAL64*)&(l.elem(s.start()).elem().elem(0,0).real());
577 ordered_ssed_2mat_const_args a = {l_ptr, d_ptr, &one, ssed_m_eq_scal_m};
579
580 // ssed_m_eq_scal_m(d_ptr,&one,l_ptr,n_3mat);
581 }
582 else {
583 // Unordered case
584 const int* tab = s.siteTable().slice();
588
589
590 // Loop through the sites
591 // for(int j=0; j < s.numSiteTable(); j++) {
592 // int i = tab[j];
593 // REAL64* d_ptr =&(d.elem(i).elem().elem(0,0).real());
594 // REAL64* l_ptr =(REAL64*)&(l.elem(i).elem().elem(0,0).real());
595 //
596 // ssed_m_eq_scal_m(d_ptr,&one,l_ptr,1);
597 // }
598 }
599}
600
601//-------------------------------------------------------------------
602// Specialization to optimize the case
603// LatticeColorMatrix += LatticeColorMatrix
609
610 inline
611 void ordered_ssed_2mat_evaluate_func(int lo, int hi, int myId,
613 {
614 void (*func)(REAL64*, REAL64*, int) = a->func;
615
616 int n_3mat = (hi - lo);
617 int index = lo*18; // 3*3*2 doubles
618 REAL64* src = &(a->src[index]);
619 REAL64* target = &(a->target[index]);
620
621 func(target,src, n_3mat);
622 }
623
626 OLattice<DCol>& target_,
627 const int* tab_,
628 void (*func_)(REAL64*, REAL64*, int) ) :
629 src(src_), target(target_), tab(tab_),func(func_) {}
630
633 const int* tab;
634 void (*func)(REAL64*, REAL64*, int);
635 };
636
637 inline
638 void unordered_ssed_2mat_evaluate_func(int lo, int hi, int myId,
640 {
641 void (*func)(REAL64*, REAL64*, int) = a->func;
642
643
644 // Loop through the sites
645 for(int j=lo; j < hi; j++) {
646 int i = a->tab[j];
647 REAL64* d_ptr =&(a->target.elem(i).elem().elem(0,0).real());
648 REAL64* l_ptr =(REAL64*)&(a->src.elem(i).elem().elem(0,0).real());
649 func(d_ptr,l_ptr,1);
650 }
651
652
653 }
654
655template<>
657 const OpAddAssign& op,
658 const QDPExpr<
660 OLattice< DCol > >& rhs,
661 const Subset& s)
662{
663 typedef OLattice<DCol> C;
664 const C& l = static_cast<const C&>(rhs.expression().child());
665
666 if( s.hasOrderedRep() ) {
667 int n_3mat=s.end()-s.start()+1;
668 REAL64* d_ptr =&(d.elem(s.start()).elem().elem(0,0).real());
669 REAL64* l_ptr =(REAL64*)&(l.elem(s.start()).elem().elem(0,0).real());
670 ordered_ssed_2mat_args a = {l_ptr, d_ptr, ssed_m_peq_m};
672 // ssed_m_peq_m(d_ptr,l_ptr,n_3mat);
673 }
674 else {
675 // Unordered case
676 const int* tab = s.siteTable().slice();
680
681 // Loop through the sites
682 // for(int j=0; j < s.numSiteTable(); j++) {
683 // int i = tab[j];
684 // REAL64* d_ptr =&(d.elem(i).elem().elem(0,0).real());
685 // REAL64* l_ptr =(REAL64*)&(l.elem(i).elem().elem(0,0).real());
686 // ssed_m_peq_m(d_ptr,l_ptr,1);
687 // }
688
689 }
690}
691
692//-------------------------------------------------------------------
693// Specialization to optimize the case
694// LatticeColorMatrix -= LatticeColorMatrix
695template<>
697 const OpSubtractAssign& op,
698 const QDPExpr<
700 OLattice< DCol > >& rhs,
701 const Subset& s)
702{
703 typedef OLattice<DCol> C;
704 const C& l = static_cast<const C&>(rhs.expression().child());
705 if (s.hasOrderedRep()) {
706 int n_3mat=s.end()-s.start()+1;
707 REAL64* d_ptr =&(d.elem(s.start()).elem().elem(0,0).real());
708 REAL64* l_ptr =(REAL64*)&(l.elem(s.start()).elem().elem(0,0).real());
709 ordered_ssed_2mat_args a = {l_ptr, d_ptr, ssed_m_meq_m};
711
712 // ssed_m_meq_m(d_ptr,l_ptr,n_3mat);
713 }
714 else {
715 // Unordered case
716 const int* tab = s.siteTable().slice();
720
721 // Loop through the sites
722 // for(int j=0; j < s.numSiteTable(); j++) {
723 // int i = tab[j];
724 // REAL64* d_ptr =&(d.elem(i).elem().elem(0,0).real());
725 // REAL64* l_ptr =(REAL64*)&(l.elem(i).elem().elem(0,0).real());
726 // ssed_m_meq_m(d_ptr,l_ptr,1);
727 // }
728 }
729}
730
731// Specialization to optimize the case
732// LatticeColorMatrix[Subset] -= LatticeColorMatrix * LatticeColorMatrix
733template<>
735 const OpSubtractAssign& op,
739 OLattice< DCol > >& rhs,
740 const Subset& s)
741{
742// cout << "call single site QDP_M_meq_M_times_M" << endl;
743
744 typedef OLattice< DCol > C;
745
746 const C& l = static_cast<const C&>(rhs.expression().left());
747 const C& r = static_cast<const C&>(rhs.expression().right());
748
749 REAL64 mone=(REAL64)-1;
750
751
752 if( s.hasOrderedRep() ) {
753
754 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
755 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
756 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
757 int n_3mat=s.end()-s.start()+1;
758 ordered_ssed_3mat_const_args a = {lm,rm,dm,&mone,ssed_m_peq_amm};
760
761 //ssed_m_peq_amm(dm,&mone,lm, rm, n_3mat);
762 }
763 else {
764
765 const int *tab = s.siteTable().slice();
768
769 // for(int j=0; j < s.numSiteTable(); j++) {
770 // int i=tab[j];
771 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
772 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
773 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
774 //
775 // ssed_m_peq_amm(dm,&mone,lm,rm,1);
776 // }
777 }
778}
779
780
781// Specialization to optimize the case
782// LatticeColorMatrix[Subset] -= adj(LatticeColorMatrix) * LatticeColorMatrix
783template<>
785 const OpSubtractAssign& op,
789 OLattice< DCol > >& rhs,
790 const Subset& s)
791{
792// cout << "call single site QDP_M_meq_aM_times_M" << endl;
793
794 typedef OLattice< DCol > C;
795
796 const C& l = static_cast<const C&>(rhs.expression().left().child());
797 const C& r = static_cast<const C&>(rhs.expression().right());
798
799 REAL64 mone=(REAL64)-1;
800
801 if( s.hasOrderedRep() ) {
802 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
803 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
804 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
805 int n_3mat=s.end()-s.start()+1;
806 ordered_ssed_3mat_const_args a = {lm,rm,dm,&mone,ssed_m_peq_ahm};
808
809 //ssed_m_peq_ahm(dm,&mone,lm,rm,n_3mat);
810 }
811 else {
812
813 const int *tab = s.siteTable().slice();
816
817 //for(int j=0; j < s.numSiteTable(); j++) {
818 // int i=tab[j];
819 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
820 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
821 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
822 // ssed_m_peq_ahm(dm,&mone,lm, rm, 1);
823 // }
824 }
825}
826
827
828// Specialization to optimize the case
829// LatticeColorMatrix[Subset] -= LatticeColorMatrix * adj(LatticeColorMatrix)
830template<>
832 const OpSubtractAssign& op,
836 OLattice< DCol > >& rhs,
837 const Subset& s)
838{
839// cout << "call single site QDP_M_meq_M_times_aM" << endl;
840
841 typedef OLattice< DCol > C;
842
843 const C& l = static_cast<const C&>(rhs.expression().left());
844 const C& r = static_cast<const C&>(rhs.expression().right().child());
845
846 REAL64 mone=(REAL64)-1;
847
848 if( s.hasOrderedRep() ) {
849 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
850 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
851 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
852 int n_3mat=s.end()-s.start()+1;
853 ordered_ssed_3mat_const_args a = {lm,rm,dm,&mone,ssed_m_peq_amh};
855
856 // ssed_m_peq_amh(dm,&mone,lm, rm,n_3mat);
857 }
858 else {
859 const int *tab = s.siteTable().slice();
862
863 // for(int j=0; j < s.numSiteTable(); j++) {
864 // int i=tab[j];
865 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
866 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
867 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
868 //
869 // ssed_m_peq_amh(dm,&mone,lm, rm,1);
870 // }
871 }
872}
873
874
875// Specialization to optimize the case
876// LatticeColorMatrix[Subset] -= adj(LatticeColorMatrix) * adj(LatticeColorMatrix)
877template<>
879 const OpSubtractAssign& op,
883 OLattice< DCol > >& rhs,
884 const Subset& s)
885{
886// cout << "call single site QDP_M_meq_Ma_times_Ma" << endl;
887
888 typedef OLattice< DCol > C;
889
890 const C& l = static_cast<const C&>(rhs.expression().left().child());
891 const C& r = static_cast<const C&>(rhs.expression().right().child());
892 REAL64 mone=(REAL64)-1;
893
894 if( s.hasOrderedRep() ) {
895
896 REAL64 *lm = (REAL64 *)&(l.elem(s.start()).elem().elem(0,0).real());
897 REAL64 *rm = (REAL64 *)&(r.elem(s.start()).elem().elem(0,0).real());
898 REAL64 *dm = (REAL64 *)&(d.elem(s.start()).elem().elem(0,0).real());
899 int n_3mat=s.end()-s.start()+1;
900 ordered_ssed_3mat_const_args a = {lm,rm,dm,&mone,ssed_m_peq_ahh};
902
903 // ssed_m_peq_ahh(dm,&mone,lm,rm,n_3mat);
904 }
905 else {
906 const int *tab = s.siteTable().slice();
909
910 // for(int j=0; j < s.numSiteTable(); j++) {
911 // int i=tab[j];
912 // REAL64 *lm = (REAL64 *)&(l.elem(i).elem().elem(0,0).real());
913 // REAL64 *rm = (REAL64 *)&(r.elem(i).elem().elem(0,0).real());
914 // REAL64 *dm = (REAL64 *)&(d.elem(i).elem().elem(0,0).real());
915 // ssed_m_peq_ahh(dm,&mone,lm,rm,1);
916 // }
917 }
918}
919
920
921
922
923
924} // namespace QDP;
Outer grid Lattice type.
Definition qdp_outer.h:264
T & elem(int i)
Definition qdp_outer.h:400
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
double REAL64
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)
OLattice< PScalar< PColorMatrix< RComplexFloat, 3 > > > C
PScalar< PColorMatrix< RComplex< REAL64 >, 3 > > DCol
Yet another random number generator.
void ssed_m_eq_hm(REAL64 *m3, REAL64 *m2, REAL64 *m1, int n_mat)
void ordered_ssed_2mat_evaluate_func(int lo, int hi, int myId, ordered_ssed_2mat_args *a)
MakeReturn< UnaryNode< FnReal, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnReal >::Type_t >::Expression_t real(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4972
void unordered_ssed_2mat_const_evaluate_func(int lo, int hi, int myId, unordered_ssed_2mat_const_args *a)
void dispatch_to_threads(int numSiteTable, Arg a, void(*func)(int, int, int, Arg *))
void unordered_ssed_3mat_evaluate_func(int lo, int hi, int myId, unordered_ssed_3mat_args *a)
void ssed_m_eq_mm(REAL64 *m3, REAL64 *m2, REAL64 *m1, int n_mat)
void unordered_ssed_2mat_evaluate_func(int lo, int hi, int myId, unordered_ssed_2mat_args *a)
void unordered_ssed_3mat_const_evaluate_func(int lo, int hi, int myId, unordered_ssed_3mat_const_args *a)
void ssed_m_peq_amm(REAL64 *m3, REAL64 *a, REAL64 *m2, REAL64 *m1, int n_mat)
void ssed_m_eq_scal_m(REAL64 *m2, REAL64 *a, REAL64 *m1, int n_mat)
void ssed_m_meq_m(REAL64 *m2, REAL64 *m1, int n_mat)
void ssed_m_peq_ahh(REAL64 *m3, REAL64 *a, REAL64 *m2, REAL64 *m1, int n_mat)
void ordered_ssed_3mat_const_evaluate_func(int lo, int hi, int myId, ordered_ssed_3mat_const_args *a)
void ssed_m_peq_ahm(REAL64 *m3, REAL64 *a, REAL64 *m2, REAL64 *m1, int n_mat)
void ssed_m_peq_m(REAL64 *m2, REAL64 *m1, int n_mat)
void ssed_m_eq_mh(REAL64 *m3, REAL64 *m2, REAL64 *m1, int n_mat)
void ordered_ssed_2mat_const_evaluate_func(int lo, int hi, int myId, ordered_ssed_2mat_const_args *a)
void ssed_m_peq_amh(REAL64 *m3, REAL64 *a, REAL64 *m2, REAL64 *m1, int n_mat)
void ssed_m_eq_hh(REAL64 *m3, REAL64 *m2, REAL64 *m1, int n_mat)
void ordered_ssed_3mat_evaluate_func(int lo, int hi, int myId, ordered_ssed_3mat_args *a)
Primary include file for QDP.
void(* func)(REAL64 *, REAL64 *, int)
void(* func)(REAL64 *, REAL64 *, REAL64 *, int)
void(* func)(REAL64 *, REAL64 *, REAL64 *, int)
void(* func)(REAL64 *, REAL64 *, REAL64 *, REAL64 *, int)
void(* func)(REAL64 *, REAL64 *, int)
unordered_ssed_2mat_args(const OLattice< DCol > &src_, OLattice< DCol > &target_, const int *tab_, void(*func_)(REAL64 *, REAL64 *, int))
unordered_ssed_2mat_const_args(const OLattice< DCol > &src_, OLattice< DCol > &target_, REAL64 *c_, const int *tab_, void(*func_)(REAL64 *, REAL64 *, REAL64 *, int))
void(* func)(REAL64 *, REAL64 *, REAL64 *, int)
unordered_ssed_3mat_args(const OLattice< DCol > &l_, const OLattice< DCol > &r_, OLattice< DCol > &d_, const int *tab_, void(*func_)(REAL64 *, REAL64 *, REAL64 *, int))
void(* func)(REAL64 *, REAL64 *, REAL64 *, int)
void(* func)(REAL64 *, REAL64 *, REAL64 *, REAL64 *, int)
unordered_ssed_3mat_const_args(const OLattice< DCol > &l_, const OLattice< DCol > &r_, OLattice< DCol > &d_, REAL64 *c_, const int *tab_, void(*func_)(REAL64 *, REAL64 *, REAL64 *, REAL64 *, int))