aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Array.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-02-07 19:06:14 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-02-07 19:06:14 +0100
commit5adcc6c7b48b7a213af91bc123a02ab87751228e (patch)
tree5e0ee840a8fb9acbbb48c5c48f1bffe0ca3cfe2a /Eigen/src/Core/Array.h
parente4ec63aee7233f5b934abc0b1d9ceada79a844ee (diff)
Add support for NVCC5: most of the Core and part of LU are callable from CUDA code.
Still a lot to do.
Diffstat (limited to 'Eigen/src/Core/Array.h')
-rw-r--r--Eigen/src/Core/Array.h19
1 files changed, 16 insertions, 3 deletions
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<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array& operator=(const EigenBase<OtherDerived> &other)
{
return Base::operator=(other);
@@ -84,6 +85,7 @@ class Array
* remain row-vectors and vectors remain vectors.
*/
template<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array& operator=(const ArrayBase<OtherDerived>& 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<typename T0, typename T1>
+ 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<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const ArrayBase<OtherDerived>& 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<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const ReturnByValue<OtherDerived>& other)
{
Base::_check_template_params();
@@ -206,6 +218,7 @@ class Array
/** \sa MatrixBase::operator=(const EigenBase<OtherDerived>&) */
template<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const EigenBase<OtherDerived> &other)
: Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
{
@@ -221,8 +234,8 @@ class Array
void swap(ArrayBase<OtherDerived> 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