mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-10-30 19:44:32 +00:00 
			
		
		
		
	multRHS initial support -- needs optimisation for multi project/promote.
Bug fix in freeing intermediate grids to stop double free
This commit is contained in:
		| @@ -300,6 +300,7 @@ inline void blockProject(Lattice<iVector<CComplex,nbasis > > &coarseData, | ||||
|   //  std::cout << GridLogPerformance << " blockProject : conv              :  "<<t_co<<" us"<<std::endl; | ||||
|   //  std::cout << GridLogPerformance << " blockProject : blockZaxpy        :  "<<t_za<<" us"<<std::endl; | ||||
| } | ||||
|  | ||||
| // This only minimises data motion from CPU to GPU | ||||
| // there is chance of better implementation that does a vxk loop of inner products to data share | ||||
| // at the GPU thread level | ||||
| @@ -1802,5 +1803,32 @@ void Grid_unsplit(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split) | ||||
|   } | ||||
| } | ||||
|  | ||||
| ////////////////////////////////////////////////////// | ||||
| // MultiRHS interface support for coarse space | ||||
| // -- Simplest possible implementation to begin with | ||||
| ////////////////////////////////////////////////////// | ||||
| template<class vobj,class CComplex,int nbasis,class VLattice> | ||||
| inline void blockProjectMany(Lattice<iVector<CComplex,nbasis > > &coarseIP, | ||||
| 			     Lattice<iVector<CComplex,nbasis > > &coarseTMP, | ||||
| 			     const VLattice &fineData, // Basis and fineData necessarily same type | ||||
| 			     const VLattice &Basis) | ||||
| { | ||||
|   for(int r=0;r<fineData.size();r++){ | ||||
|     blockProject(coarseTMP,fineData[r],Basis); | ||||
|     InsertSliceLocal(coarseTMP, coarseIP,r,r,0); | ||||
|   } | ||||
| } | ||||
| template<class vobj,class CComplex,int nbasis,class VLattice> | ||||
| inline void blockPromoteMany(Lattice<iVector<CComplex,nbasis > > &coarseIP, | ||||
| 			     Lattice<iVector<CComplex,nbasis > > &coarseTMP, | ||||
| 			     const VLattice &fineData, // Basis and fineData necessarily same type | ||||
| 			     const VLattice &Basis) | ||||
| { | ||||
|   for(int r=0;r<fineData.size();r++){ | ||||
|     ExtractSliceLocal(coarseTMP, coarseIP,r,r,0); | ||||
|     blockPromote(coarseTMP,fineData[r],Basis); | ||||
|   } | ||||
| } | ||||
|  | ||||
| NAMESPACE_END(Grid); | ||||
|  | ||||
|   | ||||
| @@ -234,9 +234,12 @@ public: | ||||
|   } | ||||
|   void DeleteGrids(void) | ||||
|   { | ||||
|     Coordinate processors=unpadded_grid->_processors; | ||||
|     for(int d=0;d<grids.size();d++){ | ||||
|       if ( processors[d] > 1 ) {  | ||||
| 	delete grids[d]; | ||||
|       } | ||||
|     } | ||||
|     grids.resize(0); | ||||
|   }; | ||||
|   void AllocateGrids(void) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user