From c357c47be8a3f210f9eee9a05cc13f1051b036d3 Mon Sep 17 00:00:00 2001 From: Alex Gilday Date: Wed, 21 Mar 2018 13:54:09 +0000 Subject: COMPMID-1008: Fix Doxygen issues Change-Id: Ie73d8771f85d1f5b059f3a56f1bbd73c98e94a38 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124723 Reviewed-by: Michalis Spyrou Tested-by: Jenkins --- tests/validation/FixedPoint.h | 31 ++++++++++++++++++++++--------- tests/validation/Helpers.h | 8 ++++---- tests/validation/Validation.h | 27 ++++++++++++++++++++++----- 3 files changed, 48 insertions(+), 18 deletions(-) (limited to 'tests/validation') diff --git a/tests/validation/FixedPoint.h b/tests/validation/FixedPoint.h index 9691e2a037..81c4f53724 100644 --- a/tests/validation/FixedPoint.h +++ b/tests/validation/FixedPoint.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -54,15 +54,26 @@ namespace traits // Promote types // *INDENT-OFF* // clang-format off +/** Promote a type */ template struct promote { }; -template <> struct promote { using type = uint16_t; }; -template <> struct promote { using type = int16_t; }; -template <> struct promote { using type = uint32_t; }; -template <> struct promote { using type = int32_t; }; -template <> struct promote { using type = uint64_t; }; -template <> struct promote { using type = int64_t; }; -template <> struct promote { using type = uint64_t; }; -template <> struct promote { using type = int64_t; }; +/** Promote uint8_t to uint16_t */ +template <> struct promote { using type = uint16_t; /**< Promoted type */ }; +/** Promote int8_t to int16_t */ +template <> struct promote { using type = int16_t; /**< Promoted type */ }; +/** Promote uint16_t to uint32_t */ +template <> struct promote { using type = uint32_t; /**< Promoted type */ }; +/** Promote int16_t to int32_t */ +template <> struct promote { using type = int32_t; /**< Promoted type */ }; +/** Promote uint32_t to uint64_t */ +template <> struct promote { using type = uint64_t; /**< Promoted type */ }; +/** Promote int32_t to int64_t */ +template <> struct promote { using type = int64_t; /**< Promoted type */ }; +/** Promote float to float */ +template <> struct promote { using type = float; /**< Promoted type */ }; +/** Promote half to half */ +template <> struct promote { using type = half; /**< Promoted type */ }; + +/** Get promoted type */ template using promote_t = typename promote::type; // clang-format on @@ -281,6 +292,7 @@ constexpr int clz(T value) return __builtin_clz(value) - (32 - std::numeric_limits::digits); } +/** Constant expressions */ template struct constant_expr { @@ -362,6 +374,7 @@ struct constant_expr return static_cast(std::min(std::max(val, static_cast(std::numeric_limits::min())), static_cast(std::numeric_limits::max()))); } }; +/** Functions */ struct functions { /** Output stream operator diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index b192f317b4..b5597090c6 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -151,10 +151,10 @@ TensorShape calculate_depth_concatenate_shape(const std::vector &in /** Parameters of Harris Corners algorithm. */ struct HarrisCornersParameters { - float threshold{ 0.f }; - float sensitivity{ 0.f }; - float min_dist{ 0.f }; - uint8_t constant_border_value{ 0 }; + float threshold{ 0.f }; /**< Threshold */ + float sensitivity{ 0.f }; /**< Sensitivity */ + float min_dist{ 0.f }; /**< Minimum distance */ + uint8_t constant_border_value{ 0 }; /**< Border value */ }; /** Generate parameters for Harris Corners algorithm. */ diff --git a/tests/validation/Validation.h b/tests/validation/Validation.h index b5f3a4a57a..26271c8bf3 100644 --- a/tests/validation/Validation.h +++ b/tests/validation/Validation.h @@ -69,7 +69,10 @@ public: { } - /** Implicit conversion to the underlying type. */ + /** Implicit conversion to the underlying type. + * + * @return the underlying type. + */ constexpr operator T() const { return _value; @@ -102,7 +105,10 @@ public: { } - /** Implicit conversion to the underlying type. */ + /** Implicit conversion to the underlying type. + * + * @return the underlying type. + */ constexpr operator value_type() const { return _value; @@ -241,27 +247,36 @@ template > void validate_keypoints(T target_first, T target_last, U reference_first, U reference_last, V tolerance = AbsoluteTolerance(), float allowed_missing_percentage = 5.f, float allowed_mismatch_percentage = 5.f); +/** Compare values with a tolerance. */ template struct compare_base { + /** Construct a comparison object. + * + * @param[in] target Target value. + * @param[in] reference Reference value. + * @param[in] tolerance Allowed tolerance. + */ compare_base(typename T::value_type target, typename T::value_type reference, T tolerance = T(0)) : _target{ target }, _reference{ reference }, _tolerance{ tolerance } { } - typename T::value_type _target{}; - typename T::value_type _reference{}; - T _tolerance{}; + typename T::value_type _target{}; /**< Target value */ + typename T::value_type _reference{}; /**< Reference value */ + T _tolerance{}; /**< Tolerance value */ }; template struct compare; +/** Compare values with an absolute tolerance */ template struct compare> : public compare_base> { using compare_base>::compare_base; + /** Perform comparison */ operator bool() const { if(!support::cpp11::isfinite(this->_target) || !support::cpp11::isfinite(this->_reference)) @@ -281,11 +296,13 @@ struct compare> : public compare_base> } }; +/** Compare values with a relative tolerance */ template struct compare> : public compare_base> { using compare_base>::compare_base; + /** Perform comparison */ operator bool() const { if(!support::cpp11::isfinite(this->_target) || !support::cpp11::isfinite(this->_reference)) -- cgit v1.2.1