mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Acceleartor loops
This commit is contained in:
parent
43f244badf
commit
ba5ea5830b
@ -41,9 +41,9 @@ NAMESPACE_BEGIN(Grid);
|
|||||||
template<class vobj>
|
template<class vobj>
|
||||||
inline Lattice<vobj> transpose(const Lattice<vobj> &lhs){
|
inline Lattice<vobj> transpose(const Lattice<vobj> &lhs){
|
||||||
Lattice<vobj> ret(lhs._grid);
|
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]);
|
ret._odata[ss] = transpose(lhs._odata[ss]);
|
||||||
}
|
});
|
||||||
return ret;
|
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]))>
|
inline auto TransposeIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(transposeIndex<Index>(lhs._odata[0]))>
|
||||||
{
|
{
|
||||||
Lattice<decltype(transposeIndex<Index>(lhs._odata[0]))> ret(lhs._grid);
|
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]);
|
ret._odata[ss] = transposeIndex<Index>(lhs._odata[ss]);
|
||||||
}
|
});
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user