From b5e87e8d9746ead5baffa477063d119232db3d8e Mon Sep 17 00:00:00 2001 From: Christoph Lehner Date: Fri, 12 Jun 2020 18:16:12 -0400 Subject: [PATCH] summit compile fixes --- Grid/algorithms/CoarsenedMatrix.h | 33 +++++++++++++++++++++++++++++++ Grid/allocator/MemoryManager.h | 2 +- Grid/lattice/Lattice_transfer.h | 19 +++++++++--------- Grid/lattice/Lattice_view.h | 7 +++++-- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/Grid/algorithms/CoarsenedMatrix.h b/Grid/algorithms/CoarsenedMatrix.h index e56b39c5..8d184aea 100644 --- a/Grid/algorithms/CoarsenedMatrix.h +++ b/Grid/algorithms/CoarsenedMatrix.h @@ -120,6 +120,39 @@ public: blockPromote(CoarseVec,FineVec,subspace); } + virtual void CreateSubspace(GridParallelRNG &RNG,LinearOperatorBase &hermop,int nn=nbasis) { + + RealD scale; + + ConjugateGradient CG(1.0e-2,100,false); + FineField noise(FineGrid); + FineField Mn(FineGrid); + + for(int b=0;b "< "< & out, const Lattice & in) { //////////////////////////////////////////////////////////////////////////////////////////// template inline auto localInnerProductD(const Lattice &lhs,const Lattice &rhs) --> Lattice> +-> Lattice> { autoView( lhs_v , lhs, AcceleratorRead); autoView( rhs_v , rhs, AcceleratorRead); @@ -283,7 +283,7 @@ template Lattice coarse_inner(coarse); // Precision promotion - fine_inner = localInnerProductD(fineX,fineY); + fine_inner = localInnerProductD(fineX,fineY); blockSum(coarse_inner,fine_inner); { autoView( CoarseInner_ , CoarseInner,AcceleratorWrite); @@ -486,13 +486,14 @@ inline void blockPromote(const Lattice > &coarseData, for(int i=0;i > ip = PeekIndex<0>(coarseData,i); - Lattice cip(coarse); - autoView( cip_ , cip, AcceleratorWrite); - autoView( ip_ , ip, AcceleratorRead); - accelerator_forNB(sc,coarse->oSites(),CComplex::Nsimd(),{ - coalescedWrite(cip_[sc], ip_(sc)()); - }); - blockZAXPY(fineData,cip,Basis[i],fineData); + //Lattice cip(coarse); + //autoView( cip_ , cip, AcceleratorWrite); + //autoView( ip_ , ip, AcceleratorRead); + //accelerator_forNB(sc,coarse->oSites(),CComplex::Nsimd(),{ + // coalescedWrite(cip_[sc], ip_(sc)()); + // }); + //blockZAXPY(fineData,cip,Basis[i],fineData); + blockZAXPY(fineData,ip,Basis[i],fineData); } } #endif diff --git a/Grid/lattice/Lattice_view.h b/Grid/lattice/Lattice_view.h index d21ab874..a10acd87 100644 --- a/Grid/lattice/Lattice_view.h +++ b/Grid/lattice/Lattice_view.h @@ -30,11 +30,14 @@ protected: int checkerboard; vobj *_odata; // A managed pointer uint64_t _odata_size; + ViewAdvise advise; public: - accelerator_inline LatticeAccelerator() : checkerboard(0), _odata(nullptr), _odata_size(0), _grid(nullptr) { }; + accelerator_inline LatticeAccelerator() : checkerboard(0), _odata(nullptr), _odata_size(0), _grid(nullptr), advise(AdviseDefault) { }; accelerator_inline uint64_t oSites(void) const { return _odata_size; }; accelerator_inline int Checkerboard(void) const { return checkerboard; }; accelerator_inline int &Checkerboard(void) { return this->checkerboard; }; // can assign checkerboard on a container, not a view + accelerator_inline ViewAdvise Advise(void) const { return advise; }; + accelerator_inline ViewAdvise &Advise(void) { return this->advise; }; // can assign advise on a container, not a view accelerator_inline void Conformable(GridBase * &grid) const { if (grid) conformable(grid, _grid); @@ -86,7 +89,7 @@ public: MemoryManager::ViewOpen(this->cpu_ptr, this->_odata_size*sizeof(vobj), mode, - AdviseDefault); + this->advise); } void ViewClose(void) { // Inform the manager