aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/armnn/Optional.hpp1
-rw-r--r--src/armnnUtils/BFloat16.hpp12
2 files changed, 6 insertions, 7 deletions
diff --git a/include/armnn/Optional.hpp b/include/armnn/Optional.hpp
index 677152636a..1b61e20425 100644
--- a/include/armnn/Optional.hpp
+++ b/include/armnn/Optional.hpp
@@ -274,6 +274,7 @@ public:
Optional() noexcept : BaseSwitch{} {}
Optional(const T& value) : BaseSwitch{value} {}
+ Optional& operator=(const Optional& other) = default;
Optional(EmptyOptional empty) : BaseSwitch{empty} {}
Optional(const Optional& other) : BaseSwitch{other} {}
Optional(const BaseSwitch& other) : BaseSwitch{other} {}
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;
}