ArmNN
 25.11
Loading...
Searching...
No Matches
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
12namespace armnn
13{
14
16{
17 m_TensorInfo = tensorInfo;
18 m_bTensorInfoSet = true;
19}
20
21void OutputHandler::CreateTensorHandles(const IWorkloadFactory& factory, const bool IsMemoryManaged)
22{
24 m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
26}
27
28void 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
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
#define ARMNN_NO_DEPRECATE_WARN_END
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const =0
void SetTensorInfo(const TensorInfo &tensorInfo)
Sets the TensorInfo used by this output handler.
void CollectWorkloadOutputs(WorkloadDataCollector &dataCollector) const
Fill the outputs for a given queue descriptor.
void CreateTensorHandles(const IWorkloadFactory &factory, const bool IsMemoryManaged=true)
Creates tensor handles used by the intermediate tensors.
void Push(ITensorHandle *handle, const TensorInfo &info)
Copyright (c) 2021 ARM Limited and Contributors.