aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h
diff options
context:
space:
mode:
authorGravatar Mehdi Goli <mehdi.goli@codeplay.com>2017-02-15 10:13:01 +0000
committerGravatar Mehdi Goli <mehdi.goli@codeplay.com>2017-02-15 10:13:01 +0000
commitb1e312edd607bcfa99192d53f55b2ac974644c44 (patch)
tree8f6ea84ae9d2e3094754113b61b55d39b5c4c467 /unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h
parent31a25ab226b49560c0e652a7c821a3efa6994946 (diff)
Adding TensorPatch.h for sycl backend.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h11
1 files changed, 9 insertions, 2 deletions
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<const TensorPatchOp<PatchDim, ArgType>, 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<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
- const PatchDim& patch_dims = op.patch_dims();
+ // const PatchDim& patch_dims = op.patch_dims();
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
for (int i = 0; i < NumDims-1; ++i) {
m_dimensions[i] = patch_dims[i];
@@ -255,6 +255,11 @@ struct TensorEvaluator<const TensorPatchOp<PatchDim, ArgType>, 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<ArgType, Device>& 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<Index, NumDims> m_outputStrides;
@@ -262,6 +267,8 @@ struct TensorEvaluator<const TensorPatchOp<PatchDim, ArgType>, Device>
array<Index, NumDims-1> m_patchStrides;
TensorEvaluator<ArgType, Device> m_impl;
+ // required by sycl
+ const PatchDim& patch_dims;
};
} // end namespace Eigen