Files
openvino/docs/snippets/AUTO4.cpp
Karol Blaszczak 3dbea43ef1 [DOCS] remove mentions of myriad throughout docs (#15690)
* remove ov::device::thermal

ov::device::thermal was only supported on myriad

* additional cleanup

* remove myriad from AUTO and MULTI

auto n multi n hetero

+ remove mentions of listing myriad devices

* two final fixes

* Update ov_auto.py

---------

Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
2023-03-08 17:29:08 +04:00

37 lines
1.4 KiB
C++

#include <openvino/openvino.hpp>
int main() {
ov::Core core;
// Read a network in IR, PaddlePaddle, or ONNX format:
std::shared_ptr<ov::Model> model = core.read_model("sample.xml");
{
//! [part4]
// Example 1
ov::CompiledModel compiled_model0 = core.compile_model(model, "AUTO",
ov::hint::model_priority(ov::hint::Priority::HIGH));
ov::CompiledModel compiled_model1 = core.compile_model(model, "AUTO",
ov::hint::model_priority(ov::hint::Priority::MEDIUM));
ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO",
ov::hint::model_priority(ov::hint::Priority::LOW));
/************
Assume that all the devices (CPU and GPUs) can support all the models.
Result: compiled_model0 will use GPU.1, compiled_model1 will use GPU.0, compiled_model2 will use CPU.
************/
// Example 2
ov::CompiledModel compiled_model3 = core.compile_model(model, "AUTO",
ov::hint::model_priority(ov::hint::Priority::LOW));
ov::CompiledModel compiled_model4 = core.compile_model(model, "AUTO",
ov::hint::model_priority(ov::hint::Priority::MEDIUM));
ov::CompiledModel compiled_model5 = core.compile_model(model, "AUTO",
ov::hint::model_priority(ov::hint::Priority::LOW));
/************
Assume that all the devices (CPU and GPUs) can support all the models.
Result: compiled_model3 will use GPU.1, compiled_model4 will use GPU.1, compiled_model5 will use GPU.0.
************/
//! [part4]
}
return 0;
}