diff --git a/inference-engine/include/ie_precision.hpp b/inference-engine/include/ie_precision.hpp index 51654fba512cf0..e72a8248f0082d 100644 --- a/inference-engine/include/ie_precision.hpp +++ b/inference-engine/include/ie_precision.hpp @@ -344,72 +344,89 @@ struct PrecisionTrait {}; template <> struct PrecisionTrait { using value_type = float; + enum { is_float = true }; }; template <> struct PrecisionTrait { using value_type = double; + enum { is_float = true }; }; template <> struct PrecisionTrait { using value_type = int16_t; + enum { is_float = true }; }; template <> struct PrecisionTrait { using value_type = int16_t; + enum { is_float = true }; }; template<> struct PrecisionTrait { using value_type = uint16_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = int16_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = uint16_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = uint8_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = uint8_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = int8_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = int8_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = uint8_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = int32_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = uint32_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = int64_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = uint64_t; + enum { is_float = false }; }; template <> struct PrecisionTrait { using value_type = int8_t; + enum { is_float = false }; }; template @@ -420,6 +437,7 @@ inline uint8_t type_size_or_zero() { template <> struct PrecisionTrait { using value_type = void; + enum { is_float = false }; }; template <> @@ -430,24 +448,6 @@ inline uint8_t type_size_or_zero() { return 0; } -namespace { -constexpr bool isSpecificFloatPrecision(const Precision::ePrecision& precision) { - return precision == Precision::FP16 || precision == Precision::BF16; -} -} // namespace - -template -inline typename std::enable_if::type -is_floating() { - return true; -} - -template -inline typename std::enable_if::type -is_floating() { - return std::is_floating_point::value_type>::value; -} - template inline Precision::PrecisionInfo Precision::makePrecisionInfo(const char* name) { Precision::PrecisionInfo info; @@ -455,7 +455,7 @@ inline Precision::PrecisionInfo Precision::makePrecisionInfo(const char* name) { size_t nBits = precision == BIN ? 1 : 8; info.bitsSize = nBits * type_size_or_zero::value_type>(); - info.isFloat = is_floating(); + info.isFloat = PrecisionTrait::is_float; info.value = precision; return info; }