mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +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());
|
||||
auto ret_v = ret.View();
|
||||
auto lhs_v = lhs.View();
|
||||
accelerator_loop( ss, lhs_v, {
|
||||
ret_v[ss] = trace(lhs_v[ss]);
|
||||
accelerator_for( ss, lhs_v.size(), vobj::Nsimd(), {
|
||||
coalescedWrite(ret_v[ss], trace(lhs_v(ss)));
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
@ -58,8 +58,8 @@ inline auto TraceIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(traceIndex<
|
||||
Lattice<decltype(traceIndex<Index>(vobj()))> ret(lhs.Grid());
|
||||
auto ret_v = ret.View();
|
||||
auto lhs_v = lhs.View();
|
||||
accelerator_loop( ss, lhs_v, {
|
||||
ret_v[ss] = traceIndex<Index>(lhs_v[ss]);
|
||||
accelerator_for( ss, lhs_v.size(), vobj::Nsimd(), {
|
||||
coalescedWrite(ret_v[ss], traceIndex<Index>(lhs_v(ss)));
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user