diff options
Diffstat (limited to 'arm_compute/core/Utils.h')
-rw-r--r-- | arm_compute/core/Utils.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index 51967b1762..fc89d97073 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -40,12 +40,19 @@ namespace arm_compute { +/** Calculate the rounded up quotient of val / m. */ +template <typename S, typename T> +constexpr auto DIV_CEIL(S val, T m) -> decltype((val + m - 1) / m) +{ + return (val + m - 1) / m; +} + /** Computes the smallest number larger or equal to value that is a multiple of divisor. */ template <typename S, typename T> inline auto ceil_to_multiple(S value, T divisor) -> decltype(((value + divisor - 1) / divisor) * divisor) { ARM_COMPUTE_ERROR_ON(value < 0 || divisor <= 0); - return ((value + divisor - 1) / divisor) * divisor; + return DIV_CEIL(value, divisor) * divisor; } /** Computes the largest number smaller or equal to value that is a multiple of divisor. */ @@ -56,13 +63,6 @@ inline auto floor_to_multiple(S value, T divisor) -> decltype((value / divisor) return (value / divisor) * divisor; } -/** Calculate the rounded up quotient of val / m. */ -template <typename S, typename T> -constexpr auto DIV_CEIL(S val, T m) -> decltype((val + m - 1) / m) -{ - return (val + m - 1) / m; -} - /** Returns the arm_compute library build information * * Contains the version number and the build options used to build the library |