[CPU] Add workaround for Ngraph OPs friendly name initialization (#5916)

Otherwise they are initialized concurrently in scope of MKLDNNNode
constructor without thread safety
This commit is contained in:
Egor Duplensky 2021-06-01 09:45:00 +03:00 committed by GitHub
parent 115aa143ef
commit 467122229a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,6 +70,13 @@ MKLDNNExecNetwork::MKLDNNExecNetwork(const InferenceEngine::CNNNetwork &network,
_callbackExecutor = _taskExecutor;
}
// Workaround for initializing friendly names for all the OPs
// Otherwise they are initialized concurrently without thread safety.
// TODO: Can be removed after 57069 is done.
for (const auto& op : _network.getFunction()->get_ops()) {
op->get_friendly_name();
}
int streams = std::max(1, _cfg.streamExecutorConfig._streams);
std::vector<Task> tasks; tasks.resize(streams);
_graphs.resize(streams);