From 0ca1992151abd6410c0d5f603879ab0efab71430 Mon Sep 17 00:00:00 2001 From: Michael Marshall <43034299+mmphys@users.noreply.github.com> Date: Fri, 20 Dec 2019 13:53:27 +0000 Subject: [PATCH] Remove warning in tensor layout comparison. Make default names and index names visible for PerambTensor and NoiseTensor --- Grid/serialisation/BaseIO.h | 2 +- Hadrons/NamedTensor.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Grid/serialisation/BaseIO.h b/Grid/serialisation/BaseIO.h index a9147c49..b858c835 100644 --- a/Grid/serialisation/BaseIO.h +++ b/Grid/serialisation/BaseIO.h @@ -318,7 +318,7 @@ namespace Grid { TotalDims[TensorRank + i] = Traits::Dimension(i); // If the Tensor isn't in Row-Major order, then we'll need to copy it's data - const bool CopyData{NumElements > 1 && ETensor::Layout != Eigen::StorageOptions::RowMajor}; + const bool CopyData{NumElements > 1 && static_cast( ETensor::Layout ) != static_cast( Eigen::StorageOptions::RowMajor )}; const Scalar * pWriteBuffer; std::vector CopyBuffer; const Index TotalNumElements = NumElements * Traits::count; diff --git a/Hadrons/NamedTensor.hpp b/Hadrons/NamedTensor.hpp index 954de2d8..003a92fc 100644 --- a/Hadrons/NamedTensor.hpp +++ b/Hadrons/NamedTensor.hpp @@ -159,9 +159,9 @@ using LapEvecs = Grid::Hadrons::EigenPack; class NoiseTensor : public NamedTensor { + public: static const std::string Name__; static const std::array DefaultIndexNames__; - public: // Default constructor (assumes tensor will be loaded from file) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NoiseTensor() : NamedTensor{Name__, DefaultIndexNames__} {} @@ -173,9 +173,9 @@ class NoiseTensor : public NamedTensor class PerambTensor : public NamedTensor { + public: static const std::string Name__; static const std::array DefaultIndexNames__; - public: // Default constructor (assumes tensor will be loaded from file) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PerambTensor() : NamedTensor{Name__, DefaultIndexNames__} {}