From b1e312edd607bcfa99192d53f55b2ac974644c44 Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Wed, 15 Feb 2017 10:13:01 +0000 Subject: Adding TensorPatch.h for sycl backend. --- unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h index 886a254f6..cead2eac8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h @@ -99,11 +99,11 @@ struct TensorEvaluator, Device> }; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) - : m_impl(op.expression(), device) + : m_impl(op.expression(), device), patch_dims(op.patch_dims()) { Index num_patches = 1; const typename TensorEvaluator::Dimensions& input_dims = m_impl.dimensions(); - const PatchDim& patch_dims = op.patch_dims(); + // const PatchDim& patch_dims = op.patch_dims(); if (static_cast(Layout) == static_cast(ColMajor)) { for (int i = 0; i < NumDims-1; ++i) { m_dimensions[i] = patch_dims[i]; @@ -255,6 +255,11 @@ 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_impl; } + /// required by sycl in order to extract the accessor + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const PatchDim& functor() const { return patch_dims; } + protected: Dimensions m_dimensions; array m_outputStrides; @@ -262,6 +267,8 @@ struct TensorEvaluator, Device> array m_patchStrides; TensorEvaluator m_impl; + // required by sycl + const PatchDim& patch_dims; }; } // end namespace Eigen -- cgit v1.2.3