diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-07-31 15:30:50 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-07-31 15:30:50 +0200 |
commit | 6126ad801f89cb88d46ed0dae0d8e9448652c506 (patch) | |
tree | 5b1292c1e39a36b37d7960a529900dea049eb6d2 /Eigen/src/plugins/ArrayCwiseBinaryOps.h | |
parent | 2f593ee67cd2ce995fcf52560daf88774c7c64f2 (diff) |
Extend support for nvcc to Array objects and wrappers
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseBinaryOps.h')
-rw-r--r-- | Eigen/src/plugins/ArrayCwiseBinaryOps.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h index 5c8c476ee..2a77fd956 100644 --- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h @@ -3,6 +3,7 @@ * \sa MatrixBase::cwiseProduct */ template<typename OtherDerived> +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived) operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { @@ -14,6 +15,7 @@ operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const * \sa MatrixBase::cwiseQuotient */ template<typename OtherDerived> +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived> operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { @@ -33,6 +35,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(min,internal::scalar_min_op) * * \sa max() */ +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > #ifdef EIGEN_PARSED_BY_DOXYGEN @@ -58,6 +61,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(max,internal::scalar_max_op) * * \sa min() */ +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > #ifdef EIGEN_PARSED_BY_DOXYGEN @@ -143,12 +147,14 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator!=,std::not_equal_to) * * \sa operator+=(), operator-() */ +EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived> operator+(const Scalar& scalar) const { return CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>(derived(), internal::scalar_add_op<Scalar>(scalar)); } +EIGEN_DEVICE_FUNC friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived> operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other) { @@ -162,12 +168,14 @@ operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& * * \sa operator+(), operator-=() */ +EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived> operator-(const Scalar& scalar) const { return *this + (-scalar); } +EIGEN_DEVICE_FUNC friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> > operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other) { @@ -184,6 +192,7 @@ operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& * \sa operator||(), select() */ template<typename OtherDerived> +EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived> operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { @@ -202,6 +211,7 @@ operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const * \sa operator&&(), select() */ template<typename OtherDerived> +EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived> operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { @@ -209,3 +219,4 @@ operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL); return CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>(derived(),other.derived()); } + |