Files
openvino/tests/time_tests/include/timetests_helper/utils.h
T
Xuejun Zhai 9b97235902 Xuejun/remove api in ov any (#15667)
* [Remove APIs] remove ov::any api  &

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove ov::any api

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove interfaces in ov::any  Base* operator->() & const Base* operator->()

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove ov::any interfaces Base* get() & const Base* get()

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove ov::any interfaces call(const Any& any) & dynamic_pointer_cast(const ::ov::Any& any) & static_pointer_cast(const ::ov::Any& any)

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] fix code format issues in ov::any

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] fix review issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] clear code

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix review issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix compiler issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix compiler issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix compiler issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* Fix variant error

Signed-off-by: xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>
Signed-off-by: xuejun <xuejun.zhai@intel.com>
2023-03-06 10:24:08 +04:00

55 lines
1.9 KiB
C++

// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <inference_engine.hpp>
#include <openvino/openvino.hpp>
#include <ie_plugin_config.hpp>
#include <string>
namespace TimeTest {
/**
* @brief Get extension from filename
* @param filename - name of the file which extension should be extracted
* @return string with extracted file extension
*/
std::string fileExt(const std::string &filename) {
auto pos = filename.rfind('.');
if (pos == std::string::npos) return "";
return filename.substr(pos + 1);
}
/**
* @brief Function that enables Latency performance hint for specified device (OV API 1)
*/
void setPerformanceConfig(InferenceEngine::Core ie, const std::string &device) {
auto supported_config_keys = ie.GetMetric(device, METRIC_KEY(SUPPORTED_CONFIG_KEYS)).as<std::vector<std::string>>();
if (std::find(supported_config_keys.begin(), supported_config_keys.end(), "PERFORMANCE_HINT") ==
supported_config_keys.end()) {
std::cerr << "Device " << device << " doesn't support config key 'PERFORMANCE_HINT'!\n"
<< "Performance config was not set.";
}
else
ie.SetConfig({{CONFIG_KEY(PERFORMANCE_HINT), CONFIG_VALUE(LATENCY)}}, device);
}
/**
* @brief Function that enables Latency performance hint for specified device (OV API 2)
*/
void setPerformanceConfig(ov::Core ie, const std::string &device) {
auto supported_config_keys = ie.get_property(device, METRIC_KEY(SUPPORTED_CONFIG_KEYS)).as<std::vector<std::string>>();
if (std::find(supported_config_keys.begin(), supported_config_keys.end(), "PERFORMANCE_HINT") ==
supported_config_keys.end()) {
std::cerr << "Device " << device << " doesn't support config key 'PERFORMANCE_HINT'!\n"
<< "Performance config was not set.";
}
else
ie.set_property(device, {{CONFIG_KEY(PERFORMANCE_HINT), CONFIG_VALUE(LATENCY)}});
}
}