mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Slightly faster Chebyshev; ifdef'ed out the fastest until tested numerics
Lifteed from HDCR setup
This commit is contained in:
parent
93920c4811
commit
1d65e2f62c
@ -234,10 +234,9 @@ public:
|
|||||||
|
|
||||||
GridBase *grid=in.Grid();
|
GridBase *grid=in.Grid();
|
||||||
|
|
||||||
// std::cout << "Chevyshef(): in.Grid()="<<in.Grid()<<std::endl;
|
|
||||||
//std::cout <<" Linop.Grid()="<<Linop.Grid()<<"Linop.RedBlackGrid()="<<Linop.RedBlackGrid()<<std::endl;
|
|
||||||
|
|
||||||
int vol=grid->gSites();
|
int vol=grid->gSites();
|
||||||
|
typedef typename Field::vector_type vector_type;
|
||||||
|
constexpr int Nsimd = vector_type::Nsimd();
|
||||||
|
|
||||||
Field T0(grid); T0 = in;
|
Field T0(grid); T0 = in;
|
||||||
Field T1(grid);
|
Field T1(grid);
|
||||||
@ -258,14 +257,27 @@ public:
|
|||||||
// out = ()*T0 + Coeffs[1]*T1;
|
// out = ()*T0 + Coeffs[1]*T1;
|
||||||
axpby(out,0.5*Coeffs[0],Coeffs[1],T0,T1);
|
axpby(out,0.5*Coeffs[0],Coeffs[1],T0,T1);
|
||||||
for(int n=2;n<order;n++){
|
for(int n=2;n<order;n++){
|
||||||
|
|
||||||
Linop.HermOp(*Tn,y);
|
Linop.HermOp(*Tn,y);
|
||||||
// y=xscale*y+mscale*(*Tn);
|
#if 0
|
||||||
// *Tnp=2.0*y-(*Tnm);
|
auto y_v = y.View();
|
||||||
// out=out+Coeffs[n]* (*Tnp);
|
auto Tn_v = Tn->View();
|
||||||
|
auto Tnp_v = Tnp->View();
|
||||||
|
auto Tnm_v = Tnm->View();
|
||||||
|
accelerator_forNB(ss, in.Grid()->oSites(), Nsimd, {
|
||||||
|
coalescedWrite(y_v[ss],xscale*y_v(ss)+mscale*Tn_v(ss));
|
||||||
|
coalescedWrite(Tnp_v[ss],2.0*y_v(ss)-Tnm_v(ss));
|
||||||
|
});
|
||||||
|
if ( Coeffs[n] != 0.0) {
|
||||||
|
axpy(out,Coeffs[n],*Tnp,out);
|
||||||
|
}
|
||||||
|
#else
|
||||||
axpby(y,xscale,mscale,y,(*Tn));
|
axpby(y,xscale,mscale,y,(*Tn));
|
||||||
axpby(*Tnp,2.0,-1.0,y,(*Tnm));
|
axpby(*Tnp,2.0,-1.0,y,(*Tnm));
|
||||||
axpy(out,Coeffs[n],*Tnp,out);
|
if ( Coeffs[n] != 0.0) {
|
||||||
|
axpy(out,Coeffs[n],*Tnp,out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// Cycle pointers to avoid copies
|
// Cycle pointers to avoid copies
|
||||||
Field *swizzle = Tnm;
|
Field *swizzle = Tnm;
|
||||||
Tnm =Tn;
|
Tnm =Tn;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user