aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Turing Eret <turingeret@ucar.edu>2020-12-16 09:18:24 -0700
committerGravatar Turing Eret <turingeret@ucar.edu>2020-12-16 09:18:24 -0700
commit3bee9422d6578e551689a941ccd5faeb83e61489 (patch)
tree0af6005591274a6e59f7e794aad9f270dd3389cd
parent6cee8d347e8a7e8e1a689a3b7de5fe413f3e1103 (diff)
parent19e6496ce0c52fef33265bca54285ba77b2155be (diff)
Merge branch 'lambdaknight/eigen-master'
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index e6a666f78..656fd211e 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() {
@@ -57,14 +55,17 @@ class TensorStorage
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const T *data() const { return m_data; }
- EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE const FixedDimensions& dimensions() const { return m_dimensions; }
+ static EIGEN_DEVICE_FUNC
+ EIGEN_STRONG_INLINE const FixedDimensions& dimensions()
+ {
+ static const FixedDimensions* singleton_dimensions = new FixedDimensions();
+ return *singleton_dimensions;
+ }
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE DenseIndex size() const { return m_dimensions.TotalSize(); }
+ EIGEN_STRONG_INLINE DenseIndex size() const { return Size; }
};
-
// pure dynamic
template<typename T, typename IndexType, int NumIndices_, int Options_>
class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_>