From bc7d1599fbd649f4f3d100baf0cbe8df1cc89ca6 Mon Sep 17 00:00:00 2001 From: Turing Eret Date: Mon, 14 Dec 2020 07:16:38 -0700 Subject: TensorStorage with FixedDimensions now has zero instance memory overhead. Removed m_dimension as instance member of TensorStorage with FixedDimensions and instead use the template parameter. This means that the sizeof a pure fixed-size storage is exactly equal to the data it is storing. --- unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h | 2 +- unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'unsupported') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h index ca39bb855..c7c1cfc72 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h @@ -61,7 +61,7 @@ class TensorFixedSize : public TensorBase::size; EIGEN_ALIGN_MAX T m_data[MinSize]; - FixedDimensions m_dimensions; - public: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorStorage() { @@ -58,10 +56,10 @@ class TensorStorage EIGEN_STRONG_INLINE const T *data() const { return m_data; } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const FixedDimensions& dimensions() const { return m_dimensions; } + EIGEN_STRONG_INLINE const FixedDimensions dimensions() const { return FixedDimensions(); } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE DenseIndex size() const { return m_dimensions.TotalSize(); } + EIGEN_STRONG_INLINE DenseIndex size() const { return Size; } }; -- cgit v1.2.3