diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2016-05-11 23:02:26 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2016-05-11 23:02:26 +0200 |
commit | 2150f13d6573f77232bcd46e8f47a436a82f760f (patch) | |
tree | f62c3809f2dd673e076ab5a36993defd13740f01 /unsupported | |
parent | 7268b102039686a50e15b12fd2b5f003a975e482 (diff) |
fixed some double-promotion and sign-compare warnings
Diffstat (limited to 'unsupported')
-rw-r--r-- | unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h | 2 | ||||
-rw-r--r-- | unsupported/test/cxx11_runqueue.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_dimension.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_thread_pool.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h index 13e6aac27..45acc2d35 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h @@ -36,7 +36,7 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface { // indices as (t + coprime) % num_threads, we will cover all threads without // repetitions (effectively getting a presudo-random permutation of thread // indices). - for (unsigned i = 1; i <= num_threads; i++) { + for (int i = 1; i <= num_threads; i++) { unsigned a = i; unsigned b = num_threads; // If GCD(a, b) == 1, then a and b are coprimes. diff --git a/unsupported/test/cxx11_runqueue.cpp b/unsupported/test/cxx11_runqueue.cpp index 2594ff0c5..91f690114 100644 --- a/unsupported/test/cxx11_runqueue.cpp +++ b/unsupported/test/cxx11_runqueue.cpp @@ -107,7 +107,7 @@ void test_basic_runqueue() VERIFY_IS_EQUAL(2, q.PopBack()); VERIFY_IS_EQUAL(3, q.PopBack()); VERIFY(q.Empty()); - VERIFY_IS_EQUAL(0, q.Size()); + VERIFY_IS_EQUAL(0u, q.Size()); } // Empty tests that the queue is not claimed to be empty when is is in fact not. diff --git a/unsupported/test/cxx11_tensor_dimension.cpp b/unsupported/test/cxx11_tensor_dimension.cpp index 421e73693..0bccc3396 100644 --- a/unsupported/test/cxx11_tensor_dimension.cpp +++ b/unsupported/test/cxx11_tensor_dimension.cpp @@ -57,7 +57,7 @@ static void test_rank_zero() Eigen::DSizes<ptrdiff_t, 0> dscalar; VERIFY_IS_EQUAL(dscalar.TotalSize(), 1); - VERIFY_IS_EQUAL(dscalar.rank(), 0); + VERIFY_IS_EQUAL(dscalar.rank(), 0u); } void test_cxx11_tensor_dimension() diff --git a/unsupported/test/cxx11_tensor_thread_pool.cpp b/unsupported/test/cxx11_tensor_thread_pool.cpp index 423074a38..cdc11eb21 100644 --- a/unsupported/test/cxx11_tensor_thread_pool.cpp +++ b/unsupported/test/cxx11_tensor_thread_pool.cpp @@ -226,7 +226,7 @@ void test_multithread_contraction_agrees_with_singlethread() { for (ptrdiff_t i = 0; i < st_result.size(); i++) { // if both of the values are very small, then do nothing (because the test will fail // due to numerical precision issues when values are small) - if (fabs(st_result.data()[i] - tp_result.data()[i]) >= 1e-4f) { + if (numext::abs(st_result.data()[i] - tp_result.data()[i]) >= 1e-4f) { VERIFY_IS_APPROX(st_result.data()[i], tp_result.data()[i]); } } @@ -264,7 +264,7 @@ void test_full_contraction() { VERIFY(dimensions_match(st_result.dimensions(), tp_result.dimensions())); // if both of the values are very small, then do nothing (because the test will fail // due to numerical precision issues when values are small) - if (fabs(st_result() - tp_result()) >= 1e-4f) { + if (numext::abs(st_result() - tp_result()) >= 1e-4f) { VERIFY_IS_APPROX(st_result(), tp_result()); } } |