1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Acceleartor loops

This commit is contained in:
paboyle 2018-01-24 13:40:56 +00:00
parent 43f244badf
commit ba5ea5830b

View File

@ -41,9 +41,9 @@ NAMESPACE_BEGIN(Grid);
template<class vobj>
inline Lattice<vobj> transpose(const Lattice<vobj> &lhs){
Lattice<vobj> ret(lhs._grid);
parallel_for(int ss=0;ss<lhs._grid->oSites();ss++){
accelerator_loop(ss,lhs,{
ret._odata[ss] = transpose(lhs._odata[ss]);
}
});
return ret;
};
@ -54,9 +54,9 @@ template<int Index,class vobj>
inline auto TransposeIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(transposeIndex<Index>(lhs._odata[0]))>
{
Lattice<decltype(transposeIndex<Index>(lhs._odata[0]))> ret(lhs._grid);
parallel_for(int ss=0;ss<lhs._grid->oSites();ss++){
accelerator_loop(ss,lhs,{
ret._odata[ss] = transposeIndex<Index>(lhs._odata[ss]);
}
});
return ret;
};