1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Merge branch 'feature/gpu-port' of https://github.com/paboyle/Grid into feature/gpu-port

This commit is contained in:
paboyle 2018-03-08 13:01:42 +00:00
commit 28b5572755

View File

@ -135,6 +135,7 @@ void CayleyFermion5D<Impl>::MooeeInv (const FermionField &psi_i, FermionField
{ {
chi_i.Checkerboard()=psi_i.Checkerboard(); chi_i.Checkerboard()=psi_i.Checkerboard();
GridBase *grid=psi_i.Grid(); GridBase *grid=psi_i.Grid();
auto psi = psi_i.View(); auto psi = psi_i.View();
auto chi = chi_i.View(); auto chi = chi_i.View();
@ -183,23 +184,12 @@ void CayleyFermion5D<Impl>::MooeeInvDag (const FermionField &psi_i, FermionField
chi_i.Checkerboard()=psi_i.Checkerboard(); chi_i.Checkerboard()=psi_i.Checkerboard();
GridBase *grid=psi_i.Grid(); GridBase *grid=psi_i.Grid();
int Ls=this->Ls; int Ls=this->Ls;
auto psi = psi_i.View(); auto psi = psi_i.View();
auto chi = chi_i.View(); auto chi = chi_i.View();
assert(psi.Checkerboard() == psi.Checkerboard()); assert(psi.Checkerboard() == psi.Checkerboard());
std::vector<Coeff_t> ueec(Ls);
std::vector<Coeff_t> deec(Ls);
std::vector<Coeff_t> leec(Ls);
std::vector<Coeff_t> ueemc(Ls);
std::vector<Coeff_t> leemc(Ls);
for(int s=0;s<ueec.size();s++){
ueec[s] = conjugate(uee[s]);
deec[s] = conjugate(dee[s]);
leec[s] = conjugate(lee[s]);
ueemc[s]= conjugate(ueem[s]);
leemc[s]= conjugate(leem[s]);
}
MooeeInvCalls++; MooeeInvCalls++;
MooeeInvTime-=usecond(); MooeeInvTime-=usecond();
@ -211,25 +201,25 @@ void CayleyFermion5D<Impl>::MooeeInvDag (const FermionField &psi_i, FermionField
chi[ss]=psi[ss]; chi[ss]=psi[ss];
for (int s=1;s<Ls;s++){ for (int s=1;s<Ls;s++){
spProj5m(tmp,chi[ss+s-1]); spProj5m(tmp,chi[ss+s-1]);
chi[ss+s] = psi[ss+s]-ueec[s-1]*tmp; chi[ss+s] = psi[ss+s]-conjugate(uee[s-1])*tmp;
} }
// U_m^{-\dagger} // U_m^{-\dagger}
for (int s=0;s<Ls-1;s++){ for (int s=0;s<Ls-1;s++){
spProj5p(tmp,chi[ss+s]); spProj5p(tmp,chi[ss+s]);
chi[ss+Ls-1] = chi[ss+Ls-1] - ueemc[s]*tmp; chi[ss+Ls-1] = chi[ss+Ls-1] - conjugate(ueem[s])*tmp;
} }
// L_m^{-\dagger} D^{-dagger} // L_m^{-\dagger} D^{-dagger}
for (int s=0;s<Ls-1;s++){ for (int s=0;s<Ls-1;s++){
spProj5m(tmp,chi[ss+Ls-1]); spProj5m(tmp,chi[ss+Ls-1]);
chi[ss+s] = (1.0/deec[s])*chi[ss+s]-(leemc[s]/deec[Ls-1])*tmp; chi[ss+s] = conjugate(1.0/dee[s])*chi[ss+s]-conjugate(leem[s]/dee[Ls-1])*tmp;
} }
chi[ss+Ls-1]= (1.0/deec[Ls-1])*chi[ss+Ls-1]; chi[ss+Ls-1]= conjugate(1.0/dee[Ls-1])*chi[ss+Ls-1];
// Apply L^{-dagger} // Apply L^{-dagger}
for (int s=Ls-2;s>=0;s--){ for (int s=Ls-2;s>=0;s--){
spProj5p(tmp,chi[ss+s+1]); spProj5p(tmp,chi[ss+s+1]);
chi[ss+s] = chi[ss+s] - leec[s]*tmp; chi[ss+s] = chi[ss+s] - conjugate(lee[s])*tmp;
} }
}); });