Updated multi code snippets (#11037)

This commit is contained in:
Ilya Lavrenov
2022-03-20 15:44:33 +08:00
committed by GitHub
parent 72e8661157
commit 5390aa7ebc
7 changed files with 29 additions and 34 deletions
+5 -8
View File
@@ -1,23 +1,20 @@
#include <openvino/openvino.hpp>
int main() {
ov::AnyMap hddl_config = {{ov::enable_profiling(true)}};
ov::AnyMap gpu_config = {{ov::enable_profiling(true)}};
ov::AnyMap hddl_config, gpu_config;
//! [part4]
// configure the HDDL device first
ov::Core core;
std::shared_ptr<ov::Model> model = core.read_model("sample.xml");
core.set_property({ov::device::properties("HDDL", hddl_config),
ov::device::properties("GPU", gpu_config)});
// compile the modle on the multi-device, while specifying the configuration (devices along with priorities
// compile the modle on the multi-device,
// while specifying the configuration (devices along with priorities
// and the configuration of devices):
ov::CompiledModel compileModel = core.compile_model(model, "MULTI",
ov::device::priorities("HDDL,GPU"),
ov::device::priorities("HDDL", "GPU"),
ov::device::properties("HDDL", hddl_config),
ov::device::properties("GPU", gpu_config));
// query the optimal number of requests:
// query the optimal number of requests:
uint32_t nireq = compileModel.get_property(ov::optimal_number_of_infer_requests);
//! [part4]
return 0;