This class holds precision value and provides precision related operations. More...
#include <ie_precision.hpp>
Public Types | |
enum | ePrecision : uint8_t { UNSPECIFIED = 255 , MIXED = 0 , FP32 = 10 , FP16 = 11 , BF16 = 12 , FP64 = 13 , Q78 = 20 , I16 = 30 , U8 = 40 , I8 = 50 , U16 = 60 , I32 = 70 , U32 = 74 , I64 = 72 , U64 = 73 , BIN = 71 , BOOL = 41 , CUSTOM = 80 } |
Public Member Functions | |
Precision ()=default | |
Default constructor. | |
Precision (const Precision::ePrecision value) | |
Constructor with specified precision. More... | |
Precision (size_t bitsSize, const char *name=nullptr) | |
Custom precision constructor. More... | |
template<class T > | |
bool | hasStorageType (const char *typeName=nullptr) const noexcept |
checks whether given storage class T can be used to store objects of current precision | |
bool | operator== (const Precision &p) const noexcept |
Equality operator with Precision object. More... | |
bool | operator== (const ePrecision p) const noexcept |
Equality operator with ePrecision enum value. More... | |
bool | operator!= (const ePrecision p) const noexcept |
Inequality operator with ePrecision enum value. More... | |
Precision & | operator= (const ePrecision p) noexcept |
Assignment operator with ePrecision enum value. More... | |
operator bool () const noexcept | |
Cast operator to a bool. More... | |
bool | operator! () const noexcept |
Logical negation operator. More... | |
operator Precision::ePrecision () const noexcept | |
Cast operator to a ePrecision. More... | |
constexpr uint8_t | getPrecVal () const noexcept |
Gets the precision value of type ePrecision. More... | |
const char * | name () const noexcept |
Getter of precision name. More... | |
size_t | size () const |
Returns size of single element of that precision in bits. More... | |
bool | is_float () const noexcept |
Checks if it is a floating point value. More... | |
bool | isSigned () const noexcept |
Checks if it is a signed value. More... | |
Static Public Member Functions | |
template<class T > | |
static Precision | fromType (const char *typeName=nullptr) |
Creates custom precision with specific underlined type. | |
static Precision | FromStr (const std::string &str) |
Creates Precision from string with precision name. More... | |
Static Protected Member Functions | |
template<Precision::ePrecision precision> | |
static PrecisionInfo | makePrecisionInfo (const char *name) |
Creates PrecisionInfo by precision with a specified name. More... | |
static bool | areSameStrings (const char *l, const char *r) noexcept |
Compare two c-strings. More... | |
static PrecisionInfo | getPrecisionInfo (ePrecision v) |
Creates PrecisionInfo based on ePrecision. More... | |
This class holds precision value and provides precision related operations.
enum InferenceEngine::Precision::ePrecision : uint8_t |
Enum to specify of different
|
inline |
Constructor with specified precision.
value | A value of ePrecision to create an object from |
|
inlineexplicit |
Custom precision constructor.
bitsSize | size of elements |
name | optional: name string, used in serialisation |
|
inlinestaticprotectednoexcept |
Compare two c-strings.
l | Const pointer to first string |
r | Const pointer to another string |
|
inlinestatic |
|
inlinestaticprotected |
Creates PrecisionInfo based on ePrecision.
v | A value of ePrecision emuneration |
|
inlineconstexprnoexcept |
Gets the precision value of type ePrecision.
|
inlinenoexcept |
Checks if it is a floating point value.
false
otherwise
|
inlinenoexcept |
Checks if it is a signed value.
false
otherwise
|
staticprotected |
Creates PrecisionInfo by precision
with a specified name.
precision | A precision to create PrecisionInfo for |
name | Name of precision |
|
inlinenoexcept |
Getter of precision name.
|
inlineexplicitnoexcept |
Cast operator to a bool.
true
if precision is specified, false
otherwise
|
inlinenoexcept |
Cast operator to a ePrecision.
|
inlinenoexcept |
Logical negation operator.
true
if precision is NOT specified, false
otherwise
|
inlinenoexcept |
Inequality operator with ePrecision enum value.
p | A value of ePrecision to compare with |
true
if values represent different precisions, false
otherwise
|
inlinenoexcept |
Assignment operator with ePrecision enum value.
p | A value of ePrecision enumeration |
|
inlinenoexcept |
Equality operator with ePrecision enum value.
p | A value of ePrecision to compare with |
true
if values represent the same precisions, false
otherwise
|
inlinenoexcept |
|
inline |
Returns size of single element of that precision in bits.