aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_tensor_convolution.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-04-16 12:29:16 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-04-16 12:29:16 -0700
commitda5b98a94d2a3a5a4963262fc1b33d75633b3b83 (patch)
tree33a0fcb59c8fe70f2e0050b48a482d244c725885 /unsupported/test/cxx11_tensor_convolution.cpp
parentd19d09ae6a9186550c31cef65fc694fd9d60c3b9 (diff)
Updated the cxx11_tensor_convolution test to avoid using cxx11 features. This should enable the test to compile with gcc 4.7 and older
Diffstat (limited to 'unsupported/test/cxx11_tensor_convolution.cpp')
-rw-r--r--unsupported/test/cxx11_tensor_convolution.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/unsupported/test/cxx11_tensor_convolution.cpp b/unsupported/test/cxx11_tensor_convolution.cpp
index e17b5952c..e3d4675eb 100644
--- a/unsupported/test/cxx11_tensor_convolution.cpp
+++ b/unsupported/test/cxx11_tensor_convolution.cpp
@@ -51,7 +51,9 @@ static void test_expr()
kernel.setRandom();
Tensor<float, 2, DataLayout> result(2,2);
- Eigen::array<ptrdiff_t, 2> dims({0, 1});
+ Eigen::array<ptrdiff_t, 2> dims;
+ dims[0] = 0;
+ dims[1] = 1;
result = input.convolve(kernel, dims);
VERIFY_IS_APPROX(result(0,0), input(0,0)*kernel(0,0) + input(0,1)*kernel(0,1) +
@@ -75,7 +77,8 @@ static void test_modes() {
kernel(1) = 1.0f;
kernel(2) = 0.0f;
- const Eigen::array<ptrdiff_t, 1> dims({0});
+ Eigen::array<ptrdiff_t, 1> dims;
+ dims[0] = 0;
Eigen::array<std::pair<ptrdiff_t, ptrdiff_t>, 1> padding;
// Emulate VALID mode (as defined in
@@ -116,9 +119,12 @@ static void test_strides() {
input.setRandom();
kernel.setRandom();
- const Eigen::array<ptrdiff_t, 1> dims({0});
- const Eigen::array<ptrdiff_t, 1> stride_of_3({3});
- const Eigen::array<ptrdiff_t, 1> stride_of_2({2});
+ Eigen::array<ptrdiff_t, 1> dims;
+ dims[0] = 0;
+ Eigen::array<ptrdiff_t, 1> stride_of_3;
+ stride_of_3[0] = 3;
+ Eigen::array<ptrdiff_t, 1> stride_of_2;
+ stride_of_2[0] = 2;
Tensor<float, 1, DataLayout> result;
result = input.stride(stride_of_3).convolve(kernel, dims).stride(stride_of_2);