Updated on OV 2.0 properties (#9906)

This commit is contained in:
Ilya Lavrenov 2022-01-28 18:52:50 +03:00 committed by GitHub
parent 4b35d48283
commit eaa0a68fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -292,7 +292,7 @@ namespace log {
* @brief Enum to define possible log levels
*/
enum class Level {
NO = -1, //!< disable any loging
NO = -1, //!< disable any logging
ERR = 0, //!< error events that might still allow the application to continue running
WARNING = 1, //!< potentially harmful situations which may further lead to ERROR
INFO = 2, //!< informational messages that display the progress of the application at coarse-grained level
@ -304,7 +304,7 @@ enum class Level {
inline std::ostream& operator<<(std::ostream& os, const Level& level) {
switch (level) {
case Level::NO:
return os << "NO";
return os << "LOG_NONE";
case Level::ERR:
return os << "LOG_ERROR";
case Level::WARNING:
@ -323,7 +323,7 @@ inline std::ostream& operator<<(std::ostream& os, const Level& level) {
inline std::istream& operator>>(std::istream& is, Level& level) {
std::string str;
is >> str;
if (str == "NO") {
if (str == "LOG_NONE") {
level = Level::NO;
} else if (str == "LOG_ERROR") {
level = Level::ERR;
@ -556,6 +556,7 @@ constexpr static const auto FP32 = "FP32"; //!< Device suppor
constexpr static const auto BF16 = "BF16"; //!< Device supports bf16 inference
constexpr static const auto FP16 = "FP16"; //!< Device supports fp16 inference
constexpr static const auto INT8 = "INT8"; //!< Device supports int8 inference
constexpr static const auto INT16 = "INT16"; //!< Device supports int16 inference
constexpr static const auto BIN = "BIN"; //!< Device supports binary inference
constexpr static const auto WINOGRAD = "WINOGRAD"; //!< Device supports winograd optimization
constexpr static const auto EXPORT_IMPORT = "EXPORT_IMPORT"; //!< Device supports model export and import

View File

@ -6,13 +6,14 @@
#include <sstream>
#include "ie_plugin_config.hpp"
#include "openvino/runtime/properties.hpp"
namespace ov {
std::map<std::string, std::string> any_copy(const ov::AnyMap& params) {
std::function<std::string(const Any&)> to_config_string = [&](const Any& any) -> std::string {
if (any.is<bool>()) {
return any.as<bool>() ? "YES" : "NO";
return any.as<bool>() ? CONFIG_VALUE(YES) : CONFIG_VALUE(NO);
} else if (any.is<AnyMap>()) {
std::stringstream strm;
for (auto&& val : any.as<AnyMap>()) {
@ -40,9 +41,9 @@ void any_lexical_cast(const ov::Any& from, ov::Any& to) {
if (to.is<std::string>()) {
to = from;
} else if (to.is<bool>()) {
if (str == "YES") {
if (str == CONFIG_VALUE(YES)) {
to = true;
} else if (str == "NO") {
} else if (str == CONFIG_VALUE(NO)) {
to = false;
} else {
OPENVINO_UNREACHABLE("Unsupported lexical cast to bool from: ", str);