diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2020-03-26 12:14:21 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2020-03-26 14:31:59 +0000 |
commit | c0f0af390e5b78fa816879790bce0b1fd9c32111 (patch) | |
tree | 5bce27d9535e17db942577d570d10de3ac3793f6 /src/armnnUtils | |
parent | a10e2a26b20b124aaa03f20554172d88683257f7 (diff) | |
download | armnn-c0f0af390e5b78fa816879790bce0b1fd9c32111.tar.gz |
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 <francis.murtagh@arm.com>
Change-Id: Ie3f4ce0a0c199a578d8cca2fea8f5dcef63dba4d
Diffstat (limited to 'src/armnnUtils')
-rw-r--r-- | src/armnnUtils/BFloat16.hpp | 12 |
1 files changed, 5 insertions, 7 deletions
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<const uint16_t>((*u32 & 0x0000FFFF)); + const uint16_t error = static_cast<uint16_t>((*u32 & 0x0000FFFF)); if ((error > 0x8000 || (error == 0x8000 && lsb == 1))) { u16++; @@ -86,7 +84,7 @@ public: float ToFloat32() const { - const uint32_t u32 = static_cast<const uint32_t>(m_Value << 16u); + const uint32_t u32 = static_cast<uint32_t>(m_Value << 16u); const float* f32 = reinterpret_cast<const float*>(&u32); return *f32; } |