diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-07-15 10:57:55 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-07-15 10:57:55 +0200 |
commit | f5aa64086228ca9ccfa27e6086667fd0bdbad22c (patch) | |
tree | 3b71b5f0d326ea3a01713dcacfc0f4d8cd41013f /Eigen/src/Core/Visitor.h | |
parent | 7cecd39a849afec76305b76f5a121c10c2eafe09 (diff) |
Clean some previous changes and more cuda fixes
Diffstat (limited to 'Eigen/src/Core/Visitor.h')
-rw-r--r-- | Eigen/src/Core/Visitor.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index 06c8bbf11..374972d3e 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -22,6 +22,7 @@ struct visitor_impl row = (UnrollCount-1) % Derived::RowsAtCompileTime }; + EIGEN_DEVICE_FUNC static inline void run(const Derived &mat, Visitor& visitor) { visitor_impl<Visitor, Derived, UnrollCount-1>::run(mat, visitor); @@ -32,6 +33,7 @@ struct visitor_impl template<typename Visitor, typename Derived> struct visitor_impl<Visitor, Derived, 1> { + EIGEN_DEVICE_FUNC static inline void run(const Derived &mat, Visitor& visitor) { return visitor.init(mat.coeff(0, 0), 0, 0); @@ -41,6 +43,7 @@ struct visitor_impl<Visitor, Derived, 1> template<typename Visitor, typename Derived> struct visitor_impl<Visitor, Derived, Dynamic> { + EIGEN_DEVICE_FUNC static inline void run(const Derived& mat, Visitor& visitor) { visitor.init(mat.coeff(0,0), 0, 0); @@ -57,6 +60,7 @@ template<typename XprType> class visitor_evaluator { public: + EIGEN_DEVICE_FUNC explicit visitor_evaluator(const XprType &xpr) : m_evaluator(xpr), m_xpr(xpr) {} typedef typename XprType::Scalar Scalar; @@ -67,11 +71,11 @@ public: CoeffReadCost = internal::evaluator<XprType>::CoeffReadCost }; - Index rows() const { return m_xpr.rows(); } - Index cols() const { return m_xpr.cols(); } - Index size() const { return m_xpr.size(); } + EIGEN_DEVICE_FUNC Index rows() const { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC Index cols() const { return m_xpr.cols(); } + EIGEN_DEVICE_FUNC Index size() const { return m_xpr.size(); } - CoeffReturnType coeff(Index row, Index col) const + EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index row, Index col) const { return m_evaluator.coeff(row, col); } protected: |