diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/armnn/LoadedNetwork.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp index b5a1b392b4..7ef7f5f2f8 100644 --- a/src/armnn/LoadedNetwork.cpp +++ b/src/armnn/LoadedNetwork.cpp @@ -673,29 +673,24 @@ void LoadedNetwork::EnqueueOutput(const BindableLayer& layer, ITensorHandle* ten } if (needMemCopy) { - const Layer& connectedLayer = layer.GetInputSlots()[0].GetConnectedOutputSlot()->GetOwningLayer(); - // Do not add MemCopy Layer if OutputLayer is already connected the MemCopy Layer - if (connectedLayer.GetType() != LayerType::MemCopy) - { - // If we got here then we didn't export the memory, so add an output workload which performs a memcopy. - outputQueueDescriptor.m_Inputs.push_back(inputTensorHandle); - info.m_InputTensorInfos.push_back(inputTensorInfo); + // If we got here then we didn't export the memory, so add an output workload which performs a memcopy. + outputQueueDescriptor.m_Inputs.push_back(inputTensorHandle); + info.m_InputTensorInfos.push_back(inputTensorInfo); - std::unique_ptr<IWorkload> outputWorkload = - std::make_unique<CopyMemGenericWorkload>(outputQueueDescriptor, info); - ARMNN_ASSERT_MSG(outputWorkload, "No output workload created"); + std::unique_ptr<IWorkload> outputWorkload = + std::make_unique<CopyMemGenericWorkload>(outputQueueDescriptor, info); + ARMNN_ASSERT_MSG(outputWorkload, "No output workload created"); - std::unique_ptr<TimelineUtilityMethods> timelineUtils = - TimelineUtilityMethods::GetTimelineUtils(m_ProfilingService); - if (timelineUtils) - { - // Add Output Workload to the post-optimisation network structure - AddWorkloadStructure(timelineUtils, outputWorkload, layer); - timelineUtils->Commit(); - } - - m_OutputQueue.push_back(move(outputWorkload)); + std::unique_ptr<TimelineUtilityMethods> timelineUtils = + TimelineUtilityMethods::GetTimelineUtils(m_ProfilingService); + if (timelineUtils) + { + // Add Output Workload to the post-optimisation network structure + AddWorkloadStructure(timelineUtils, outputWorkload, layer); + timelineUtils->Commit(); } + + m_OutputQueue.push_back(move(outputWorkload)); } } |