From c0f0af390e5b78fa816879790bce0b1fd9c32111 Mon Sep 17 00:00:00 2001 From: Francis Murtagh Date: Thu, 26 Mar 2020 12:14:21 +0000 Subject: IVGCVSW-4599 ArmNN Compile Error when compiled against gcc 9 * Use default keyword for armnn::Optional assignment. * Use default keyword for BFloat16 copy constructor and assignment. * Remove unnecessary const from static_cast template argument which was giving ignored-qualifiers warning. Signed-off-by: Francis Murtagh Change-Id: Ie3f4ce0a0c199a578d8cca2fea8f5dcef63dba4d --- src/armnnUtils/BFloat16.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/armnnUtils/BFloat16.hpp b/src/armnnUtils/BFloat16.hpp index 16ceb524c3..52344db810 100644 --- a/src/armnnUtils/BFloat16.hpp +++ b/src/armnnUtils/BFloat16.hpp @@ -18,6 +18,8 @@ public: : m_Value(0) {} + BFloat16(const BFloat16& v) = default; + explicit BFloat16(uint16_t v) : m_Value(v) {} @@ -32,11 +34,7 @@ public: return ToFloat32(); } - BFloat16& operator=(const BFloat16& other) - { - m_Value = other.Val(); - return *this; - } + BFloat16& operator=(const BFloat16& other) = default; BFloat16& operator=(float v) { @@ -74,7 +72,7 @@ public: // Mark the LSB const uint16_t lsb = u16 & 0x0001; // Mark the error to be truncate (the rest of 16 bits of FP32) - const uint16_t error = static_cast((*u32 & 0x0000FFFF)); + const uint16_t error = static_cast((*u32 & 0x0000FFFF)); if ((error > 0x8000 || (error == 0x8000 && lsb == 1))) { u16++; @@ -86,7 +84,7 @@ public: float ToFloat32() const { - const uint32_t u32 = static_cast(m_Value << 16u); + const uint32_t u32 = static_cast(m_Value << 16u); const float* f32 = reinterpret_cast(&u32); return *f32; } -- cgit v1.2.1