From 7cc3435ba8b2fcc554d69326cbf81e63b54960f2 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Wed, 18 Oct 2023 22:41:53 -0400 Subject: [PATCH] Imporved General coarsened matrix --- .../multigrid/GeneralCoarsenedMatrix.h | 81 +++++++++++-------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h b/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h index 9b9b71cb..3d051067 100644 --- a/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h +++ b/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h @@ -47,6 +47,7 @@ public: typedef Lattice CoarseVector; typedef Lattice > CoarseMatrix; typedef iMatrix Cobj; + typedef iVector Cvec; typedef Lattice< CComplex > CoarseScalar; // used for inner products on fine field typedef Lattice FineField; typedef CoarseVector Field; @@ -136,61 +137,76 @@ public: CoarseVector tin=in; texch-=usecond(); - CoarseVector pin = Cell.Exchange(tin); + // CoarseVector pin = Cell.Exchange(tin); + CoarseVector pin = Cell.ExchangeTest(tin); texch+=usecond(); - CoarseVector pout(pin.Grid()); pout=Zero(); + CoarseVector pout(pin.Grid()); int npoint = geom.npoint; typedef LatticeView Aview; + typedef LatticeView Vview; const int Nsimd = CComplex::Nsimd(); int64_t osites=pin.Grid()->oSites(); - // int gsites=pin.Grid()->gSites(); RealD flops = 1.0* npoint * nbasis * nbasis * 8.0 * osites * CComplex::Nsimd(); RealD bytes = 1.0*osites*sizeof(siteMatrix)*npoint + 2.0*osites*sizeof(siteVector)*npoint; - // for(int point=0;point AcceleratorViewContainer; AcceleratorViewContainer.reserve(npoint); + Vector AcceleratorVecViewContainer; AcceleratorVecViewContainer.reserve(npoint); + std::vector outp(npoint,pin.Grid()); + + tviews-=usecond(); + for(int p=0;p_offset],SE->_permute,Nd); - auto res = out_v(ss)(b); - for(int bb=0;bb_offset],SE->_permute,Nd); + auto res = coalescedRead(Aview_p[point][ss](b,0))*nbr(0); + for(int bb=1;bb