Skip to content

Commit

Permalink
[GNA] Properly obtain all subsequent layers for memory layer connecti…
Browse files Browse the repository at this point in the history
…on (#21602)
  • Loading branch information
tadamowicz authored Dec 13, 2023
1 parent ef14b50 commit 9fe38f1
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/plugins/intel_gna/src/gna_graph_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2404,22 +2404,15 @@ void GNAGraphCompiler::connectOutput(InferenceEngine::CNNLayerPtr layer, void* p
log::debug() << "Connecting output " << layer->name << " ...\n";
// in case of Memory Layer it's input allocated in meminput layer
if (layer->outData.size() == 1) {
for (int j = 0; j != static_cast<int>(getInputTo(layer->outData.front()).size()); j++) {
auto isNonFunctional = [](CNNLayerPtr l) {
return LayerInfo(l).isNonFunctional();
};

if (!CNNNetHasNextLayerSkipCertain(layer, 0, j, isNonFunctional)) {
continue;
}
auto nextLayer = CNNNetGetNextLayerSkipCertain(layer, 0, j, isNonFunctional);
auto isNonFunctional = [](CNNLayerPtr l) {
return LayerInfo(l).isNonFunctional();
};

if (!nextLayer.first) {
log::debug() << "for layer: " << layer->name << "outData[0] has non functional connection at " << j;
}
auto next_layers = CNNNetGetAllNextLayersSkipCertain(layer, -1, isNonFunctional);
for (auto& next_layer : next_layers) {
auto nextMemoryLayerIt =
std::find_if(begin(memory_connection), end(memory_connection), [&](MemoryConnection::value_type& comp) {
return comp.second.getOutput()->name == nextLayer.first->name;
return comp.second.getOutput()->name == next_layer->name;
});
if (nextMemoryLayerIt != memory_connection.end()) {
auto& nextMemoryLayer = nextMemoryLayerIt->second;
Expand Down

0 comments on commit 9fe38f1

Please sign in to comment.