Fix a few compiler warnings in CXX11 tests.

This commit is contained in:
Rasmus Munk Larsen 2018-08-14 12:06:39 -07:00
parent 59bba77ead
commit aebdb06424
4 changed files with 17 additions and 17 deletions

View File

@ -471,7 +471,7 @@ static void test_tensor_product()
mat1.setRandom(); mat1.setRandom();
mat2.setRandom(); mat2.setRandom();
Tensor<float, 4, DataLayout> result = mat1.contract(mat2, Eigen::array<DimPair, 0>{{}}); Tensor<float, 4, DataLayout> result = mat1.contract(mat2, Eigen::array<DimPair, 0>{});
VERIFY_IS_EQUAL(result.dimension(0), 2); VERIFY_IS_EQUAL(result.dimension(0), 2);
VERIFY_IS_EQUAL(result.dimension(1), 3); VERIFY_IS_EQUAL(result.dimension(1), 3);
@ -553,7 +553,7 @@ static void test_large_contraction_with_output_kernel() {
m_result = m_left * m_right; m_result = m_left * m_right;
for (size_t i = 0; i < t_result.dimensions().TotalSize(); i++) { for (std::ptrdiff_t i = 0; i < t_result.dimensions().TotalSize(); i++) {
VERIFY(&t_result.data()[i] != &m_result.data()[i]); VERIFY(&t_result.data()[i] != &m_result.data()[i]);
VERIFY_IS_APPROX(t_result.data()[i], std::sqrt(m_result.data()[i])); VERIFY_IS_APPROX(t_result.data()[i], std::sqrt(m_result.data()[i]));
} }

View File

@ -25,7 +25,7 @@ static void test_evals()
Tensor<float, 2, DataLayout> result(2,3); Tensor<float, 2, DataLayout> result(2,3);
result.setZero(); result.setZero();
Eigen::array<Tensor<float, 2>::Index, 1> dims3{{0}}; Eigen::array<Tensor<float, 2>::Index, 1> dims3{0};
typedef TensorEvaluator<decltype(input.convolve(kernel, dims3)), DefaultDevice> Evaluator; typedef TensorEvaluator<decltype(input.convolve(kernel, dims3)), DefaultDevice> Evaluator;
Evaluator eval(input.convolve(kernel, dims3), DefaultDevice()); Evaluator eval(input.convolve(kernel, dims3), DefaultDevice());

View File

@ -170,7 +170,6 @@ static void test_type2indexpair_list()
typedef Eigen::IndexPairList<Eigen::type2indexpair<0,10>, Eigen::IndexPair<DenseIndex>, Eigen::type2indexpair<2,12>> Dims2_b; typedef Eigen::IndexPairList<Eigen::type2indexpair<0,10>, Eigen::IndexPair<DenseIndex>, Eigen::type2indexpair<2,12>> Dims2_b;
typedef Eigen::IndexPairList<Eigen::IndexPair<DenseIndex>, Eigen::type2indexpair<1,11>, Eigen::IndexPair<DenseIndex>> Dims2_c; typedef Eigen::IndexPairList<Eigen::IndexPair<DenseIndex>, Eigen::type2indexpair<1,11>, Eigen::IndexPair<DenseIndex>> Dims2_c;
Dims0 d0;
Dims2_a d2_a; Dims2_a d2_a;
Dims2_b d2_b; Dims2_b d2_b;

View File

@ -9,6 +9,9 @@
// Public License v. 2.0. If a copy of the MPL was not distributed // Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include "main.h"
#ifdef EIGEN_TEST_PART_1 #ifdef EIGEN_TEST_PART_1
#include "sparse.h" #include "sparse.h"
@ -236,8 +239,6 @@ EIGEN_DECLARE_TEST(kronecker_product)
#ifdef EIGEN_TEST_PART_2 #ifdef EIGEN_TEST_PART_2
// simply check that for a dense kronecker product, sparse module is not needed // simply check that for a dense kronecker product, sparse module is not needed
#include "main.h"
#include <Eigen/KroneckerProduct> #include <Eigen/KroneckerProduct>
EIGEN_DECLARE_TEST(kronecker_product) EIGEN_DECLARE_TEST(kronecker_product)