IVGCVSW-5558 'Output all zeroes using EthosNAcc backend when falling back to CpuRef'
authorSadik Armagan <sadik.armagan@arm.com>
Wed, 18 Nov 2020 14:17:04 +0000 (14:17 +0000)
committerFrancis Murtagh <francis.murtagh@arm.com>
Wed, 18 Nov 2020 15:38:10 +0000 (15:38 +0000)
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I0c3ece5baf587e6cc22dfbec7ff98bd3573e0243

src/armnn/LoadedNetwork.cpp

index b5a1b39..7ef7f5f 100644 (file)
@@ -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));
     }
 }