1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

Rationalise number of loop macros

This commit is contained in:
Peter Boyle 2019-06-15 07:57:40 +01:00
parent bcbb5e9d26
commit 8e27338df2

View File

@ -48,8 +48,8 @@ auto PeekIndex(const Lattice<vobj> &lhs,int i) -> Lattice<decltype(peekIndex<Ind
ret.Checkerboard()=lhs.Checkerboard(); ret.Checkerboard()=lhs.Checkerboard();
auto ret_v = ret.View(); auto ret_v = ret.View();
auto lhs_v = lhs.View(); auto lhs_v = lhs.View();
cpu_loop( ss, lhs_v, { thread_for( ss, lhs_v.size(), {
ret_v[ss] = peekIndex<Index>(lhs_v[ss],i); ret_v[ss] = peekIndex<Index>(lhs_v[ss],i);
}); });
return ret; return ret;
}; };
@ -60,7 +60,7 @@ auto PeekIndex(const Lattice<vobj> &lhs,int i,int j) -> Lattice<decltype(peekInd
ret.Checkerboard()=lhs.Checkerboard(); ret.Checkerboard()=lhs.Checkerboard();
auto ret_v = ret.View(); auto ret_v = ret.View();
auto lhs_v = lhs.View(); auto lhs_v = lhs.View();
cpu_loop( ss, lhs_v, { thread_for( ss, lhs_v.size(), {
ret_v[ss] = peekIndex<Index>(lhs_v[ss],i,j); ret_v[ss] = peekIndex<Index>(lhs_v[ss],i,j);
}); });
return ret; return ret;
@ -74,7 +74,7 @@ void PokeIndex(Lattice<vobj> &lhs,const Lattice<decltype(peekIndex<Index>(vobj()
{ {
auto rhs_v = rhs.View(); auto rhs_v = rhs.View();
auto lhs_v = lhs.View(); auto lhs_v = lhs.View();
cpu_loop( ss, lhs_v, { thread_for( ss, lhs_v.size(), {
pokeIndex<Index>(lhs_v[ss],rhs_v[ss],i); pokeIndex<Index>(lhs_v[ss],rhs_v[ss],i);
}); });
} }
@ -83,7 +83,7 @@ void PokeIndex(Lattice<vobj> &lhs,const Lattice<decltype(peekIndex<Index>(vobj()
{ {
auto rhs_v = rhs.View(); auto rhs_v = rhs.View();
auto lhs_v = lhs.View(); auto lhs_v = lhs.View();
cpu_loop( ss, lhs_v, { thread_for( ss, lhs_v.size(), {
pokeIndex<Index>(lhs_v[ss],rhs_v[ss],i,j); pokeIndex<Index>(lhs_v[ss],rhs_v[ss],i,j);
}); });
} }