diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-02-06 14:27:12 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-02-06 14:27:12 +0100 |
commit | b50ffaddf227a5235efe464d180b01f25884213a (patch) | |
tree | bab49d8b954295d3e6bd708a4ea380e081b26d91 /unsupported/test | |
parent | 74e460b9950503ef5a306337a136e1d37795deae (diff) | |
parent | 2559fa9b0f20ea138cfb019d441ad1757221568d (diff) |
merge
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/cxx11_tensor_broadcasting.cpp | 8 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_index_list.cpp | 4 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_reduction.cpp | 8 |
3 files changed, 16 insertions, 4 deletions
diff --git a/unsupported/test/cxx11_tensor_broadcasting.cpp b/unsupported/test/cxx11_tensor_broadcasting.cpp index f0792bdcf..2ddf47234 100644 --- a/unsupported/test/cxx11_tensor_broadcasting.cpp +++ b/unsupported/test/cxx11_tensor_broadcasting.cpp @@ -114,7 +114,15 @@ static void test_static_broadcasting() { Tensor<float, 3, DataLayout> tensor(8,3,5); tensor.setRandom(); + +#ifdef EIGEN_HAS_CONSTEXPR Eigen::IndexList<Eigen::type2index<2>, Eigen::type2index<3>, Eigen::type2index<4>> broadcasts; +#else + Eigen::array<int, 3> broadcasts; + broadcasts[0] = 2; + broadcasts[1] = 3; + broadcasts[2] = 4; +#endif Tensor<float, 3, DataLayout> broadcast; broadcast = tensor.broadcast(broadcasts); diff --git a/unsupported/test/cxx11_tensor_index_list.cpp b/unsupported/test/cxx11_tensor_index_list.cpp index d79a3ed45..c4d4f244f 100644 --- a/unsupported/test/cxx11_tensor_index_list.cpp +++ b/unsupported/test/cxx11_tensor_index_list.cpp @@ -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 } diff --git a/unsupported/test/cxx11_tensor_reduction.cpp b/unsupported/test/cxx11_tensor_reduction.cpp index 5c3184833..0269853a9 100644 --- a/unsupported/test/cxx11_tensor_reduction.cpp +++ b/unsupported/test/cxx11_tensor_reduction.cpp @@ -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; |