[IE][VPU]: Improves myriad plugin API (#2816)
authorGladilov, Gleb <gleb.gladilov@intel.com>
Wed, 28 Oct 2020 08:14:14 +0000 (11:14 +0300)
committerGitHub <noreply@github.com>
Wed, 28 Oct 2020 08:14:14 +0000 (11:14 +0300)
commit18f7e4f4f08ca11fbcce560554f1fb1795f84a03
tree6a0a122a7f331479beda61deebbf7eff092d4992
parent91afa14901be5b3842acbad1e15460071c144ca6
[IE][VPU]: Improves myriad plugin API (#2816)

LoadNetwork takes network argument by constant reference.
Myriad plugin implementation applies transformations to
given network in order to get compiled model.
Transformations take network argument by non-constant
reference, so at some point of time network copy must be
acquired. ICNNNetwork is neither copyable nor movable, so
the only way to get network copy is using special utility
returning std::shared_ptr.

Myriad plugin does not expose any ownership strategy,
so prefers to take network argument by simple reference.
Plugin also requires nGraph -> CNN conversion during
LoadNetwork implementation. Conversion utilities returns
std::shared_ptr, which makes plugin to use workaround for
lifetime of converted object (to have 2 "pointers" to
network: raw pointer to input network and smart pointer to
converted network). Such workarounds make code more
error-prone, because using wrong pointer to semantically
the same object may lead to unexpected results.

To overcome these issues API has been changed in a way to
make interfaces more clear (do not expose ownership strategy
or mutability) and get rid of unnecessary workarounds.

Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
inference-engine/src/vpu/graph_transformer/include/vpu/frontend/frontend.hpp
inference-engine/src/vpu/graph_transformer/include/vpu/graph_transformer.hpp
inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp
inference-engine/src/vpu/graph_transformer/src/graph_transformer.cpp
inference-engine/src/vpu/myriad_plugin/myriad_executable_network.cpp
inference-engine/src/vpu/myriad_plugin/myriad_executable_network.h
inference-engine/src/vpu/myriad_plugin/myriad_plugin.cpp