From b9e9cff3a9293c60b53683ccfbf2c50dbbbbf44e Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Thu, 27 Jul 2017 15:15:55 +0100 Subject: COMPMID-415: Print tolerance on error Change-Id: Ie9e85043ba0365ccc6223f5f27c7d852981ee699 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81878 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- tests/validation_new/Validation.cpp | 4 ++-- tests/validation_new/Validation.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/validation_new') diff --git a/tests/validation_new/Validation.cpp b/tests/validation_new/Validation.cpp index 9071663e7c..a492bb6505 100644 --- a/tests/validation_new/Validation.cpp +++ b/tests/validation_new/Validation.cpp @@ -213,7 +213,7 @@ void validate(const IAccessor &tensor, const void *reference_value) { const float percent_mismatches = static_cast(num_mismatches) / num_elements * 100.f; - ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::setprecision(2) << percent_mismatches << "%) mismatched"); + ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched"); ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS); } } @@ -290,7 +290,7 @@ void validate(const IAccessor &tensor, BorderSize border_size, const BorderMode { const float percent_mismatches = static_cast(num_mismatches) / num_elements * 100.f; - ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::setprecision(2) << percent_mismatches << "%) mismatched"); + ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched"); ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS); } } diff --git a/tests/validation_new/Validation.h b/tests/validation_new/Validation.h index 7db7b00886..91b17145be 100644 --- a/tests/validation_new/Validation.h +++ b/tests/validation_new/Validation.h @@ -34,6 +34,7 @@ #include "tests/Utils.h" #include +#include #include namespace arm_compute @@ -203,6 +204,7 @@ void validate(const IAccessor &tensor, const SimpleTensor &reference, const V ARM_COMPUTE_TEST_INFO("channel = " << c); ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << target_value); ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << reference_value); + ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << tolerance_value); ARM_COMPUTE_EXPECT_EQUAL(target_value, reference_value, framework::LogLevel::DEBUG); ++num_mismatches; @@ -218,7 +220,7 @@ void validate(const IAccessor &tensor, const SimpleTensor &reference, const V const int64_t absolute_tolerance_number = tolerance_number * num_elements; const float percent_mismatches = static_cast(num_mismatches) / num_elements * 100.f; - ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::setprecision(2) << percent_mismatches + ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched (maximum tolerated " << std::setprecision(2) << tolerance_number << "%)"); ARM_COMPUTE_EXPECT(num_mismatches <= absolute_tolerance_number, framework::LogLevel::ERRORS); } @@ -231,6 +233,7 @@ void validate(T target, T ref, U tolerance_abs_error, double tolerance_relative_ ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << ref); ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << target); + ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << tolerance_abs_error); ARM_COMPUTE_EXPECT(equal, framework::LogLevel::ERRORS); } } // namespace validation -- cgit v1.2.1