diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-06-07 11:47:16 +0100 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-06-07 13:55:03 +0000 |
commit | e6bcb5b4c5e6933e87ab5e081fdfae219adea713 (patch) | |
tree | 07afb88ff4a5a2a2b8609696a54d78a02f96bd72 /support | |
parent | 151fa87bd5536fe224e67680078d84e058e50b4d (diff) | |
download | ComputeLibrary-e6bcb5b4c5e6933e87ab5e081fdfae219adea713.tar.gz |
COMPMID-2397: 64bit bare metal build failure
Change-Id: I003973ab658edff580335c47ebe658ca038602ac
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1311
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'support')
-rw-r--r-- | support/ToolchainSupport.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h index 7d02e67ec6..020a4a112b 100644 --- a/support/ToolchainSupport.h +++ b/support/ToolchainSupport.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -117,6 +117,21 @@ inline std::string to_string(T && value) return stream.str(); } +/** Rounds the floating-point argument arg to an integer value in floating-point format, using the current rounding mode. + * + * @note This function acts as a convenience wrapper around std::nearbyint. The + * latter is missing in some Android toolchains. + * + * @param[in] value Value to be rounded. + * + * @return The rounded value. + */ +template <typename T> +inline T nearbyint(T value) +{ + return ::nearbyint(value); +} + /** Convert string values to float. * * @note This function implements the same behaviour as std::stof. The latter @@ -212,6 +227,21 @@ inline std::string to_string(T &&value) return ::std::to_string(std::forward<T>(value)); } +/** Rounds the floating-point argument arg to an integer value in floating-point format, using the current rounding mode. + * + * @note This function acts as a convenience wrapper around std::nearbyint. The + * latter is missing in some Android toolchains. + * + * @param[in] value Value to be rounded. + * + * @return The rounded value. + */ +template <typename T> +inline T nearbyint(T value) +{ + return std::nearbyint(value); +} + /** Convert string values to float. * * @note This function acts as a convenience wrapper around std::stof. The |