diff options
author | Turing Eret <turingeret@ucar.edu> | 2020-12-14 07:16:38 -0700 |
---|---|---|
committer | Turing Eret <turingeret@ucar.edu> | 2020-12-14 07:19:34 -0700 |
commit | bc7d1599fbd649f4f3d100baf0cbe8df1cc89ca6 (patch) | |
tree | 2f5ae4666ef9cffe8fc180b0913aa9d8c53242f0 /unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h | |
parent | cf0b5b0344a3bfcf410e95bf22289015a2daf34b (diff) |
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.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h index e6a666f78..695d22b3b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h @@ -45,8 +45,6 @@ class TensorStorage static const std::size_t MinSize = max_n_1<Size>::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; } }; |