Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 ARM Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 24 | #ifndef __ARM_COMPUTE_TEST_VALIDATION_H__ |
| 25 | #define __ARM_COMPUTE_TEST_VALIDATION_H__ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 26 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 27 | #include "arm_compute/core/FixedPoint.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 28 | #include "arm_compute/core/Types.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 29 | #include "tests/IAccessor.h" |
| 30 | #include "tests/SimpleTensor.h" |
| 31 | #include "tests/TypePrinter.h" |
| 32 | #include "tests/Utils.h" |
| 33 | #include "tests/framework/Asserts.h" |
| 34 | #include "tests/framework/Exceptions.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 35 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 36 | #include <iomanip> |
| 37 | #include <ios> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 38 | #include <vector> |
| 39 | |
| 40 | namespace arm_compute |
| 41 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 42 | namespace test |
| 43 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 44 | namespace validation |
| 45 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 46 | /** Class reprensenting an absolute tolerance value. */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 47 | template <typename T> |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 48 | class AbsoluteTolerance |
| 49 | { |
| 50 | public: |
| 51 | /** Underlying type. */ |
| 52 | using value_type = T; |
| 53 | |
| 54 | /* Default constructor. |
| 55 | * |
| 56 | * Initialises the tolerance to 0. |
| 57 | */ |
| 58 | AbsoluteTolerance() = default; |
| 59 | |
| 60 | /** Constructor. |
| 61 | * |
| 62 | * @param[in] value Absolute tolerance value. |
| 63 | */ |
| 64 | explicit constexpr AbsoluteTolerance(T value) |
| 65 | : _value{ value } |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | /** Implicit conversion to the underlying type. */ |
| 70 | constexpr operator T() const |
| 71 | { |
| 72 | return _value; |
| 73 | } |
| 74 | |
| 75 | private: |
| 76 | T _value{ std::numeric_limits<T>::epsilon() }; |
| 77 | }; |
| 78 | |
| 79 | /** Class reprensenting a relative tolerance value. */ |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 80 | template <typename T> |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 81 | class RelativeTolerance |
| 82 | { |
| 83 | public: |
| 84 | /** Underlying type. */ |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 85 | using value_type = T; |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 86 | |
| 87 | /* Default constructor. |
| 88 | * |
| 89 | * Initialises the tolerance to 0. |
| 90 | */ |
| 91 | RelativeTolerance() = default; |
| 92 | |
| 93 | /** Constructor. |
| 94 | * |
| 95 | * @param[in] value Relative tolerance value. |
| 96 | */ |
| 97 | explicit constexpr RelativeTolerance(value_type value) |
| 98 | : _value{ value } |
| 99 | { |
| 100 | } |
| 101 | |
| 102 | /** Implicit conversion to the underlying type. */ |
| 103 | constexpr operator value_type() const |
| 104 | { |
| 105 | return _value; |
| 106 | } |
| 107 | |
| 108 | private: |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 109 | value_type _value{ std::numeric_limits<T>::epsilon() }; |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 110 | }; |
| 111 | |
| 112 | /** Print AbsoluteTolerance type. */ |
| 113 | template <typename T> |
| 114 | inline ::std::ostream &operator<<(::std::ostream &os, const AbsoluteTolerance<T> &tolerance) |
| 115 | { |
| 116 | os << static_cast<typename AbsoluteTolerance<T>::value_type>(tolerance); |
| 117 | |
| 118 | return os; |
| 119 | } |
| 120 | |
| 121 | /** Print RelativeTolerance type. */ |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 122 | template <typename T> |
| 123 | inline ::std::ostream &operator<<(::std::ostream &os, const RelativeTolerance<T> &tolerance) |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 124 | { |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 125 | os << static_cast<typename RelativeTolerance<T>::value_type>(tolerance); |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 126 | |
| 127 | return os; |
| 128 | } |
| 129 | |
| 130 | template <typename T> |
| 131 | bool compare_dimensions(const Dimensions<T> &dimensions1, const Dimensions<T> &dimensions2) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 132 | { |
| 133 | if(dimensions1.num_dimensions() != dimensions2.num_dimensions()) |
| 134 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 135 | return false; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | for(unsigned int i = 0; i < dimensions1.num_dimensions(); ++i) |
| 139 | { |
| 140 | if(dimensions1[i] != dimensions2[i]) |
| 141 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 142 | return false; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 143 | } |
| 144 | } |
| 145 | |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | /** Validate valid regions. |
| 150 | * |
| 151 | * - Dimensionality has to be the same. |
| 152 | * - Anchors have to match. |
| 153 | * - Shapes have to match. |
| 154 | */ |
| 155 | void validate(const arm_compute::ValidRegion ®ion, const arm_compute::ValidRegion &reference); |
| 156 | |
| 157 | /** Validate padding. |
| 158 | * |
| 159 | * Padding on all sides has to be the same. |
| 160 | */ |
| 161 | void validate(const arm_compute::PaddingSize &padding, const arm_compute::PaddingSize &reference); |
| 162 | |
| 163 | /** Validate tensors. |
| 164 | * |
| 165 | * - Dimensionality has to be the same. |
| 166 | * - All values have to match. |
| 167 | * |
| 168 | * @note: wrap_range allows cases where reference tensor rounds up to the wrapping point, causing it to wrap around to |
| 169 | * zero while the test tensor stays at wrapping point to pass. This may permit true erroneous cases (difference between |
| 170 | * reference tensor and test tensor is multiple of wrap_range), but such errors would be detected by |
| 171 | * other test cases. |
| 172 | */ |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 173 | template <typename T, typename U = AbsoluteTolerance<T>> |
| 174 | void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, U tolerance_value = U(), float tolerance_number = 0.f); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 175 | |
| 176 | /** Validate tensors with valid region. |
| 177 | * |
| 178 | * - Dimensionality has to be the same. |
| 179 | * - All values have to match. |
| 180 | * |
| 181 | * @note: wrap_range allows cases where reference tensor rounds up to the wrapping point, causing it to wrap around to |
| 182 | * zero while the test tensor stays at wrapping point to pass. This may permit true erroneous cases (difference between |
| 183 | * reference tensor and test tensor is multiple of wrap_range), but such errors would be detected by |
| 184 | * other test cases. |
| 185 | */ |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 186 | template <typename T, typename U = AbsoluteTolerance<T>> |
| 187 | void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const ValidRegion &valid_region, U tolerance_value = U(), float tolerance_number = 0.f); |
Isabella Gottardi | 6203153 | 2017-07-04 11:21:28 +0100 | [diff] [blame] | 188 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 189 | /** Validate tensors against constant value. |
| 190 | * |
| 191 | * - All values have to match. |
| 192 | */ |
| 193 | void validate(const IAccessor &tensor, const void *reference_value); |
| 194 | |
| 195 | /** Validate border against a constant value. |
| 196 | * |
| 197 | * - All border values have to match the specified value if mode is CONSTANT. |
| 198 | * - All border values have to be replicated if mode is REPLICATE. |
| 199 | * - Nothing is validated for mode UNDEFINED. |
| 200 | */ |
| 201 | void validate(const IAccessor &tensor, BorderSize border_size, const BorderMode &border_mode, const void *border_value); |
| 202 | |
| 203 | /** Validate classified labels against expected ones. |
| 204 | * |
| 205 | * - All values should match |
| 206 | */ |
| 207 | void validate(std::vector<unsigned int> classified_labels, std::vector<unsigned int> expected_labels); |
steniu01 | 960b084 | 2017-06-23 11:44:34 +0100 | [diff] [blame] | 208 | |
| 209 | /** Validate float value. |
| 210 | * |
| 211 | * - All values should match |
| 212 | */ |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 213 | template <typename T, typename U> |
| 214 | void validate(T target, T reference, U tolerance = AbsoluteTolerance<T>()); |
steniu01 | 960b084 | 2017-06-23 11:44:34 +0100 | [diff] [blame] | 215 | |
Michele Di Giorgio | ef4b4ae | 2017-07-04 17:19:43 +0100 | [diff] [blame] | 216 | template <typename T> |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 217 | struct compare_base |
Michele Di Giorgio | ef4b4ae | 2017-07-04 17:19:43 +0100 | [diff] [blame] | 218 | { |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 219 | compare_base(typename T::value_type target, typename T::value_type reference, T tolerance = T(0)) |
| 220 | : _target{ target }, _reference{ reference }, _tolerance{ tolerance } |
Michele Di Giorgio | ef4b4ae | 2017-07-04 17:19:43 +0100 | [diff] [blame] | 221 | { |
Michele Di Giorgio | ef4b4ae | 2017-07-04 17:19:43 +0100 | [diff] [blame] | 222 | } |
| 223 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 224 | typename T::value_type _target{}; |
| 225 | typename T::value_type _reference{}; |
| 226 | T _tolerance{}; |
| 227 | }; |
Michele Di Giorgio | ef4b4ae | 2017-07-04 17:19:43 +0100 | [diff] [blame] | 228 | |
Moritz Pflanzer | 5b61fd3 | 2017-09-12 15:51:33 +0100 | [diff] [blame^] | 229 | template <typename T> |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 230 | struct compare; |
| 231 | |
| 232 | template <typename U> |
Moritz Pflanzer | 5b61fd3 | 2017-09-12 15:51:33 +0100 | [diff] [blame^] | 233 | struct compare<AbsoluteTolerance<U>> : public compare_base<AbsoluteTolerance<U>> |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 234 | { |
| 235 | using compare_base<AbsoluteTolerance<U>>::compare_base; |
| 236 | |
| 237 | operator bool() const |
| 238 | { |
| 239 | if(!std::isfinite(this->_target) || !std::isfinite(this->_reference)) |
| 240 | { |
| 241 | return false; |
| 242 | } |
| 243 | else if(this->_target == this->_reference) |
| 244 | { |
| 245 | return true; |
| 246 | } |
| 247 | |
Moritz Pflanzer | 5b61fd3 | 2017-09-12 15:51:33 +0100 | [diff] [blame^] | 248 | using comparison_type = typename std::conditional<std::is_integral<U>::value, int64_t, U>::type; |
| 249 | |
| 250 | const comparison_type abs_difference(std::abs(static_cast<comparison_type>(this->_target) - static_cast<comparison_type>(this->_reference))); |
| 251 | |
| 252 | return abs_difference <= static_cast<comparison_type>(this->_tolerance); |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 253 | } |
| 254 | }; |
| 255 | |
| 256 | template <typename U> |
Moritz Pflanzer | 5b61fd3 | 2017-09-12 15:51:33 +0100 | [diff] [blame^] | 257 | struct compare<RelativeTolerance<U>> : public compare_base<RelativeTolerance<U>> |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 258 | { |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 259 | using compare_base<RelativeTolerance<U>>::compare_base; |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 260 | |
| 261 | operator bool() const |
| 262 | { |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 263 | if(!std::isfinite(this->_target) || !std::isfinite(this->_reference)) |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 264 | { |
| 265 | return false; |
| 266 | } |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 267 | else if(this->_target == this->_reference) |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 268 | { |
| 269 | return true; |
| 270 | } |
| 271 | |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 272 | const U epsilon = (std::is_same<half_float::half, typename std::remove_cv<U>::type>::value || (this->_reference == 0)) ? static_cast<U>(0.01) : std::numeric_limits<U>::epsilon(); |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 273 | |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 274 | if(std::abs(static_cast<double>(this->_reference) - static_cast<double>(this->_target)) <= epsilon) |
| 275 | { |
| 276 | return true; |
| 277 | } |
| 278 | else |
| 279 | { |
| 280 | if(static_cast<double>(this->_reference) == 0.0f) // We have checked whether _reference and _target is closing. If _reference is 0 but not closed to _target, it should return false |
| 281 | { |
| 282 | return false; |
| 283 | } |
| 284 | |
| 285 | const double relative_change = std::abs(static_cast<double>(this->_target) - static_cast<double>(this->_reference)) / this->_reference; |
| 286 | |
| 287 | return relative_change <= static_cast<U>(this->_tolerance); |
| 288 | } |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 289 | } |
| 290 | }; |
| 291 | |
| 292 | template <typename T, typename U> |
| 293 | void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, U tolerance_value, float tolerance_number) |
| 294 | { |
| 295 | // Validate with valid region covering the entire shape |
| 296 | validate(tensor, reference, shape_to_valid_region(tensor.shape()), tolerance_value, tolerance_number); |
| 297 | } |
| 298 | |
| 299 | template <typename T, typename U> |
| 300 | void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const ValidRegion &valid_region, U tolerance_value, float tolerance_number) |
| 301 | { |
| 302 | int64_t num_mismatches = 0; |
| 303 | int64_t num_elements = 0; |
| 304 | |
| 305 | ARM_COMPUTE_EXPECT_EQUAL(tensor.element_size(), reference.element_size(), framework::LogLevel::ERRORS); |
| 306 | ARM_COMPUTE_EXPECT_EQUAL(tensor.data_type(), reference.data_type(), framework::LogLevel::ERRORS); |
| 307 | |
| 308 | if(reference.format() != Format::UNKNOWN) |
| 309 | { |
| 310 | ARM_COMPUTE_EXPECT_EQUAL(tensor.format(), reference.format(), framework::LogLevel::ERRORS); |
| 311 | } |
| 312 | |
| 313 | ARM_COMPUTE_EXPECT_EQUAL(tensor.num_channels(), reference.num_channels(), framework::LogLevel::ERRORS); |
| 314 | ARM_COMPUTE_EXPECT(compare_dimensions(tensor.shape(), reference.shape()), framework::LogLevel::ERRORS); |
| 315 | |
| 316 | const int min_elements = std::min(tensor.num_elements(), reference.num_elements()); |
| 317 | const int min_channels = std::min(tensor.num_channels(), reference.num_channels()); |
| 318 | |
| 319 | // Iterate over all elements within valid region, e.g. U8, S16, RGB888, ... |
| 320 | for(int element_idx = 0; element_idx < min_elements; ++element_idx) |
| 321 | { |
| 322 | const Coordinates id = index2coord(reference.shape(), element_idx); |
| 323 | |
| 324 | if(is_in_valid_region(valid_region, id)) |
| 325 | { |
| 326 | // Iterate over all channels within one element |
| 327 | for(int c = 0; c < min_channels; ++c) |
| 328 | { |
| 329 | const T &target_value = reinterpret_cast<const T *>(tensor(id))[c]; |
| 330 | const T &reference_value = reinterpret_cast<const T *>(reference(id))[c]; |
| 331 | |
Moritz Pflanzer | 5b61fd3 | 2017-09-12 15:51:33 +0100 | [diff] [blame^] | 332 | if(!compare<U>(target_value, reference_value, tolerance_value)) |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 333 | { |
| 334 | ARM_COMPUTE_TEST_INFO("id = " << id); |
| 335 | ARM_COMPUTE_TEST_INFO("channel = " << c); |
| 336 | ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << framework::make_printable(target_value)); |
| 337 | ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << framework::make_printable(reference_value)); |
| 338 | ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << framework::make_printable(static_cast<typename U::value_type>(tolerance_value))); |
steniu01 | 172c58d | 2017-08-31 13:49:08 +0100 | [diff] [blame] | 339 | framework::ARM_COMPUTE_PRINT_INFO(); |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 340 | |
| 341 | ++num_mismatches; |
| 342 | } |
| 343 | |
| 344 | ++num_elements; |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | if(num_elements > 0) |
| 350 | { |
| 351 | const int64_t absolute_tolerance_number = tolerance_number * num_elements; |
| 352 | const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f; |
| 353 | |
| 354 | ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches |
| 355 | << "%) mismatched (maximum tolerated " << std::setprecision(2) << tolerance_number << "%)"); |
| 356 | ARM_COMPUTE_EXPECT(num_mismatches <= absolute_tolerance_number, framework::LogLevel::ERRORS); |
Michele Di Giorgio | ef4b4ae | 2017-07-04 17:19:43 +0100 | [diff] [blame] | 357 | } |
| 358 | } |
Giorgio Arena | fc2817d | 2017-06-27 17:26:37 +0100 | [diff] [blame] | 359 | |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 360 | template <typename T, typename U> |
| 361 | void validate(T target, T reference, U tolerance) |
| 362 | { |
| 363 | ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << framework::make_printable(reference)); |
| 364 | ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << framework::make_printable(target)); |
| 365 | ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << framework::make_printable(static_cast<typename U::value_type>(tolerance))); |
Moritz Pflanzer | 5b61fd3 | 2017-09-12 15:51:33 +0100 | [diff] [blame^] | 366 | ARM_COMPUTE_EXPECT((compare<U>(target, reference, tolerance)), framework::LogLevel::ERRORS); |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 367 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 368 | } // namespace validation |
| 369 | } // namespace test |
| 370 | } // namespace arm_compute |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 371 | #endif /* __ARM_COMPUTE_TEST_REFERENCE_VALIDATION_H__ */ |