Files
openvino/docs/snippets/AUTO4.cpp
Xie Zhengtian 79290a7dc0 [Doc] Add doc for Auto-Device Plugin 2021.4 (#5982)
* [Doc] Add doc for Auto-Device Plugin 2021.4 (#6190)

* Add doc for Auto-Device Plugin

Signed-off-by: Zhengtian Xie <zhengtian.xie@intel.com>

* Update doc for auto-device plugin

Signed-off-by: Zhengtian Xie <zhengtian.xie@intel.com>

* Update auto-device plugin doc

* Add openvino_docs_IE_DG_supported_plugins_AUTO into web page

Signed-off-by: Zhengtian Xie <zhengtian.xie@intel.com>

* Update AUTO.md

Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com>
2021-08-13 14:23:44 +03:00

20 lines
952 B
C++

#include <ie_core.hpp>
int main() {
const std::map<std::string, std::string> cpu_config = { { InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES } };
const std::map<std::string, std::string> gpu_config = { { InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES } };
//! [part4]
InferenceEngine::Core ie;
InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml");
// configure the CPU device first
ie.SetConfig(cpu_config, "CPU");
// configure the GPU device
ie.SetConfig(gpu_config, "GPU");
// load the network to the auto-device
InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, "AUTO");
// new metric allows to query the optimization capabilities
std::vector<std::string> device_cap = exeNetwork.GetMetric(METRIC_KEY(OPTIMIZATION_CAPABILITIES));
//! [part4]
return 0;
}