fixed some double-promotion and sign-compare warnings

This commit is contained in:
Christoph Hertzberg 2016-05-11 23:02:26 +02:00
parent 7268b10203
commit 2150f13d65
4 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface {
// indices as (t + coprime) % num_threads, we will cover all threads without // indices as (t + coprime) % num_threads, we will cover all threads without
// repetitions (effectively getting a presudo-random permutation of thread // repetitions (effectively getting a presudo-random permutation of thread
// indices). // indices).
for (unsigned i = 1; i <= num_threads; i++) { for (int i = 1; i <= num_threads; i++) {
unsigned a = i; unsigned a = i;
unsigned b = num_threads; unsigned b = num_threads;
// If GCD(a, b) == 1, then a and b are coprimes. // If GCD(a, b) == 1, then a and b are coprimes.

View File

@ -107,7 +107,7 @@ void test_basic_runqueue()
VERIFY_IS_EQUAL(2, q.PopBack()); VERIFY_IS_EQUAL(2, q.PopBack());
VERIFY_IS_EQUAL(3, q.PopBack()); VERIFY_IS_EQUAL(3, q.PopBack());
VERIFY(q.Empty()); 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. // Empty tests that the queue is not claimed to be empty when is is in fact not.

View File

@ -57,7 +57,7 @@ static void test_rank_zero()
Eigen::DSizes<ptrdiff_t, 0> dscalar; Eigen::DSizes<ptrdiff_t, 0> dscalar;
VERIFY_IS_EQUAL(dscalar.TotalSize(), 1); VERIFY_IS_EQUAL(dscalar.TotalSize(), 1);
VERIFY_IS_EQUAL(dscalar.rank(), 0); VERIFY_IS_EQUAL(dscalar.rank(), 0u);
} }
void test_cxx11_tensor_dimension() void test_cxx11_tensor_dimension()

View File

@ -226,7 +226,7 @@ void test_multithread_contraction_agrees_with_singlethread() {
for (ptrdiff_t i = 0; i < st_result.size(); i++) { 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 // 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) // 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]); 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())); 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 // 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) // 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()); VERIFY_IS_APPROX(st_result(), tp_result());
} }
} }