From a2e199df50106da1f9eb63c1f14e12129951629f Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Tue, 4 Jun 2019 20:54:52 +0100 Subject: [PATCH] Simplifying Cayley cases. --- Grid/qcd/action/fermion/CayleyFermion5D.h | 80 +++++++++-------------- 1 file changed, 30 insertions(+), 50 deletions(-) diff --git a/Grid/qcd/action/fermion/CayleyFermion5D.h b/Grid/qcd/action/fermion/CayleyFermion5D.h index 916bd0c0..292dbf9c 100644 --- a/Grid/qcd/action/fermion/CayleyFermion5D.h +++ b/Grid/qcd/action/fermion/CayleyFermion5D.h @@ -26,13 +26,13 @@ Author: Peter Boyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#ifndef GRID_QCD_CAYLEY_FERMION_H -#define GRID_QCD_CAYLEY_FERMION_H +#pragma once #include NAMESPACE_BEGIN(Grid); +#if 0 template struct switcheroo { static inline int iscomplex() { return 0; } @@ -56,7 +56,7 @@ template<> struct switcheroo { return a*b; } }; - +#endif template class CayleyFermion5D : public WilsonFermion5D @@ -81,27 +81,27 @@ public: virtual void M5D (const FermionField &psi, FermionField &chi); virtual void M5Ddag(const FermionField &psi, FermionField &chi); - /////////////////////////////////////////////////////////////// - // Physical surface field utilities - /////////////////////////////////////////////////////////////// - virtual void Dminus(const FermionField &psi, FermionField &chi); - virtual void DminusDag(const FermionField &psi, FermionField &chi); - virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d); - virtual void ExportPhysicalFermionSource(const FermionField &solution5d, FermionField &exported4d); - virtual void ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d); - virtual void ImportUnphysicalFermion(const FermionField &solution5d, FermionField &exported4d); - - /////////////////////////////////////////////////////////////// - // Support for MADWF tricks - /////////////////////////////////////////////////////////////// - RealD Mass(void) { return mass; }; - void SetMass(RealD _mass) { - mass=_mass; - SetCoefficientsInternal(_zolo_hi,_gamma,_b,_c); // Reset coeffs - } ; - void P(const FermionField &psi, FermionField &chi); - void Pdag(const FermionField &psi, FermionField &chi); + /////////////////////////////////////////////////////////////// + // Physical surface field utilities + /////////////////////////////////////////////////////////////// + virtual void Dminus(const FermionField &psi, FermionField &chi); + virtual void DminusDag(const FermionField &psi, FermionField &chi); + virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d); + virtual void ExportPhysicalFermionSource(const FermionField &solution5d, FermionField &exported4d); + virtual void ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d); + virtual void ImportUnphysicalFermion(const FermionField &solution5d, FermionField &exported4d); + /////////////////////////////////////////////////////////////// + // Support for MADWF tricks + /////////////////////////////////////////////////////////////// + RealD Mass(void) { return mass; }; + void SetMass(RealD _mass) { + mass=_mass; + SetCoefficientsInternal(_zolo_hi,_gamma,_b,_c); // Reset coeffs + } ; + void P(const FermionField &psi, FermionField &chi); + void Pdag(const FermionField &psi, FermionField &chi); + ///////////////////////////////////////////////////// // Instantiate different versions depending on Impl ///////////////////////////////////////////////////// @@ -118,7 +118,7 @@ public: Vector &lower, Vector &diag, Vector &upper); - +#if 0 void MooeeInternal(const FermionField &in, FermionField &out,int dag,int inv); void MooeeInternalCompute(int dag, int inv, Vector > & Matp, Vector > & Matm); @@ -130,7 +130,7 @@ public: int LLs, int site, Vector > &Matp, Vector > &Matm); - +#endif virtual void Instantiatable(void)=0; @@ -148,11 +148,11 @@ public: // protected: RealD mass; - // Save arguments to SetCoefficientsInternal - Vector _gamma; - RealD _zolo_hi; - RealD _b; - RealD _c; + // Save arguments to SetCoefficientsInternal + Vector _gamma; + RealD _zolo_hi; + RealD _b; + RealD _c; // Cayley form Moebius (tanh and zolotarev) Vector omega; @@ -187,8 +187,6 @@ public: GridRedBlackCartesian &FourDimRedBlackGrid, RealD _mass,RealD _M5,const ImplParams &p= ImplParams()); - - void CayleyReport(void); void CayleyZeroCounters(void); @@ -208,21 +206,3 @@ protected: NAMESPACE_END(Grid); -#define INSTANTIATE_DPERP(A) \ - template void CayleyFermion5D< A >::M5D(const FermionField &psi,const FermionField &phi,FermionField &chi, \ - Vector &lower,Vector &diag,Vector &upper); \ - template void CayleyFermion5D< A >::M5Ddag(const FermionField &psi,const FermionField &phi,FermionField &chi, \ - Vector &lower,Vector &diag,Vector &upper); \ - template void CayleyFermion5D< A >::MooeeInv (const FermionField &psi, FermionField &chi); \ - template void CayleyFermion5D< A >::MooeeInvDag (const FermionField &psi, FermionField &chi); - -#ifdef GRID_NVCC -#define CAYLEY_DPERP_GPU -#else -#undef CAYLEY_DPERP_DENSE -#define CAYLEY_DPERP_CACHE -#undef CAYLEY_DPERP_LINALG -#endif -#define CAYLEY_DPERP_VEC - -#endif