mirror of
https://github.com/paboyle/Grid.git
synced 2026-10-04 06:58:05 +01:00
Accelerator loosp
This commit is contained in:
1 parent
d70709a8e8
commit
e9c8ba5ef7
1 file changed
+4
-4
@@ -42,9 +42,9 @@ inline auto trace(const Lattice<vobj> &lhs)
|
||||
-> Lattice<decltype(trace(lhs._odata[0]))>
|
||||
{
|
||||
Lattice<decltype(trace(lhs._odata[0]))> ret(lhs._grid);
|
||||
parallel_for(int ss=0;ss<lhs._grid->oSites();ss++){
|
||||
accelerator_loop( ss, lhs, {
|
||||
ret._odata[ss] = trace(lhs._odata[ss]);
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
@@ -55,9 +55,9 @@ template<int Index,class vobj>
|
||||
inline auto TraceIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(traceIndex<Index>(lhs._odata[0]))>
|
||||
{
|
||||
Lattice<decltype(traceIndex<Index>(lhs._odata[0]))> ret(lhs._grid);
|
||||
parallel_for(int ss=0;ss<lhs._grid->oSites();ss++){
|
||||
accelerator_loop( ss, lhs, {
|
||||
ret._odata[ss] = traceIndex<Index>(lhs._odata[ss]);
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user