mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-13 01:05:36 +00:00
Coalesced loops
This commit is contained in:
parent
f3c89df948
commit
7f99e1cd3b
@ -43,8 +43,8 @@ inline auto trace(const Lattice<vobj> &lhs) -> Lattice<decltype(trace(vobj()))>
|
|||||||
Lattice<decltype(trace(vobj()))> ret(lhs.Grid());
|
Lattice<decltype(trace(vobj()))> ret(lhs.Grid());
|
||||||
auto ret_v = ret.View();
|
auto ret_v = ret.View();
|
||||||
auto lhs_v = lhs.View();
|
auto lhs_v = lhs.View();
|
||||||
accelerator_loop( ss, lhs_v, {
|
accelerator_for( ss, lhs_v.size(), vobj::Nsimd(), {
|
||||||
ret_v[ss] = trace(lhs_v[ss]);
|
coalescedWrite(ret_v[ss], trace(lhs_v(ss)));
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
@ -58,8 +58,8 @@ inline auto TraceIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(traceIndex<
|
|||||||
Lattice<decltype(traceIndex<Index>(vobj()))> ret(lhs.Grid());
|
Lattice<decltype(traceIndex<Index>(vobj()))> ret(lhs.Grid());
|
||||||
auto ret_v = ret.View();
|
auto ret_v = ret.View();
|
||||||
auto lhs_v = lhs.View();
|
auto lhs_v = lhs.View();
|
||||||
accelerator_loop( ss, lhs_v, {
|
accelerator_for( ss, lhs_v.size(), vobj::Nsimd(), {
|
||||||
ret_v[ss] = traceIndex<Index>(lhs_v[ss]);
|
coalescedWrite(ret_v[ss], traceIndex<Index>(lhs_v(ss)));
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user