1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Coalesced loops

This commit is contained in:
Peter Boyle 2019-06-15 08:03:13 +01:00
parent 6b692aa726
commit 736358b0cb

View File

@ -43,8 +43,8 @@ inline Lattice<vobj> transpose(const Lattice<vobj> &lhs){
Lattice<vobj> ret(lhs.Grid());
auto ret_v = ret.View();
auto lhs_v = lhs.View();
accelerator_loop(ss,lhs_v,{
ret_v[ss] = transpose(lhs_v[ss]);
accelerator_for(ss,lhs_v.size(),vobj::Nsimd(),{
coalescedWrite(ret_v[ss], transpose(lhs_v(ss)));
});
return ret;
};
@ -58,8 +58,8 @@ inline auto TransposeIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(transpo
Lattice<decltype(transposeIndex<Index>(vobj()))> ret(lhs.Grid());
auto ret_v = ret.View();
auto lhs_v = lhs.View();
accelerator_loop(ss,lhs_v,{
ret_v[ss] = transposeIndex<Index>(lhs_v[ss]);
accelerator_for(ss,lhs_v.size(),vobj::Nsimd(),{
coalescedWrite(ret_v[ss] , transposeIndex<Index>(lhs_v(ss)));
});
return ret;
};