mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Tensor module: const-correctness and constexpr improvements
libeigen/eigen!2239 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -44,11 +44,11 @@ struct StorageMemory : MakePointer<T> {};
|
||||
namespace internal {
|
||||
template <typename A, typename B>
|
||||
struct Pointer_type_promotion {
|
||||
static const bool val = false;
|
||||
static constexpr bool val = false;
|
||||
};
|
||||
template <typename A>
|
||||
struct Pointer_type_promotion<A, A> {
|
||||
static const bool val = true;
|
||||
static constexpr bool val = true;
|
||||
};
|
||||
template <typename A, typename B>
|
||||
struct TypeConversion {
|
||||
@@ -173,12 +173,12 @@ namespace internal {
|
||||
|
||||
template <typename Device, typename Expression>
|
||||
struct IsVectorizable {
|
||||
static const bool value = TensorEvaluator<Expression, Device>::PacketAccess;
|
||||
static constexpr bool value = TensorEvaluator<Expression, Device>::PacketAccess;
|
||||
};
|
||||
|
||||
template <typename Expression>
|
||||
struct IsVectorizable<GpuDevice, Expression> {
|
||||
static const bool value =
|
||||
static constexpr bool value =
|
||||
TensorEvaluator<Expression, GpuDevice>::PacketAccess && TensorEvaluator<Expression, GpuDevice>::IsAligned;
|
||||
};
|
||||
|
||||
@@ -196,7 +196,7 @@ struct IsTileable {
|
||||
static constexpr bool BlockAccess =
|
||||
TensorEvaluator<Expression, Device>::BlockAccess && TensorEvaluator<Expression, Device>::PreferBlockAccess;
|
||||
|
||||
static const TiledEvaluation value = BlockAccess ? TiledEvaluation::On : TiledEvaluation::Off;
|
||||
static constexpr TiledEvaluation value = BlockAccess ? TiledEvaluation::On : TiledEvaluation::Off;
|
||||
};
|
||||
|
||||
template <typename Expression, typename Device, bool Vectorizable = IsVectorizable<Device, Expression>::value,
|
||||
|
||||
Reference in New Issue
Block a user