mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Accelerator loops
This commit is contained in:
parent
ba5ea5830b
commit
e737591918
@ -37,18 +37,18 @@ template<class obj> Lattice<obj> pow(const Lattice<obj> &rhs,RealD y){
|
|||||||
Lattice<obj> ret(rhs._grid);
|
Lattice<obj> ret(rhs._grid);
|
||||||
ret.checkerboard = rhs.checkerboard;
|
ret.checkerboard = rhs.checkerboard;
|
||||||
conformable(ret,rhs);
|
conformable(ret,rhs);
|
||||||
parallel_for(int ss=0;ss<rhs._grid->oSites();ss++){
|
accelerator_loop(ss,rhs,{
|
||||||
ret._odata[ss]=pow(rhs._odata[ss],y);
|
ret._odata[ss]=pow(rhs._odata[ss],y);
|
||||||
}
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
template<class obj> Lattice<obj> mod(const Lattice<obj> &rhs,Integer y){
|
template<class obj> Lattice<obj> mod(const Lattice<obj> &rhs,Integer y){
|
||||||
Lattice<obj> ret(rhs._grid);
|
Lattice<obj> ret(rhs._grid);
|
||||||
ret.checkerboard = rhs.checkerboard;
|
ret.checkerboard = rhs.checkerboard;
|
||||||
conformable(ret,rhs);
|
conformable(ret,rhs);
|
||||||
parallel_for(int ss=0;ss<rhs._grid->oSites();ss++){
|
accelerator_loop(ss,rhs,{
|
||||||
ret._odata[ss]=mod(rhs._odata[ss],y);
|
ret._odata[ss]=mod(rhs._odata[ss],y);
|
||||||
}
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,9 +56,9 @@ template<class obj> Lattice<obj> div(const Lattice<obj> &rhs,Integer y){
|
|||||||
Lattice<obj> ret(rhs._grid);
|
Lattice<obj> ret(rhs._grid);
|
||||||
ret.checkerboard = rhs.checkerboard;
|
ret.checkerboard = rhs.checkerboard;
|
||||||
conformable(ret,rhs);
|
conformable(ret,rhs);
|
||||||
parallel_for(int ss=0;ss<rhs._grid->oSites();ss++){
|
accelerator_loop(ss,rhs,{
|
||||||
ret._odata[ss]=div(rhs._odata[ss],y);
|
ret._odata[ss]=div(rhs._odata[ss],y);
|
||||||
}
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,10 +66,9 @@ template<class obj> Lattice<obj> expMat(const Lattice<obj> &rhs, RealD alpha, In
|
|||||||
Lattice<obj> ret(rhs._grid);
|
Lattice<obj> ret(rhs._grid);
|
||||||
ret.checkerboard = rhs.checkerboard;
|
ret.checkerboard = rhs.checkerboard;
|
||||||
conformable(ret,rhs);
|
conformable(ret,rhs);
|
||||||
parallel_for(int ss=0;ss<rhs._grid->oSites();ss++){
|
accelerator_loop(ss,rhs,{
|
||||||
ret._odata[ss]=Exponentiate(rhs._odata[ss],alpha, Nexp);
|
ret._odata[ss]=Exponentiate(rhs._odata[ss],alpha, Nexp);
|
||||||
}
|
});
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user