2016-01-02 14:51:32 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonKernels.cc
|
|
|
|
|
|
|
|
Copyright (C) 2015
|
|
|
|
|
|
|
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <peterboyle@Peters-MacBook-Pro-2.local>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2015-05-26 19:55:18 +01:00
|
|
|
#include <Grid.h>
|
|
|
|
namespace Grid {
|
|
|
|
namespace QCD {
|
|
|
|
|
2016-06-03 11:24:26 +01:00
|
|
|
int WilsonKernelsStatic::HandOpt;
|
|
|
|
int WilsonKernelsStatic::AsmOpt;
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
2015-12-10 22:55:00 +00:00
|
|
|
WilsonKernels<Impl>::WilsonKernels(const ImplParams &p): Base(p) {};
|
|
|
|
|
2016-06-03 11:24:26 +01:00
|
|
|
template<class Impl>
|
2016-06-19 19:45:58 +01:00
|
|
|
void WilsonKernels<Impl>::DiracOptDhopSite(StencilImpl &st,LebesgueOrder &lo,DoubledGaugeField &U,
|
2016-06-03 11:24:26 +01:00
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > &buf,
|
2016-06-09 09:12:36 +01:00
|
|
|
int sF,int sU,int Ls, int Ns, const FermionField &in, FermionField &out)
|
2016-06-03 11:24:26 +01:00
|
|
|
{
|
2016-06-30 22:00:34 +01:00
|
|
|
#ifdef AVX512
|
2016-06-09 09:12:36 +01:00
|
|
|
if ( AsmOpt ) {
|
|
|
|
|
2016-06-19 19:45:58 +01:00
|
|
|
WilsonKernels<Impl>::DiracOptAsmDhopSite(st,lo,U,buf,sF,sU,Ls,Ns,in,out);
|
2016-06-09 09:12:36 +01:00
|
|
|
|
|
|
|
} else {
|
2016-06-30 22:00:34 +01:00
|
|
|
#else
|
|
|
|
{
|
|
|
|
#endif
|
2016-06-09 09:12:36 +01:00
|
|
|
for(int site=0;site<Ns;site++) {
|
|
|
|
for(int s=0;s<Ls;s++) {
|
2016-06-19 19:45:58 +01:00
|
|
|
if (HandOpt) WilsonKernels<Impl>::DiracOptHandDhopSite(st,lo,U,buf,sF,sU,in,out);
|
|
|
|
else WilsonKernels<Impl>::DiracOptGenericDhopSite(st,lo,U,buf,sF,sU,in,out);
|
2016-06-09 09:12:36 +01:00
|
|
|
sF++;
|
|
|
|
}
|
|
|
|
sU++;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-06-03 11:24:26 +01:00
|
|
|
}
|
|
|
|
|
2015-12-10 22:55:00 +00:00
|
|
|
template<class Impl>
|
2016-06-19 19:45:58 +01:00
|
|
|
void WilsonKernels<Impl>::DiracOptDhopSiteDag(StencilImpl &st,LebesgueOrder &lo,DoubledGaugeField &U,
|
2015-12-10 22:55:00 +00:00
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > &buf,
|
2016-06-09 09:12:36 +01:00
|
|
|
int sF,int sU,int Ls, int Ns, const FermionField &in, FermionField &out)
|
2016-06-03 11:24:26 +01:00
|
|
|
{
|
2016-08-15 22:31:29 +01:00
|
|
|
#ifdef AVX512
|
|
|
|
if ( AsmOpt ) {
|
|
|
|
WilsonKernels<Impl>::DiracOptAsmDhopSiteDag(st,lo,U,buf,sF,sU,Ls,Ns,in,out);
|
|
|
|
} else {
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
for(int site=0;site<Ns;site++) {
|
|
|
|
for(int s=0;s<Ls;s++) {
|
|
|
|
if (HandOpt) WilsonKernels<Impl>::DiracOptHandDhopSiteDag(st,lo,U,buf,sF,sU,in,out);
|
|
|
|
else WilsonKernels<Impl>::DiracOptGenericDhopSiteDag(st,lo,U,buf,sF,sU,in,out);
|
|
|
|
sF++;
|
|
|
|
}
|
|
|
|
sU++;
|
2016-06-09 09:12:36 +01:00
|
|
|
}
|
|
|
|
}
|
2016-06-03 11:24:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////
|
|
|
|
// Generic implementation; move to different file?
|
|
|
|
////////////////////////////////////////////
|
|
|
|
|
|
|
|
template<class Impl>
|
2016-06-19 19:45:58 +01:00
|
|
|
void WilsonKernels<Impl>::DiracOptGenericDhopSiteDag(StencilImpl &st,LebesgueOrder &lo,DoubledGaugeField &U,
|
2016-06-03 11:24:26 +01:00
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > &buf,
|
|
|
|
int sF,int sU,const FermionField &in, FermionField &out)
|
2015-05-26 19:55:18 +01:00
|
|
|
{
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
2016-03-27 05:24:07 +01:00
|
|
|
SiteHalfSpinor *chi_p;
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor Uchi;
|
2015-08-14 00:01:04 +01:00
|
|
|
SiteSpinor result;
|
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Xp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Xp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if (SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjXp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjXp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Xp,SE,st);
|
|
|
|
spReconXp(result,Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Yp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Yp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjYp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjYp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Yp,SE,st);
|
|
|
|
accumReconYp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Zp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Zp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjZp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjZp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Zp,SE,st);
|
|
|
|
accumReconZp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Tp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Tp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjTp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjTp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Tp,SE,st);
|
|
|
|
accumReconTp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Xm
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Xm,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjXm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjXm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Xm,SE,st);
|
|
|
|
accumReconXm(result,Uchi);
|
|
|
|
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Ym
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Ym,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjYm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjYm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Ym,SE,st);
|
|
|
|
accumReconYm(result,Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Zm
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Zm,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjZm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjZm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Zm,SE,st);
|
|
|
|
accumReconZm(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Tm
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Tm,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjTm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjTm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Tm,SE,st);
|
|
|
|
accumReconTm(result,Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
vstream(out._odata[sF],result);
|
2015-08-10 20:47:44 +01:00
|
|
|
};
|
|
|
|
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
// Need controls to do interior, exterior, or both
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
2016-06-19 19:45:58 +01:00
|
|
|
void WilsonKernels<Impl>::DiracOptGenericDhopSite(StencilImpl &st,LebesgueOrder &lo,DoubledGaugeField &U,
|
2016-06-03 11:24:26 +01:00
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > &buf,
|
|
|
|
int sF,int sU,const FermionField &in, FermionField &out)
|
2015-08-10 20:47:44 +01:00
|
|
|
{
|
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
2016-03-27 05:24:07 +01:00
|
|
|
SiteHalfSpinor *chi_p;
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor Uchi;
|
2016-01-03 01:38:11 +00:00
|
|
|
SiteSpinor result;
|
2015-08-14 00:01:04 +01:00
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Xp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Xm,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjXp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjXp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Xm,SE,st);
|
|
|
|
spReconXp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Yp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Ym,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjYp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjYp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Ym,SE,st);
|
|
|
|
accumReconYp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Zp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Zm,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjZp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjZp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Zm,SE,st);
|
|
|
|
accumReconZp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Tp
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Tm,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjTp(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjTp(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Tm,SE,st);
|
|
|
|
accumReconTp(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Xm
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Xp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjXm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjXm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Xp,SE,st);
|
|
|
|
accumReconXm(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Ym
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Yp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjYm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjYm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Yp,SE,st);
|
|
|
|
accumReconYm(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Zm
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Zp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjZm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjZm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Zp,SE,st);
|
|
|
|
accumReconZm(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
|
|
|
///////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Tm
|
2016-01-03 01:38:11 +00:00
|
|
|
///////////////////////////
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,Tp,sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
if ( SE->_is_local ) {
|
|
|
|
chi_p = χ
|
2016-01-03 01:38:11 +00:00
|
|
|
if ( SE->_permute ) {
|
|
|
|
spProjTm(tmp,in._odata[SE->_offset]);
|
|
|
|
permute(chi,tmp,ptype);
|
|
|
|
} else {
|
|
|
|
spProjTm(chi,in._odata[SE->_offset]);
|
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
|
|
|
chi_p=&buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],*chi_p,Tp,SE,st);
|
|
|
|
accumReconTm(result,Uchi);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-03-27 05:24:07 +01:00
|
|
|
vstream(out._odata[sF],result);
|
2016-01-03 01:38:11 +00:00
|
|
|
};
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
2015-11-06 11:30:17 +00:00
|
|
|
void WilsonKernels<Impl>::DiracOptDhopDir(StencilImpl &st,DoubledGaugeField &U,
|
2015-08-10 20:47:44 +01:00
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > &buf,
|
|
|
|
int sF,int sU,const FermionField &in, FermionField &out,int dir,int gamma)
|
2015-05-26 19:55:18 +01:00
|
|
|
{
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteSpinor result;
|
|
|
|
SiteHalfSpinor Uchi;
|
2015-08-14 00:01:04 +01:00
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2015-08-14 00:01:04 +01:00
|
|
|
SE=st.GetEntry(ptype,dir,sF);
|
2015-08-10 20:47:44 +01:00
|
|
|
|
|
|
|
// Xp
|
|
|
|
if(gamma==Xp){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjXp(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjXp(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-05-26 19:55:18 +01:00
|
|
|
spReconXp(result,Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Yp
|
|
|
|
if ( gamma==Yp ){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjYp(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjYp(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconYp(result,Uchi);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Zp
|
|
|
|
if ( gamma ==Zp ){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjZp(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjZp(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconZp(result,Uchi);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tp
|
|
|
|
if ( gamma ==Tp ){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjTp(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjTp(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconTp(result,Uchi);
|
|
|
|
}
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Xm
|
|
|
|
if ( gamma==Xm ){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjXm(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjXm(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconXm(result,Uchi);
|
|
|
|
}
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Ym
|
|
|
|
if ( gamma == Ym ){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjYm(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjYm(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconYm(result,Uchi);
|
|
|
|
}
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Zm
|
|
|
|
if ( gamma == Zm ){
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjZm(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjZm(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconZm(result,Uchi);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tm
|
|
|
|
if ( gamma==Tm ) {
|
2015-08-14 00:01:04 +01:00
|
|
|
if ( SE->_is_local && SE->_permute ) {
|
|
|
|
spProjTm(tmp,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
permute(chi,tmp,ptype);
|
2015-08-14 00:01:04 +01:00
|
|
|
} else if ( SE->_is_local ) {
|
|
|
|
spProjTm(chi,in._odata[SE->_offset]);
|
2015-05-26 19:55:18 +01:00
|
|
|
} else {
|
2015-08-14 00:01:04 +01:00
|
|
|
chi=buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-08-14 12:57:42 +01:00
|
|
|
Impl::multLink(Uchi,U._odata[sU],chi,dir,SE,st);
|
2015-08-10 20:47:44 +01:00
|
|
|
spReconTm(result,Uchi);
|
|
|
|
}
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2016-02-15 22:02:36 +00:00
|
|
|
vstream(out._odata[sF],result);
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2015-12-10 22:55:00 +00:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
FermOpTemplateInstantiate(WilsonKernels);
|
2016-06-03 11:24:26 +01:00
|
|
|
|
2015-05-26 19:55:18 +01:00
|
|
|
}}
|