From 5adcc6c7b48b7a213af91bc123a02ab87751228e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 7 Feb 2013 19:06:14 +0100 Subject: Add support for NVCC5: most of the Core and part of LU are callable from CUDA code. Still a lot to do. --- Eigen/src/Core/Array.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Eigen/src/Core/Array.h') diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 539e1d22b..707a9d7f2 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -69,6 +69,7 @@ class Array * the usage of 'using'. This should be done only for operator=. */ template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& operator=(const EigenBase &other) { return Base::operator=(other); @@ -84,6 +85,7 @@ class Array * remain row-vectors and vectors remain vectors. */ template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& operator=(const ArrayBase& other) { return Base::_set(other); @@ -92,6 +94,7 @@ class Array /** This is a special case of the templated operator=. Its purpose is to * prevent a default operator= from hiding the templated operator=. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& operator=(const Array& other) { return Base::_set(other); @@ -107,6 +110,7 @@ class Array * * \sa resize(Index,Index) */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit Array() : Base() { Base::_check_template_params(); @@ -116,6 +120,7 @@ class Array #ifndef EIGEN_PARSED_BY_DOXYGEN // FIXME is it still needed ?? /** \internal */ + EIGEN_DEVICE_FUNC Array(internal::constructor_without_unaligned_array_assert) : Base(internal::constructor_without_unaligned_array_assert()) { @@ -130,6 +135,7 @@ class Array * it is redundant to pass the dimension here, so it makes more sense to use the default * constructor Matrix() instead. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit Array(Index dim) : Base(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim) { @@ -142,6 +148,7 @@ class Array #ifndef EIGEN_PARSED_BY_DOXYGEN template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const T0& val0, const T1& val1) { Base::_check_template_params(); @@ -159,6 +166,7 @@ class Array #endif /** constructs an initialized 3D vector with given coefficients */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2) { Base::_check_template_params(); @@ -168,6 +176,7 @@ class Array m_storage.data()[2] = val2; } /** constructs an initialized 4D vector with given coefficients */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2, const Scalar& val3) { Base::_check_template_params(); @@ -178,10 +187,11 @@ class Array m_storage.data()[3] = val3; } - explicit Array(const Scalar *data); + EIGEN_DEVICE_FUNC explicit Array(const Scalar *data); /** Constructor copying the value of the expression \a other */ template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const ArrayBase& other) : Base(other.rows() * other.cols(), other.rows(), other.cols()) { @@ -189,6 +199,7 @@ class Array Base::_set_noalias(other); } /** Copy constructor */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const Array& other) : Base(other.rows() * other.cols(), other.rows(), other.cols()) { @@ -197,6 +208,7 @@ class Array } /** Copy constructor with in-place evaluation */ template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const ReturnByValue& other) { Base::_check_template_params(); @@ -206,6 +218,7 @@ class Array /** \sa MatrixBase::operator=(const EigenBase&) */ template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const EigenBase &other) : Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols()) { @@ -221,8 +234,8 @@ class Array void swap(ArrayBase const & other) { this->_swap(other.derived()); } - inline Index innerStride() const { return 1; } - inline Index outerStride() const { return this->innerSize(); } + EIGEN_DEVICE_FUNC inline Index innerStride() const { return 1; } + EIGEN_DEVICE_FUNC inline Index outerStride() const { return this->innerSize(); } #ifdef EIGEN_ARRAY_PLUGIN #include EIGEN_ARRAY_PLUGIN -- cgit v1.2.3