diff --git a/Eigen/src/Core/functors/BinaryFunctors.h b/Eigen/src/Core/functors/BinaryFunctors.h index 90d8b7d1d..4962d625c 100644 --- a/Eigen/src/Core/functors/BinaryFunctors.h +++ b/Eigen/src/Core/functors/BinaryFunctors.h @@ -29,7 +29,7 @@ template struct scalar_sum_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const { return internal::padd(a,b); } template - EIGEN_STRONG_INLINE const Scalar predux(const Packet& a) const + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar predux(const Packet& a) const { return internal::predux(a); } }; template @@ -68,7 +68,7 @@ template struct scalar_product_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const { return internal::pmul(a,b); } template - EIGEN_STRONG_INLINE const result_type predux(const Packet& a) const + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type predux(const Packet& a) const { return internal::predux_mul(a); } }; template @@ -175,30 +175,37 @@ struct result_of(Scalar,Scalar)> { template struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return a==b;} }; template struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return a struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return a<=b;} }; template struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return a>b;} }; template struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return a>=b;} }; template struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return !(a<=b || b<=a);} }; template struct scalar_cmp_op { + typedef bool result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_cmp_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const Scalar& a, const Scalar& b) const {return a!=b;} }; @@ -448,9 +455,9 @@ struct functor_traits > */ template struct scalar_sub_op { - inline scalar_sub_op(const scalar_sub_op& other) : m_other(other.m_other) { } - inline scalar_sub_op(const Scalar& other) : m_other(other) { } - inline Scalar operator() (const Scalar& a) const { return a - m_other; } + EIGEN_DEVICE_FUNC inline scalar_sub_op(const scalar_sub_op& other) : m_other(other.m_other) { } + EIGEN_DEVICE_FUNC inline scalar_sub_op(const Scalar& other) : m_other(other) { } + EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return a - m_other; } template EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return internal::psub(a, pset1(m_other)); } @@ -466,9 +473,9 @@ struct functor_traits > */ template struct scalar_rsub_op { - inline scalar_rsub_op(const scalar_rsub_op& other) : m_other(other.m_other) { } - inline scalar_rsub_op(const Scalar& other) : m_other(other) { } - inline Scalar operator() (const Scalar& a) const { return m_other - a; } + EIGEN_DEVICE_FUNC inline scalar_rsub_op(const scalar_rsub_op& other) : m_other(other.m_other) { } + EIGEN_DEVICE_FUNC inline scalar_rsub_op(const Scalar& other) : m_other(other) { } + EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return m_other - a; } template EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const { return internal::psub(pset1(m_other), a); } @@ -485,8 +492,8 @@ struct functor_traits > template struct scalar_pow_op { // FIXME default copy constructors seems bugged with std::complex<> - inline scalar_pow_op(const scalar_pow_op& other) : m_exponent(other.m_exponent) { } - inline scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} + EIGEN_DEVICE_FUNC inline scalar_pow_op(const scalar_pow_op& other) : m_exponent(other.m_exponent) { } + EIGEN_DEVICE_FUNC inline scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return numext::pow(a, m_exponent); } const Scalar m_exponent; @@ -501,7 +508,7 @@ struct functor_traits > */ template struct scalar_inverse_mult_op { - scalar_inverse_mult_op(const Scalar& other) : m_other(other) {} + EIGEN_DEVICE_FUNC scalar_inverse_mult_op(const Scalar& other) : m_other(other) {} EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return m_other / a; } template EIGEN_DEVICE_FUNC inline const Packet packetOp(const Packet& a) const