From e46e7223817cfd982edec6d8e25c77e8e2493d78 Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Mon, 16 Jan 2017 13:58:49 +0000 Subject: Adding Tensor ReverseOp; TensorStriding; TensorConversionOp; Modifying Tensor Contractsycl to be located in any place in the expression tree. --- .../Eigen/CXX11/src/Tensor/TensorForcedEval.h | 37 +++++++++------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h index 930837021..822e22c2d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h @@ -26,8 +26,8 @@ namespace Eigen { /// Therefore, by adding the default value, we managed to convert the type and it does not break any /// existing code as its default value is T*. namespace internal { -template class MakePointer_> -struct traits > +template +struct traits > { // Type promotion to handle the case where the types of the lhs and the rhs are different. typedef typename XprType::Scalar Scalar; @@ -42,33 +42,26 @@ struct traits > enum { Flags = 0 }; - template struct MakePointer { - // Intermediate typedef to workaround MSVC issue. - typedef MakePointer_ MakePointerT; - typedef typename MakePointerT::Type Type; - typedef typename MakePointerT::RefType RefType; - - }; }; -template class MakePointer_> -struct eval, Eigen::Dense> +template +struct eval, Eigen::Dense> { - typedef const TensorForcedEvalOp& type; + typedef const TensorForcedEvalOp& type; }; -template class MakePointer_> -struct nested, 1, typename eval >::type> +template +struct nested, 1, typename eval >::type> { - typedef TensorForcedEvalOp type; + typedef TensorForcedEvalOp type; }; } // end namespace internal -template class MakePointer_> -class TensorForcedEvalOp : public TensorBase, ReadOnlyAccessors> +template +class TensorForcedEvalOp : public TensorBase, ReadOnlyAccessors> { public: typedef typename Eigen::internal::traits::Scalar Scalar; @@ -90,10 +83,10 @@ class TensorForcedEvalOp : public TensorBase class MakePointer_> -struct TensorEvaluator, Device> +template +struct TensorEvaluator, Device> { - typedef TensorForcedEvalOp XprType; + typedef TensorForcedEvalOp XprType; typedef typename ArgType::Scalar Scalar; typedef typename TensorEvaluator::Dimensions Dimensions; typedef typename XprType::Index Index; @@ -150,7 +143,7 @@ struct TensorEvaluator, Device> return TensorOpCost(sizeof(CoeffReturnType), 0, 0, vectorized, PacketSize); } - EIGEN_DEVICE_FUNC typename MakePointer::Type data() const { return m_buffer; } + CoeffReturnType* data() const { return m_buffer; } /// required by sycl in order to extract the sycl accessor const TensorEvaluator& impl() { return m_impl; } @@ -160,7 +153,7 @@ struct TensorEvaluator, Device> TensorEvaluator m_impl; const ArgType m_op; const Device& m_device; - typename MakePointer::Type m_buffer; + CoeffReturnType* m_buffer; }; -- cgit v1.2.3