mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-15 02:05:37 +00:00
Fast axpy norm under CFLAG
This commit is contained in:
parent
54f1999030
commit
b728af903c
@ -257,17 +257,30 @@ void axpby(Lattice<vobj> &ret,sobj a,sobj b,const Lattice<vobj> &x,const Lattice
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define FAST_AXPY_NORM
|
||||||
template<class sobj,class vobj> inline
|
template<class sobj,class vobj> inline
|
||||||
RealD axpy_norm(Lattice<vobj> &ret,sobj a,const Lattice<vobj> &x,const Lattice<vobj> &y)
|
RealD axpy_norm(Lattice<vobj> &ret,sobj a,const Lattice<vobj> &x,const Lattice<vobj> &y)
|
||||||
{
|
{
|
||||||
GRID_TRACE("axpy_norm");
|
GRID_TRACE("axpy_norm");
|
||||||
|
#ifdef FAST_AXPY_NORM
|
||||||
return axpy_norm_fast(ret,a,x,y);
|
return axpy_norm_fast(ret,a,x,y);
|
||||||
|
#else
|
||||||
|
ret = a*x+y;
|
||||||
|
RealD nn=norm2(ret);
|
||||||
|
return nn;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
template<class sobj,class vobj> inline
|
template<class sobj,class vobj> inline
|
||||||
RealD axpby_norm(Lattice<vobj> &ret,sobj a,sobj b,const Lattice<vobj> &x,const Lattice<vobj> &y)
|
RealD axpby_norm(Lattice<vobj> &ret,sobj a,sobj b,const Lattice<vobj> &x,const Lattice<vobj> &y)
|
||||||
{
|
{
|
||||||
GRID_TRACE("axpby_norm");
|
GRID_TRACE("axpby_norm");
|
||||||
|
#ifdef FAST_AXPY_NORM
|
||||||
return axpby_norm_fast(ret,a,b,x,y);
|
return axpby_norm_fast(ret,a,b,x,y);
|
||||||
|
#else
|
||||||
|
ret = a*x+b*y;
|
||||||
|
RealD nn=norm2(ret);
|
||||||
|
return nn;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trace product
|
/// Trace product
|
||||||
|
Loading…
Reference in New Issue
Block a user