From 89dfd51fae868393b66b1949638e03de2ba17c1f Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Wed, 22 Feb 2017 16:36:24 +0000 Subject: Adding Sycl Backend for TensorGenerator.h. --- unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h index eb1d4934e..ca87f493a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h @@ -97,10 +97,9 @@ struct TensorEvaluator, Device> }; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) - : m_generator(op.generator()) + : m_generator(op.generator()), m_argImpl(op.expression(), device) { - TensorEvaluator impl(op.expression(), device); - m_dimensions = impl.dimensions(); + m_dimensions = m_argImpl.dimensions(); if (static_cast(Layout) == static_cast(ColMajor)) { m_strides[0] = 1; @@ -155,6 +154,12 @@ struct TensorEvaluator, Device> EIGEN_DEVICE_FUNC Scalar* data() const { return NULL; } + /// required by sycl in order to extract the accessor + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorEvaluator& impl() const { return m_argImpl; } + /// required by sycl in order to extract the accessor + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Generator& functor() const { return m_generator; } + + protected: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void extract_coordinates(Index index, array& coords) const { @@ -178,6 +183,8 @@ struct TensorEvaluator, Device> Dimensions m_dimensions; array m_strides; Generator m_generator; + // required by sycl + TensorEvaluator m_argImpl; }; } // end namespace Eigen -- cgit v1.2.3