Skip to content

Commit

Permalink
Fix NormalizeL2 creation in QueryNetwork (cherry pick from master PR …
Browse files Browse the repository at this point in the history
…4310)
  • Loading branch information
Mikhail Letavin committed Mar 9, 2021
1 parent e09f0e4 commit a0f30fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion inference-engine/src/cldnn_engine/cldnn_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,12 @@ QueryNetworkResult clDNNEngine::QueryNetwork(const CNNNetwork& network,
CLDNNPlugin::Config conf = _impl->m_config;
UpdateConfig(conf, network, config);

Program prog;
if (m_defaultContext == nullptr) {
m_defaultContext.reset(new CLDNNRemoteCLContext(
std::const_pointer_cast<InferenceEngine::IInferencePlugin>(shared_from_this()),
ParamMap(), conf));
}
Program prog(m_defaultContext->getImpl()->GetEngine(), conf);
auto function = network.getFunction();
if (function == nullptr) {
THROW_IE_EXCEPTION << "CNNetworkImpl representation is not supported anymore";
Expand Down
2 changes: 1 addition & 1 deletion inference-engine/src/cldnn_engine/cldnn_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class clDNNEngine : public InferenceEngine::InferencePluginInternal,
std::map<std::string, cldnn::device> device_map;
std::mutex engine_mutex;

CLDNNRemoteCLContext::Ptr m_defaultContext;
mutable CLDNNRemoteCLContext::Ptr m_defaultContext;

cldnn::device_info GetDeviceInfo(const std::map<std::string, std::string> &config) const;
InferenceEngine::CNNNetwork CloneAndTransformNetwork(const InferenceEngine::CNNNetwork& network,
Expand Down
2 changes: 2 additions & 0 deletions inference-engine/src/cldnn_engine/cldnn_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct PerfCounter {
class Program {
public:
Program(InferenceEngine::CNNNetwork& network, std::shared_ptr<const cldnn::engine> engine, const Config& config);
Program(std::shared_ptr<const cldnn::engine> engine, const Config& config) : m_config(config), m_engine(engine),
m_curBatch(-1), queryMode(false), m_max_batch(1) {}
Program() : m_config({}), m_engine(nullptr), m_curBatch(-1), queryMode(false), m_max_batch(1) {}

static const cldnn::primitive_id m_preProcessTag;
Expand Down

0 comments on commit a0f30fb

Please sign in to comment.