mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Added the EIGEN_HAS_CONSTEXPR define
Gate the tensor index list code based on the value of EIGEN_HAS_CONSTEXPR
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <Eigen/CXX11/Tensor>
|
||||
|
||||
#ifdef EIGEN_HAS_CONSTEXPR
|
||||
|
||||
static void test_static_index_list()
|
||||
{
|
||||
@@ -254,11 +255,14 @@ static void test_mixed_index_list()
|
||||
VERIFY_IS_APPROX(result3(0), expected);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void test_cxx11_tensor_index_list()
|
||||
{
|
||||
#ifdef EIGEN_HAS_CONSTEXPR
|
||||
CALL_SUBTEST(test_static_index_list());
|
||||
CALL_SUBTEST(test_type2index_list());
|
||||
CALL_SUBTEST(test_dynamic_index_list());
|
||||
CALL_SUBTEST(test_mixed_index_list());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ static void test_static_dims() {
|
||||
Tensor<float, 2, DataLayout> out(72, 97);
|
||||
in.setRandom();
|
||||
|
||||
#if __cplusplus <= 199711L
|
||||
#ifndef EIGEN_HAS_CONSTEXPR
|
||||
array<int, 2> reduction_axis;
|
||||
reduction_axis[0] = 1;
|
||||
reduction_axis[1] = 3;
|
||||
@@ -314,7 +314,7 @@ static void test_innermost_last_dims() {
|
||||
in.setRandom();
|
||||
|
||||
// Reduce on the innermost dimensions.
|
||||
#if __cplusplus <= 199711L
|
||||
#ifndef EIGEN_HAS_CONSTEXPR
|
||||
array<int, 2> reduction_axis;
|
||||
reduction_axis[0] = 0;
|
||||
reduction_axis[1] = 1;
|
||||
@@ -345,7 +345,7 @@ static void test_innermost_first_dims() {
|
||||
in.setRandom();
|
||||
|
||||
// Reduce on the innermost dimensions.
|
||||
#if __cplusplus <= 199711L
|
||||
#ifndef EIGEN_HAS_CONSTEXPR
|
||||
array<int, 2> reduction_axis;
|
||||
reduction_axis[0] = 2;
|
||||
reduction_axis[1] = 3;
|
||||
@@ -376,7 +376,7 @@ static void test_reduce_middle_dims() {
|
||||
in.setRandom();
|
||||
|
||||
// Reduce on the innermost dimensions.
|
||||
#if __cplusplus <= 199711L
|
||||
#ifndef EIGEN_HAS_CONSTEXPR
|
||||
array<int, 2> reduction_axis;
|
||||
reduction_axis[0] = 1;
|
||||
reduction_axis[1] = 2;
|
||||
|
||||
Reference in New Issue
Block a user