mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-04 05:54:32 +00:00 
			
		
		
		
	fast local peek-poke
This commit is contained in:
		@@ -164,15 +164,17 @@ PARALLEL_FOR_LOOP
 | 
				
			|||||||
      assert( l.checkerboard== l._grid->CheckerBoard(site));
 | 
					      assert( l.checkerboard== l._grid->CheckerBoard(site));
 | 
				
			||||||
      assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
					      assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      static const int words=sizeof(vobj)/sizeof(vector_type);
 | 
				
			||||||
      int odx,idx;
 | 
					      int odx,idx;
 | 
				
			||||||
      idx= grid->iIndex(site);
 | 
					      idx= grid->iIndex(site);
 | 
				
			||||||
      odx= grid->oIndex(site);
 | 
					      odx= grid->oIndex(site);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      std::vector<sobj> buf(Nsimd);
 | 
					      scalar_type * vp = (scalar_type *)&l._odata[odx];
 | 
				
			||||||
 | 
					      scalar_type * pt = (scalar_type *)&s;
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      extract(l._odata[odx],buf);
 | 
					      for(int w=0;w<words;w++){
 | 
				
			||||||
      
 | 
					        pt[w] = vp[idx+w*Nsimd];
 | 
				
			||||||
      s = buf[idx];
 | 
					      }
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@@ -190,18 +192,17 @@ PARALLEL_FOR_LOOP
 | 
				
			|||||||
      assert( l.checkerboard== l._grid->CheckerBoard(site));
 | 
					      assert( l.checkerboard== l._grid->CheckerBoard(site));
 | 
				
			||||||
      assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
					      assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      static const int words=sizeof(vobj)/sizeof(vector_type);
 | 
				
			||||||
      int odx,idx;
 | 
					      int odx,idx;
 | 
				
			||||||
      idx= grid->iIndex(site);
 | 
					      idx= grid->iIndex(site);
 | 
				
			||||||
      odx= grid->oIndex(site);
 | 
					      odx= grid->oIndex(site);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      std::vector<sobj> buf(Nsimd);
 | 
					      scalar_type * vp = (scalar_type *)&l._odata[odx];
 | 
				
			||||||
 | 
					      scalar_type * pt = (scalar_type *)&s;
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      // extract-modify-merge cycle is easiest way and this is not perf critical
 | 
					      for(int w=0;w<words;w++){
 | 
				
			||||||
      extract(l._odata[odx],buf);
 | 
					        vp[idx+w*Nsimd] = pt[w];
 | 
				
			||||||
      
 | 
					      }
 | 
				
			||||||
      buf[idx] = s;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      merge(l._odata[odx],buf);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user