mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Worked around some constexpr related bugs in nvcc 7
This commit is contained in:
parent
f13b3d4433
commit
0e5fed74e7
@ -10,7 +10,7 @@
|
||||
#ifndef EIGEN_CXX11_TENSOR_TENSOR_INDEX_LIST_H
|
||||
#define EIGEN_CXX11_TENSOR_TENSOR_INDEX_LIST_H
|
||||
|
||||
#ifdef EIGEN_HAS_CONSTEXPR
|
||||
#if defined(EIGEN_HAS_CONSTEXPR) && defined(EIGEN_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
|
@ -53,28 +53,34 @@ struct preserve_inner_most_dims {
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
#ifdef EIGEN_HAS_CONSTEXPR
|
||||
#if defined(EIGEN_HAS_CONSTEXPR) && defined(EIGEN_HAS_VARIADIC_TEMPLATES)
|
||||
template <typename ReducedDims, int NumTensorDims>
|
||||
struct are_inner_most_dims<ReducedDims, NumTensorDims, ColMajor>{
|
||||
static const bool value = indices_statically_known_to_increase<ReducedDims>()() &&
|
||||
index_statically_eq<ReducedDims>()(0, 0) &&
|
||||
index_statically_eq<ReducedDims>()(array_size<ReducedDims>::value-1, array_size<ReducedDims>::value-1);
|
||||
static const bool tmp1 = indices_statically_known_to_increase<ReducedDims>()();
|
||||
static const bool tmp2 = index_statically_eq<ReducedDims>()(0, 0);
|
||||
static const bool tmp3 = index_statically_eq<ReducedDims>()(array_size<ReducedDims>::value-1, array_size<ReducedDims>::value-1);
|
||||
static const bool value = tmp1 & tmp2 & tmp3;
|
||||
};
|
||||
template <typename ReducedDims, int NumTensorDims>
|
||||
struct are_inner_most_dims<ReducedDims, NumTensorDims, RowMajor>{
|
||||
static const bool value = indices_statically_known_to_increase<ReducedDims>()() &&
|
||||
index_statically_eq<ReducedDims>()(0, NumTensorDims - array_size<ReducedDims>::value) &&
|
||||
index_statically_eq<ReducedDims>()(array_size<ReducedDims>::value - 1, NumTensorDims - 1);
|
||||
static const bool tmp1 = indices_statically_known_to_increase<ReducedDims>()();
|
||||
static const bool tmp2 = index_statically_eq<ReducedDims>()(0, NumTensorDims - array_size<ReducedDims>::value);
|
||||
static const bool tmp3 = index_statically_eq<ReducedDims>()(array_size<ReducedDims>::value - 1, NumTensorDims - 1);
|
||||
static const bool value = tmp1 & tmp2 & tmp3;
|
||||
|
||||
};
|
||||
template <typename ReducedDims, int NumTensorDims>
|
||||
struct preserve_inner_most_dims<ReducedDims, NumTensorDims, ColMajor>{
|
||||
static const bool value = indices_statically_known_to_increase<ReducedDims>()() &&
|
||||
index_statically_gt<ReducedDims>()(0, 0);
|
||||
static const bool tmp1 = indices_statically_known_to_increase<ReducedDims>()();
|
||||
static const bool tmp2 = index_statically_gt<ReducedDims>()(0, 0);
|
||||
static const bool value = tmp1 & tmp2;
|
||||
|
||||
};
|
||||
template <typename ReducedDims, int NumTensorDims>
|
||||
struct preserve_inner_most_dims<ReducedDims, NumTensorDims, RowMajor>{
|
||||
static const bool value = indices_statically_known_to_increase<ReducedDims>()() &&
|
||||
index_statically_lt<ReducedDims>()(array_size<ReducedDims>::value - 1, NumTensorDims - 1);
|
||||
static const bool tmp1 = indices_statically_known_to_increase<ReducedDims>()();
|
||||
static const bool tmp2 = index_statically_lt<ReducedDims>()(array_size<ReducedDims>::value - 1, NumTensorDims - 1);
|
||||
static const bool value = tmp1 & tmp2;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user