From 7d08fa805a38f9ebb9e0e487c4e2d23d32a0fcde Mon Sep 17 00:00:00 2001 From: Mehdi Goli Date: Fri, 28 Jun 2019 10:08:23 +0100 Subject: [SYCL] This PR adds the minimum modifications to the Eigen unsupported module required to run it on devices supporting SYCL. * Abstracting the pointer type so that both SYCL memory and pointer can be captured. * Converting SYCL virtual pointer to SYCL device memory in Eigen evaluator class. * Binding SYCL placeholder accessor to command group handler by using bind method in Eigen evaluator node. * Adding SYCL macro for controlling loop unrolling. * Modifying the TensorDeviceSycl.h and SYCL executor method to adopt the above changes. --- unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h | 42 +++++++++-------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h index 0a394c88d..4aec83cff 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h @@ -58,9 +58,6 @@ struct traits > }; template struct MakePointer { typedef T* Type; - typedef T& RefType; - typedef T ScalarType; - }; typedef typename MakePointer::Type PointerType; }; @@ -80,9 +77,6 @@ struct traits > }; template struct MakePointer { typedef T* Type; - typedef T& RefType; - typedef T ScalarType; - }; typedef typename MakePointer::Type PointerType; }; @@ -106,10 +100,6 @@ struct traits > // Intermediate typedef to workaround MSVC issue. typedef MakePointer_ MakePointerT; typedef typename MakePointerT::Type Type; - typedef typename MakePointerT::RefType RefType; - typedef typename MakePointerT::ScalarType ScalarType; - - }; typedef typename MakePointer::Type PointerType; }; @@ -135,49 +125,49 @@ struct traits > template struct eval, Eigen::Dense> { - typedef const Tensor<_Scalar, NumIndices_, Options, IndexType_>& type; + typedef const Tensor<_Scalar, NumIndices_, Options, IndexType_>EIGEN_DEVICE_REF type; }; template struct eval, Eigen::Dense> { - typedef const Tensor<_Scalar, NumIndices_, Options, IndexType_>& type; + typedef const Tensor<_Scalar, NumIndices_, Options, IndexType_>EIGEN_DEVICE_REF type; }; template struct eval, Eigen::Dense> { - typedef const TensorFixedSize& type; + typedef const TensorFixedSizeEIGEN_DEVICE_REF type; }; template struct eval, Eigen::Dense> { - typedef const TensorFixedSize& type; + typedef const TensorFixedSizeEIGEN_DEVICE_REF type; }; template class MakePointer> struct eval, Eigen::Dense> { - typedef const TensorMap& type; + typedef const TensorMapEIGEN_DEVICE_REF type; }; template class MakePointer> struct eval, Eigen::Dense> { - typedef const TensorMap& type; + typedef const TensorMapEIGEN_DEVICE_REF type; }; template struct eval, Eigen::Dense> { - typedef const TensorRef& type; + typedef const TensorRefEIGEN_DEVICE_REF type; }; template struct eval, Eigen::Dense> { - typedef const TensorRef& type; + typedef const TensorRefEIGEN_DEVICE_REF type; }; // TODO nested<> does not exist anymore in Eigen/Core, and it thus has to be removed in favor of ref_selector. @@ -189,50 +179,50 @@ template struct nested template struct nested > { - typedef const Tensor& type; + typedef const TensorEIGEN_DEVICE_REF type; }; template struct nested > { - typedef const Tensor& type; + typedef const TensorEIGEN_DEVICE_REF type; }; template struct nested > { - typedef const TensorFixedSize& type; + typedef const TensorFixedSizeEIGEN_DEVICE_REF type; }; template struct nested > { - typedef const TensorFixedSize& type; + typedef const TensorFixedSizeEIGEN_DEVICE_REF type; }; template class MakePointer> struct nested > { - typedef const TensorMap& type; + typedef const TensorMapEIGEN_DEVICE_REF type; }; template class MakePointer> struct nested > { - typedef const TensorMap& type; + typedef const TensorMapEIGEN_DEVICE_REF type; }; template struct nested > { - typedef const TensorRef& type; + typedef const TensorRefEIGEN_DEVICE_REF type; }; template struct nested > { - typedef const TensorRef& type; + typedef const TensorRefEIGEN_DEVICE_REF type; }; } // end namespace internal -- cgit v1.2.3