aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Stride.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/Stride.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/Stride.h')
-rw-r--r--Eigen/src/Core/Stride.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/Eigen/src/Core/Stride.h b/Eigen/src/Core/Stride.h
index 1e3f5fe9f..d3d454e4e 100644
--- a/Eigen/src/Core/Stride.h
+++ b/Eigen/src/Core/Stride.h
@@ -51,6 +51,7 @@ class Stride
};
/** Default constructor, for use when strides are fixed at compile time */
+ EIGEN_DEVICE_FUNC
Stride()
: m_outer(OuterStrideAtCompileTime), m_inner(InnerStrideAtCompileTime)
{
@@ -58,6 +59,7 @@ class Stride
}
/** Constructor allowing to pass the strides at runtime */
+ EIGEN_DEVICE_FUNC
Stride(Index outerStride, Index innerStride)
: m_outer(outerStride), m_inner(innerStride)
{
@@ -65,13 +67,16 @@ class Stride
}
/** Copy constructor */
+ EIGEN_DEVICE_FUNC
Stride(const Stride& other)
: m_outer(other.outer()), m_inner(other.inner())
{}
/** \returns the outer stride */
+ EIGEN_DEVICE_FUNC
inline Index outer() const { return m_outer.value(); }
/** \returns the inner stride */
+ EIGEN_DEVICE_FUNC
inline Index inner() const { return m_inner.value(); }
protected:
@@ -87,8 +92,8 @@ class InnerStride : public Stride<0, Value>
typedef Stride<0, Value> Base;
public:
typedef DenseIndex Index;
- InnerStride() : Base() {}
- InnerStride(Index v) : Base(0, v) {}
+ EIGEN_DEVICE_FUNC InnerStride() : Base() {}
+ EIGEN_DEVICE_FUNC InnerStride(Index v) : Base(0, v) {}
};
/** \brief Convenience specialization of Stride to specify only an outer stride
@@ -99,8 +104,8 @@ class OuterStride : public Stride<Value, 0>
typedef Stride<Value, 0> Base;
public:
typedef DenseIndex Index;
- OuterStride() : Base() {}
- OuterStride(Index v) : Base(v,0) {}
+ EIGEN_DEVICE_FUNC OuterStride() : Base() {}
+ EIGEN_DEVICE_FUNC OuterStride(Index v) : Base(v,0) {}
};
} // end namespace Eigen