Add EIGEN_TENSOR_PLUGIN support per issue #2052.

This commit is contained in:
Turing Eret 2021-08-30 19:36:55 +00:00 committed by Rasmus Munk Larsen
parent 5db9e5c779
commit 3324389f6d
2 changed files with 14 additions and 1 deletions

View File

@ -42,7 +42,8 @@ namespace Eigen {
* \endcode * \endcode
* *
* This class can be extended with the help of the plugin mechanism described on the page * 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.
* *
* <i><b>Some notes:</b></i> * <i><b>Some notes:</b></i>
* *
@ -520,6 +521,10 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp
} }
resize(dims); resize(dims);
} }
#endif
#ifdef EIGEN_TENSOR_PLUGIN
#include EIGEN_TENSOR_PLUGIN
#endif #endif
protected: protected:

View File

@ -960,6 +960,10 @@ class TensorBase<Derived, ReadOnlyAccessors>
return TensorForcedEvalOp<const Derived>(derived()); return TensorForcedEvalOp<const Derived>(derived());
} }
#ifdef EIGEN_READONLY_TENSORBASE_PLUGIN
#include EIGEN_READONLY_TENSORBASE_PLUGIN
#endif
protected: protected:
template <typename Scalar, int NumIndices, int Options, typename IndexType> friend class Tensor; template <typename Scalar, int NumIndices, int Options, typename IndexType> friend class Tensor;
template <typename Scalar, typename Dimensions, int Option, typename IndexTypes> friend class TensorFixedSize; template <typename Scalar, typename Dimensions, int Option, typename IndexTypes> friend class TensorFixedSize;
@ -1152,6 +1156,10 @@ class TensorBase : public TensorBase<Derived, ReadOnlyAccessors> {
return TensorAsyncDevice<Derived, DeviceType, DoneCallback>(dev, derived(), std::move(done)); return TensorAsyncDevice<Derived, DeviceType, DoneCallback>(dev, derived(), std::move(done));
} }
#ifdef EIGEN_TENSORBASE_PLUGIN
#include EIGEN_TENSORBASE_PLUGIN
#endif
protected: protected:
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TensorBase) EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TensorBase)
EIGEN_DEFAULT_COPY_CONSTRUCTOR(TensorBase) EIGEN_DEFAULT_COPY_CONSTRUCTOR(TensorBase)