From 3324389f6d5645578bfeffd9ba536a649b7e3592 Mon Sep 17 00:00:00 2001 From: Turing Eret Date: Mon, 30 Aug 2021 19:36:55 +0000 Subject: [PATCH] Add EIGEN_TENSOR_PLUGIN support per issue #2052. --- unsupported/Eigen/CXX11/src/Tensor/Tensor.h | 7 ++++++- unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h index 8cac2bb12..03361e6c1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -42,7 +42,8 @@ namespace Eigen { * \endcode * * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_TENSOR_PLUGIN. + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_TENSOR_PLUGIN, + * \c EIGEN_TENSORBASE_PLUGIN, and \c EIGEN_READONLY_TENSORBASE_PLUGIN. * * Some notes: * @@ -522,6 +523,10 @@ class Tensor : public TensorBase& indices) const diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 35b6458e5..94dca35de 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -960,6 +960,10 @@ class TensorBase return TensorForcedEvalOp(derived()); } + #ifdef EIGEN_READONLY_TENSORBASE_PLUGIN + #include EIGEN_READONLY_TENSORBASE_PLUGIN + #endif + protected: template friend class Tensor; template friend class TensorFixedSize; @@ -1152,6 +1156,10 @@ class TensorBase : public TensorBase { return TensorAsyncDevice(dev, derived(), std::move(done)); } + #ifdef EIGEN_TENSORBASE_PLUGIN + #include EIGEN_TENSORBASE_PLUGIN + #endif + protected: EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TensorBase) EIGEN_DEFAULT_COPY_CONSTRUCTOR(TensorBase)