static const class members turned into constexpr

This commit is contained in:
Erik Schultheis
2022-04-04 17:33:33 +00:00
committed by Rasmus Munk Larsen
parent 2c0ef43b48
commit 64909b82bd
53 changed files with 259 additions and 258 deletions

View File

@@ -32,8 +32,8 @@ struct traits<TensorIndexPairOp<XprType> > : public traits<XprType>
typedef Pair<Index, typename XprTraits::Scalar> Scalar;
typedef typename XprType::Nested Nested;
typedef std::remove_reference_t<Nested> Nested_;
static const int NumDimensions = XprTraits::NumDimensions;
static const int Layout = XprTraits::Layout;
static constexpr int NumDimensions = XprTraits::NumDimensions;
static constexpr int Layout = XprTraits::Layout;
};
template<typename XprType>
@@ -83,7 +83,7 @@ struct TensorEvaluator<const TensorIndexPairOp<ArgType>, Device>
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename TensorEvaluator<ArgType, Device>::Dimensions Dimensions;
static const int NumDims = internal::array_size<Dimensions>::value;
static constexpr int NumDims = internal::array_size<Dimensions>::value;
typedef StorageMemory<CoeffReturnType, Device> Storage;
typedef typename Storage::Type EvaluatorPointerType;
@@ -155,8 +155,8 @@ struct traits<TensorPairReducerOp<ReduceOp, Dims, XprType> > : public traits<Xpr
typedef Index Scalar;
typedef typename XprType::Nested Nested;
typedef std::remove_reference_t<Nested> Nested_;
static const int NumDimensions = XprTraits::NumDimensions - array_size<Dims>::value;
static const int Layout = XprTraits::Layout;
static constexpr int NumDimensions = XprTraits::NumDimensions - array_size<Dims>::value;
static constexpr int Layout = XprTraits::Layout;
};
template<typename ReduceOp, typename Dims, typename XprType>
@@ -222,7 +222,7 @@ struct TensorEvaluator<const TensorPairReducerOp<ReduceOp, Dims, ArgType>, Devic
typedef typename TensorIndexPairOp<ArgType>::CoeffReturnType PairType;
typedef typename TensorEvaluator<const TensorReductionOp<ReduceOp, Dims, const TensorIndexPairOp<ArgType> >, Device>::Dimensions Dimensions;
typedef typename TensorEvaluator<const TensorIndexPairOp<ArgType> , Device>::Dimensions InputDimensions;
static const int NumDims = internal::array_size<InputDimensions>::value;
static constexpr int NumDims = internal::array_size<InputDimensions>::value;
typedef array<Index, NumDims> StrideDims;
typedef StorageMemory<CoeffReturnType, Device> Storage;
typedef typename Storage::Type EvaluatorPointerType;