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
*
* 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>
*
@ -522,6 +523,10 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp
}
#endif
#ifdef EIGEN_TENSOR_PLUGIN
#include EIGEN_TENSOR_PLUGIN
#endif
protected:
bool checkIndexRange(const array<Index, NumIndices>& indices) const

View File

@ -960,6 +960,10 @@ class TensorBase<Derived, ReadOnlyAccessors>
return TensorForcedEvalOp<const Derived>(derived());
}
#ifdef EIGEN_READONLY_TENSORBASE_PLUGIN
#include EIGEN_READONLY_TENSORBASE_PLUGIN
#endif
protected:
template <typename Scalar, int NumIndices, int Options, typename IndexType> friend class Tensor;
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));
}
#ifdef EIGEN_TENSORBASE_PLUGIN
#include EIGEN_TENSORBASE_PLUGIN
#endif
protected:
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(TensorBase)
EIGEN_DEFAULT_COPY_CONSTRUCTOR(TensorBase)