diff --git a/Grid/lattice/Lattice_arith.h b/Grid/lattice/Lattice_arith.h index 5b37532f..f40d23da 100644 --- a/Grid/lattice/Lattice_arith.h +++ b/Grid/lattice/Lattice_arith.h @@ -257,17 +257,30 @@ void axpby(Lattice &ret,sobj a,sobj b,const Lattice &x,const Lattice }); } +#define FAST_AXPY_NORM template inline RealD axpy_norm(Lattice &ret,sobj a,const Lattice &x,const Lattice &y) { GRID_TRACE("axpy_norm"); - return axpy_norm_fast(ret,a,x,y); +#ifdef FAST_AXPY_NORM + return axpy_norm_fast(ret,a,x,y); +#else + ret = a*x+y; + RealD nn=norm2(ret); + return nn; +#endif } template inline RealD axpby_norm(Lattice &ret,sobj a,sobj b,const Lattice &x,const Lattice &y) { GRID_TRACE("axpby_norm"); - return axpby_norm_fast(ret,a,b,x,y); +#ifdef FAST_AXPY_NORM + return axpby_norm_fast(ret,a,b,x,y); +#else + ret = a*x+b*y; + RealD nn=norm2(ret); + return nn; +#endif } /// Trace product