diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-07-20 10:53:03 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-07-20 10:53:03 +0200 |
commit | 88e352adac535403db3e5e7efa5fa3cb483c5c2e (patch) | |
tree | 0825041d46aa9dc5625f205102bb7d3c40281905 /Eigen/src/Core | |
parent | 6799c26cd6d5aba6223de287e7ea7e024c9b8eb1 (diff) |
Add support for replicate in CUDA
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r-- | Eigen/src/Core/DenseBase.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Replicate.h | 5 | ||||
-rw-r--r-- | Eigen/src/Core/VectorwiseOp.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 58f682dce..c603b5a6d 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -517,7 +517,9 @@ template<typename Derived> class DenseBase template<int p> RealScalar lpNorm() const; template<int RowFactor, int ColFactor> + EIGEN_DEVICE_FUNC const Replicate<Derived,RowFactor,ColFactor> replicate() const; + EIGEN_DEVICE_FUNC const Replicate<Derived,Dynamic,Dynamic> replicate(Index rowFacor,Index colFactor) const; typedef Reverse<Derived, BothDirections> ReverseReturnType; diff --git a/Eigen/src/Core/Replicate.h b/Eigen/src/Core/Replicate.h index d105de62b..518c52e57 100644 --- a/Eigen/src/Core/Replicate.h +++ b/Eigen/src/Core/Replicate.h @@ -69,6 +69,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate typedef typename internal::remove_all<MatrixType>::type NestedExpression; template<typename OriginalMatrixType> + EIGEN_DEVICE_FUNC inline explicit Replicate(const OriginalMatrixType& matrix) : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) { @@ -78,6 +79,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate } template<typename OriginalMatrixType> + EIGEN_DEVICE_FUNC inline Replicate(const OriginalMatrixType& matrix, Index rowFactor, Index colFactor) : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) { @@ -85,9 +87,12 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) } + EIGEN_DEVICE_FUNC inline Index rows() const { return m_matrix.rows() * m_rowFactor.value(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return m_matrix.cols() * m_colFactor.value(); } + EIGEN_DEVICE_FUNC const _MatrixTypeNested& nestedExpression() const { return m_matrix; diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index 5ebcdc100..0cc5eff16 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -461,6 +461,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp */ // NOTE implemented here because of sunstudio's compilation errors template<int Factor> const Replicate<ExpressionType,(IsVertical?Factor:1),(IsHorizontal?Factor:1)> + EIGEN_DEVICE_FUNC replicate(Index factor = Factor) const { return Replicate<ExpressionType,Direction==Vertical?Factor:1,Direction==Horizontal?Factor:1> |