diff options
author | Mehdi Goli <mehdi.goli@codeplay.com> | 2018-08-16 00:07:02 +0100 |
---|---|---|
committer | Mehdi Goli <mehdi.goli@codeplay.com> | 2018-08-16 00:07:02 +0100 |
commit | 161dcbae9bceb337ed7046a5105b3ea715b9601b (patch) | |
tree | 66b95279de3707e85ef1fb0a7df0d2c0055638a2 /unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h | |
parent | a97aaa2bcf3ff27ddb62a919d52d570d8fbb82da (diff) | |
parent | f197c3f55b3a04ab24dfee8057b1d510c7483fc3 (diff) |
Using PointerType struct and specializing it per device for TensorCustomOp.h
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h index da0751039..93a3b0e14 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h @@ -24,6 +24,14 @@ template<typename T> struct MakePointer { typedef T ScalarType; }; +// The PointerType class is a container of the device specefic pointer +// used for refering to a Pointer on TensorEvaluator class. While the TensorExpression +// is a device-agnostic type and need MakePointer class for type conversion, +// the TensorEvaluator calss can be specialized for a device, hence it is possible +// to construct different types of temproray storage memory in TensorEvaluator +// for different devices by specializing the following PointerType class. +template<typename T, typename Device> struct PointerType : MakePointer<T>{}; + namespace internal{ template<typename A, typename B> struct Pointer_type_promotion { static const bool val=false; @@ -89,8 +97,8 @@ template<typename LeftXprType, typename RightXprType> class TensorAssignOp; template<typename Op, typename XprType> class TensorScanOp; template<typename Dims, typename XprType> class TensorTraceOp; -template<typename CustomUnaryFunc, typename XprType, template <class> class MakePointer_ = MakePointer> class TensorCustomUnaryOp; -template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType, template <class> class MakePointer_ = MakePointer> class TensorCustomBinaryOp; +template<typename CustomUnaryFunc, typename XprType> class TensorCustomUnaryOp; +template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType> class TensorCustomBinaryOp; template<typename XprType, template <class> class MakePointer_ = MakePointer> class TensorEvalToOp; template<typename XprType> class TensorForcedEvalOp; |