diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2023-12-22 10:51:36 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2023-12-22 11:57:11 +0000 |
commit | dda691c3b6d45de1e2dea28674ae6af6e17e9815 (patch) | |
tree | 1d3a658464770f0a5da3a37ed9ccfd07a6fbb25e | |
parent | 306a8a9fb0dacd2c1e5d65f76420c12162203986 (diff) | |
download | ComputeLibrary-dda691c3b6d45de1e2dea28674ae6af6e17e9815.tar.gz |
Call std::round() directly in non Androidâ„¢ and Bare Metal builds
The workaround is not relevant anymore as we update our memory debugging tools.
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: Ib00e0ad9ba693f97fee87158dd03d3617dce9282
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10908
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r-- | support/ToolchainSupport.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h index 4d394889c3..accbb643c2 100644 --- a/support/ToolchainSupport.h +++ b/support/ToolchainSupport.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_SUPPORT_TOOLCHAINSUPPORT -#define ARM_COMPUTE_SUPPORT_TOOLCHAINSUPPORT +#ifndef ACL_SUPPORT_TOOLCHAINSUPPORT_H +#define ACL_SUPPORT_TOOLCHAINSUPPORT_H #include "support/Bfloat16.h" #include "support/Half.h" @@ -184,8 +184,7 @@ inline T nearbyint(T value) template <typename T, typename = typename std::enable_if<std::is_floating_point<T>::value>::type> inline T round(T value) { - //Workaround Valgrind's mismatches: when running from Valgrind the call to std::round(-4.500000) == -4.000000 instead of 5.00000 - return (value < 0.f) ? static_cast<int>(value - 0.5f) : static_cast<int>(value + 0.5f); + return std::round(value); } /** Round floating-point value with half value rounding away from zero and cast to long @@ -331,4 +330,4 @@ inline bool signbit(bfloat16 value) } // namespace cpp11 } // namespace support } // namespace arm_compute -#endif /* ARM_COMPUTE_SUPPORT_TOOLCHAINSUPPORT */ +#endif // ACL_SUPPORT_TOOLCHAINSUPPORT_H |