ArmNN
 24.08
OutputHandler.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "OutputHandler.hpp"
7 
11 
12 namespace armnn
13 {
14 
16 {
17  m_TensorInfo = tensorInfo;
18  m_bTensorInfoSet = true;
19 }
20 
21 void OutputHandler::CreateTensorHandles(const IWorkloadFactory& factory, const bool IsMemoryManaged)
22 {
24  m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
26 }
27 
28 void OutputHandler::CreateTensorHandles(const ITensorHandleFactory& factory, const bool IsMemoryManaged)
29 {
30  m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
31 }
32 
34 {
35  dataCollector.Push(m_TensorHandle.get(), m_TensorInfo);
36 }
37 
39 {
40  // Set allocated data only once
41  if (!m_AllocatedTensorHandle)
42  {
43  m_AllocatedTensorHandle = std::move(m_TensorHandle);
44  }
45 }
46 
47 } // namespace armnn
armnn::IWorkloadFactory::CreateTensorHandle
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const =0
OutputHandler.hpp
WorkloadDataCollector.hpp
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::OutputHandler::SetTensorInfo
void SetTensorInfo(const TensorInfo &tensorInfo)
Sets the TensorInfo used by this output handler.
Definition: OutputHandler.cpp:15
ARMNN_NO_DEPRECATE_WARN_BEGIN
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
armnn::OutputHandler::CreateTensorHandles
void CreateTensorHandles(const IWorkloadFactory &factory, const bool IsMemoryManaged=true)
Creates tensor handles used by the intermediate tensors.
Definition: OutputHandler.cpp:21
WorkloadFactory.hpp
ITensorHandle.hpp
armnn::WorkloadDataCollector
Definition: WorkloadDataCollector.hpp:15
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::ITensorHandleFactory
Definition: ITensorHandleFactory.hpp:46
armnn::WorkloadDataCollector::Push
void Push(ITensorHandle *handle, const TensorInfo &info)
Definition: WorkloadDataCollector.hpp:24
armnn::ITensorHandleFactory::CreateTensorHandle
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0
ARMNN_NO_DEPRECATE_WARN_END
#define ARMNN_NO_DEPRECATE_WARN_END
Definition: Deprecated.hpp:34
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::OutputHandler::SetAllocatedData
void SetAllocatedData()
Definition: OutputHandler.cpp:38
armnn::OutputHandler::CollectWorkloadOutputs
void CollectWorkloadOutputs(WorkloadDataCollector &dataCollector) const
Fill the outputs for a given queue descriptor.
Definition: OutputHandler.cpp:33