diff --git a/lib/simd/Grid_vector_unops.h b/lib/simd/Grid_vector_unops.h index bb8ab5a5..d225699b 100644 --- a/lib/simd/Grid_vector_unops.h +++ b/lib/simd/Grid_vector_unops.h @@ -38,142 +38,142 @@ NAMESPACE_BEGIN(Grid); template struct SqrtRealFunctor { - scalar operator()(const scalar &a) const { return sqrt(real(a)); } + accelerator scalar operator()(const scalar &a) const { return sqrt(real(a)); } }; template struct RSqrtRealFunctor { - scalar operator()(const scalar &a) const { + accelerator scalar operator()(const scalar &a) const { return scalar(1.0 / sqrt(real(a))); } }; template struct CosRealFunctor { - scalar operator()(const scalar &a) const { return cos(real(a)); } + accelerator scalar operator()(const scalar &a) const { return cos(real(a)); } }; template struct SinRealFunctor { - scalar operator()(const scalar &a) const { return sin(real(a)); } + accelerator scalar operator()(const scalar &a) const { return sin(real(a)); } }; template struct AcosRealFunctor { - scalar operator()(const scalar &a) const { return acos(real(a)); } + accelerator scalar operator()(const scalar &a) const { return acos(real(a)); } }; template struct AsinRealFunctor { - scalar operator()(const scalar &a) const { return asin(real(a)); } + accelerator scalar operator()(const scalar &a) const { return asin(real(a)); } }; template struct LogRealFunctor { - scalar operator()(const scalar &a) const { return log(real(a)); } + accelerator scalar operator()(const scalar &a) const { return log(real(a)); } }; template struct ExpFunctor { - scalar operator()(const scalar &a) const { return exp(a); } + accelerator scalar operator()(const scalar &a) const { return exp(a); } }; template struct NotFunctor { - scalar operator()(const scalar &a) const { return (!a); } + accelerator scalar operator()(const scalar &a) const { return (!a); } }; template struct AbsRealFunctor { - scalar operator()(const scalar &a) const { return std::abs(real(a)); } + accelerator scalar operator()(const scalar &a) const { return std::abs(real(a)); } }; template struct PowRealFunctor { double y; - PowRealFunctor(double _y) : y(_y){}; - scalar operator()(const scalar &a) const { return pow(real(a), y); } + accelerator PowRealFunctor(double _y) : y(_y){}; + accelerator scalar operator()(const scalar &a) const { return pow(real(a), y); } }; template struct ModIntFunctor { Integer y; - ModIntFunctor(Integer _y) : y(_y){}; - scalar operator()(const scalar &a) const { return Integer(a) % y; } + accelerator ModIntFunctor(Integer _y) : y(_y){}; + accelerator scalar operator()(const scalar &a) const { return Integer(a) % y; } }; template struct DivIntFunctor { Integer y; - DivIntFunctor(Integer _y) : y(_y){}; - scalar operator()(const scalar &a) const { return Integer(a) / y; } + accelerator DivIntFunctor(Integer _y) : y(_y){}; + accelerator scalar operator()(const scalar &a) const { return Integer(a) / y; } }; template struct RealFunctor { - scalar operator()(const scalar &a) const { return std::real(a); } + accelerator scalar operator()(const scalar &a) const { return real(a); } }; template struct ImagFunctor { - scalar operator()(const scalar &a) const { return std::imag(a); } + accelerator scalar operator()(const scalar &a) const { return imag(a); } }; template -inline Grid_simd real(const Grid_simd &r) { +accelerator_inline Grid_simd real(const Grid_simd &r) { return SimdApply(RealFunctor(), r); } template -inline Grid_simd imag(const Grid_simd &r) { +accelerator_inline Grid_simd imag(const Grid_simd &r) { return SimdApply(ImagFunctor(), r); } template -inline Grid_simd sqrt(const Grid_simd &r) { +accelerator_inline Grid_simd sqrt(const Grid_simd &r) { return SimdApply(SqrtRealFunctor(), r); } template -inline Grid_simd rsqrt(const Grid_simd &r) { +accelerator_inline Grid_simd rsqrt(const Grid_simd &r) { return SimdApply(RSqrtRealFunctor(), r); } template -inline Scalar rsqrt(const Scalar &r) { +accelerator_inline Scalar rsqrt(const Scalar &r) { return (RSqrtRealFunctor(), r); } template -inline Grid_simd cos(const Grid_simd &r) { +accelerator_inline Grid_simd cos(const Grid_simd &r) { return SimdApply(CosRealFunctor(), r); } template -inline Grid_simd sin(const Grid_simd &r) { +accelerator_inline Grid_simd sin(const Grid_simd &r) { return SimdApply(SinRealFunctor(), r); } template -inline Grid_simd acos(const Grid_simd &r) { +accelerator_inline Grid_simd acos(const Grid_simd &r) { return SimdApply(AcosRealFunctor(), r); } template -inline Grid_simd asin(const Grid_simd &r) { +accelerator_inline Grid_simd asin(const Grid_simd &r) { return SimdApply(AsinRealFunctor(), r); } template -inline Grid_simd log(const Grid_simd &r) { +accelerator_inline Grid_simd log(const Grid_simd &r) { return SimdApply(LogRealFunctor(), r); } template -inline Grid_simd abs(const Grid_simd &r) { +accelerator_inline Grid_simd abs(const Grid_simd &r) { return SimdApply(AbsRealFunctor(), r); } template -inline Grid_simd exp(const Grid_simd &r) { +accelerator_inline Grid_simd exp(const Grid_simd &r) { return SimdApply(ExpFunctor(), r); } template -inline Grid_simd Not(const Grid_simd &r) { +accelerator_inline Grid_simd Not(const Grid_simd &r) { return SimdApply(NotFunctor(), r); } template -inline Grid_simd pow(const Grid_simd &r, double y) { +accelerator_inline Grid_simd pow(const Grid_simd &r, double y) { return SimdApply(PowRealFunctor(y), r); } template -inline Grid_simd mod(const Grid_simd &r, Integer y) { +accelerator_inline Grid_simd mod(const Grid_simd &r, Integer y) { return SimdApply(ModIntFunctor(y), r); } template -inline Grid_simd div(const Grid_simd &r, Integer y) { +accelerator_inline Grid_simd div(const Grid_simd &r, Integer y) { return SimdApply(DivIntFunctor(y), r); } //////////////////////////////////////////////////////////////////////////// @@ -181,41 +181,41 @@ inline Grid_simd div(const Grid_simd &r, Integer y) { //////////////////////////////////////////////////////////////////////////// template struct AndFunctor { - scalar operator()(const scalar &x, const scalar &y) const { return x & y; } + accelerator scalar operator()(const scalar &x, const scalar &y) const { return x & y; } }; template struct OrFunctor { - scalar operator()(const scalar &x, const scalar &y) const { return x | y; } + accelerator scalar operator()(const scalar &x, const scalar &y) const { return x | y; } }; template struct AndAndFunctor { - scalar operator()(const scalar &x, const scalar &y) const { return x && y; } + accelerator scalar operator()(const scalar &x, const scalar &y) const { return x && y; } }; template struct OrOrFunctor { - scalar operator()(const scalar &x, const scalar &y) const { return x || y; } + accelerator scalar operator()(const scalar &x, const scalar &y) const { return x || y; } }; //////////////////////////////// // Calls to simd binop functors //////////////////////////////// template -inline Grid_simd operator&(const Grid_simd &x, +accelerator_inline Grid_simd operator&(const Grid_simd &x, const Grid_simd &y) { return SimdApplyBinop(AndFunctor(), x, y); } template -inline Grid_simd operator&&(const Grid_simd &x, +accelerator_inline Grid_simd operator&&(const Grid_simd &x, const Grid_simd &y) { return SimdApplyBinop(AndAndFunctor(), x, y); } template -inline Grid_simd operator|(const Grid_simd &x, +accelerator_inline Grid_simd operator|(const Grid_simd &x, const Grid_simd &y) { return SimdApplyBinop(OrFunctor(), x, y); } template -inline Grid_simd operator||(const Grid_simd &x, +accelerator_inline Grid_simd operator||(const Grid_simd &x, const Grid_simd &y) { return SimdApplyBinop(OrOrFunctor(), x, y); }