2016-07-18 16:36:28 +01:00
|
|
|
/*************************************************************************************
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonKernels.cc
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Copyright (C) 2015
|
2016-01-02 14:51:32 +00:00
|
|
|
|
|
|
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <peterboyle@Peters-MacBook-Pro-2.local>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
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.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
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.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
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.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
See the full license in the file "LICENSE" in the top level distribution
|
|
|
|
directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2017-02-22 18:09:33 +00:00
|
|
|
#include <Grid/qcd/action/fermion/FermionCore.h>
|
2015-05-26 19:55:18 +01:00
|
|
|
namespace Grid {
|
|
|
|
namespace QCD {
|
|
|
|
|
2017-02-07 06:37:10 +00:00
|
|
|
int WilsonKernelsStatic::Opt = WilsonKernelsStatic::OptGeneric;
|
|
|
|
int WilsonKernelsStatic::Comms = WilsonKernelsStatic::CommsAndCompute;
|
2016-12-22 17:52:21 +00:00
|
|
|
|
|
|
|
#ifdef QPX
|
|
|
|
#include <spi/include/kernel/location.h>
|
|
|
|
#include <spi/include/l1p/types.h>
|
|
|
|
#include <hwi/include/bqc/l1p_mmio.h>
|
|
|
|
#include <hwi/include/bqc/A2_inlines.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void bgq_l1p_optimisation(int mode)
|
|
|
|
{
|
|
|
|
#ifdef QPX
|
|
|
|
#undef L1P_CFG_PF_USR
|
|
|
|
#define L1P_CFG_PF_USR (0x3fde8000108ll) /* (64 bit reg, 23 bits wide, user/unpriv) */
|
|
|
|
|
|
|
|
uint64_t cfg_pf_usr;
|
|
|
|
if ( mode ) {
|
|
|
|
cfg_pf_usr =
|
|
|
|
L1P_CFG_PF_USR_ifetch_depth(0)
|
|
|
|
| L1P_CFG_PF_USR_ifetch_max_footprint(1)
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_est_on_dcbt
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_establish_enable
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_optimistic
|
|
|
|
| L1P_CFG_PF_USR_pf_adaptive_throttle(0xF) ;
|
|
|
|
// if ( sizeof(Float) == sizeof(double) ) {
|
|
|
|
cfg_pf_usr |= L1P_CFG_PF_USR_dfetch_depth(2)| L1P_CFG_PF_USR_dfetch_max_footprint(3) ;
|
|
|
|
// } else {
|
|
|
|
// cfg_pf_usr |= L1P_CFG_PF_USR_dfetch_depth(1)| L1P_CFG_PF_USR_dfetch_max_footprint(2) ;
|
|
|
|
// }
|
|
|
|
} else {
|
|
|
|
cfg_pf_usr = L1P_CFG_PF_USR_dfetch_depth(1)
|
|
|
|
| L1P_CFG_PF_USR_dfetch_max_footprint(2)
|
|
|
|
| L1P_CFG_PF_USR_ifetch_depth(0)
|
|
|
|
| L1P_CFG_PF_USR_ifetch_max_footprint(1)
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_est_on_dcbt
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_establish_enable
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_optimistic
|
|
|
|
| L1P_CFG_PF_USR_pf_stream_prefetch_enable;
|
|
|
|
}
|
|
|
|
*((uint64_t *)L1P_CFG_PF_USR) = cfg_pf_usr;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
template <class Impl>
|
|
|
|
WilsonKernels<Impl>::WilsonKernels(const ImplParams &p) : Base(p){};
|
2015-12-10 22:55:00 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
////////////////////////////////////////////
|
|
|
|
// Generic implementation; move to different file?
|
|
|
|
////////////////////////////////////////////
|
|
|
|
|
|
|
|
template <class Impl>
|
2017-02-07 06:37:10 +00:00
|
|
|
void WilsonKernels<Impl>::GenericDhopSiteDag(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
2016-10-22 18:14:27 +01:00
|
|
|
SiteHalfSpinor *buf, int sF,
|
2017-02-07 06:37:10 +00:00
|
|
|
int sU, const FermionField &in, FermionField &out,
|
|
|
|
int interior,int exterior) {
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Xp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjXp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjXp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
} else {
|
|
|
|
chi_p = &buf[SE->_offset];
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
|
|
|
|
Impl::multLink(Uchi, U._odata[sU], *chi_p, Xp, 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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Yp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjYp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjYp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
} else {
|
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Zp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjZp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjZp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
} else {
|
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Tp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjTp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjTp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Xm, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjXm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjXm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Ym, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjYm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjYm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], *chi_p, Ym, 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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Zm, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjZm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjZm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Tm, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjTm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else {
|
|
|
|
spProjTm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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-07-18 16:36:28 +01:00
|
|
|
vstream(out._odata[sF], result);
|
2015-08-10 20:47:44 +01:00
|
|
|
};
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
// Need controls to do interior, exterior, or both
|
|
|
|
template <class Impl>
|
2017-02-07 06:37:10 +00:00
|
|
|
void WilsonKernels<Impl>::GenericDhopSite(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
2016-10-22 18:14:27 +01:00
|
|
|
SiteHalfSpinor *buf, int sF,
|
2017-02-07 06:37:10 +00:00
|
|
|
int sU, const FermionField &in, FermionField &out,int interior,int exterior) {
|
2016-07-18 16:36:28 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Xm, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjXp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjXp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
} else {
|
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Ym, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjYp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjYp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
} else {
|
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Zm, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjZp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjZp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
} else {
|
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Tm, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjTp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjTp(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Xp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjXm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjXm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Yp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjYm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjYm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Zp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjZm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
2016-01-03 01:38:11 +00:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
spProjZm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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
|
|
|
///////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, Tp, sF);
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_is_local) {
|
2016-03-27 05:24:07 +01:00
|
|
|
chi_p = χ
|
2016-07-18 16:36:28 +01:00
|
|
|
if (SE->_permute) {
|
|
|
|
spProjTm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else {
|
|
|
|
spProjTm(chi, in._odata[SE->_offset]);
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2016-03-27 05:24:07 +01:00
|
|
|
} else {
|
2016-07-18 16:36:28 +01:00
|
|
|
chi_p = &buf[SE->_offset];
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 16:36:28 +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-07-18 16:36:28 +01:00
|
|
|
vstream(out._odata[sF], result);
|
2016-01-03 01:38:11 +00:00
|
|
|
};
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
template <class Impl>
|
2017-02-07 06:37:10 +00:00
|
|
|
void WilsonKernels<Impl>::DhopDir( StencilImpl &st, DoubledGaugeField &U,SiteHalfSpinor *buf, int sF,
|
2016-10-22 18:14:27 +01:00
|
|
|
int sU, const FermionField &in, FermionField &out, int dir, int gamma) {
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteSpinor result;
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor Uchi;
|
2015-08-14 00:01:04 +01:00
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, dir, sF);
|
2015-08-10 20:47:44 +01:00
|
|
|
|
|
|
|
// Xp
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Xp) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjXp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjXp(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
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
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Yp) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjYp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjYp(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconYp(result, Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Zp
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Zp) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjZp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjZp(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconZp(result, Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Tp
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Tp) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjTp(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjTp(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconTp(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
|
|
|
// Xm
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Xm) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjXm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjXm(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconXm(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
|
|
|
// Ym
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Ym) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjYm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjYm(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconYm(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
|
|
|
// Zm
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Zm) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjZm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjZm(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconZm(result, Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// Tm
|
2016-07-18 16:36:28 +01:00
|
|
|
if (gamma == Tm) {
|
|
|
|
if (SE->_is_local && SE->_permute) {
|
|
|
|
spProjTm(tmp, in._odata[SE->_offset]);
|
|
|
|
permute(chi, tmp, ptype);
|
|
|
|
} else if (SE->_is_local) {
|
|
|
|
spProjTm(chi, in._odata[SE->_offset]);
|
|
|
|
} else {
|
|
|
|
chi = buf[SE->_offset];
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st);
|
|
|
|
spReconTm(result, Uchi);
|
2015-08-10 20:47:44 +01:00
|
|
|
}
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
vstream(out._odata[sF], result);
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
FermOpTemplateInstantiate(WilsonKernels);
|
|
|
|
AdjointFermOpTemplateInstantiate(WilsonKernels);
|
2016-09-22 14:17:37 +01:00
|
|
|
TwoIndexFermOpTemplateInstantiate(WilsonKernels);
|
2015-12-10 22:55:00 +00:00
|
|
|
|
2015-05-26 19:55:18 +01:00
|
|
|
}}
|
2016-08-30 18:21:36 +01:00
|
|
|
|