From defd814750bb248944f266bccffbd54f205ca24e Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 22 Dec 2023 18:07:03 -0500 Subject: [PATCH] Speed up the coarsened matrix matrix evaluation. It is block project limited. Could be sped up with calls to Batched GEMM and a data layout change. --- .../multigrid/GeneralCoarsenedMatrix.h | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h b/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h index bedcf199..31172fa4 100644 --- a/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h +++ b/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h @@ -50,6 +50,7 @@ public: typedef iVector Cvec; typedef Lattice< CComplex > CoarseScalar; // used for inner products on fine field typedef Lattice FineField; + typedef Lattice FineComplexField; typedef CoarseVector Field; //////////////////// // Data members @@ -308,6 +309,7 @@ public: RealD teigen=0.0; RealD tmat=0.0; RealD tphase=0.0; + RealD tphaseBZ=0.0; RealD tinv=0.0; ///////////////////////////////////////////////////////////// @@ -362,28 +364,41 @@ public: /////////////////////////////////////////////////////////////////////// FineField phaV(grid); // Phased block basis vector FineField MphaV(grid);// Matrix applied + std::vector phaF(npoint,grid); + std::vector pha(npoint,CoarseGrid()); + CoarseVector coarseInner(CoarseGrid()); + + typedef typename CComplex::scalar_type SComplex; + FineComplexField one(grid); one=SComplex(1.0); + FineComplexField zz(grid); zz = Zero(); + tphase=-usecond(); + for(int p=0;p ComputeProj(npoint,CoarseGrid()); std::vector FT(npoint,CoarseGrid()); for(int i=0;i