24.08
RefResizeWorkload.cpp
Go to the documentation of this file.
1
//
2
// Copyright © 2019-2023 Arm Ltd and Contributors. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#include "
RefResizeWorkload.hpp
"
7
8
#include "
RefWorkloadUtils.hpp
"
9
#include "
Resize.hpp
"
10
#include "
BaseIterator.hpp
"
11
#include "
Profiling.hpp
"
12
13
#include "
BaseIterator.hpp
"
14
#include "
Decoders.hpp
"
15
#include "
Encoders.hpp
"
16
17
namespace
armnn
18
{
19
20
void
RefResizeWorkload::Execute
()
const
21
{
22
Execute
(
m_Data
.
m_Inputs
,
m_Data
.
m_Outputs
);
23
}
24
25
void
RefResizeWorkload::ExecuteAsync
(
ExecutionData
& executionData)
26
{
27
WorkingMemDescriptor
* workingMemDescriptor =
static_cast<
WorkingMemDescriptor
*
>
(executionData.
m_Data
);
28
Execute
(workingMemDescriptor->
m_Inputs
, workingMemDescriptor->
m_Outputs
);
29
}
30
31
void
RefResizeWorkload::Execute
(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs)
const
32
{
33
ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID
(
"RefResizeWorkload_Execute"
);
34
35
const
TensorInfo
& inputInfo =
GetTensorInfo
(inputs[0]);
36
const
TensorInfo
& outputInfo =
GetTensorInfo
(outputs[0]);
37
38
std::unique_ptr<Decoder<float>> decoderPtr = MakeDecoder<float>(inputInfo, inputs[0]->
Map
());
39
Decoder<float>
&decoder = *decoderPtr;
40
std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputInfo, outputs[0]->
Map
());
41
Encoder<float>
&encoder = *encoderPtr;
42
43
Resize
(decoder,
44
inputInfo,
45
encoder,
46
outputInfo,
47
m_Data
.
m_Parameters
.
m_DataLayout
,
48
m_Data
.
m_Parameters
.
m_Method
,
49
m_Data
.
m_Parameters
.
m_AlignCorners
,
50
m_Data
.
m_Parameters
.
m_HalfPixelCenters
);
51
}
52
53
}
//namespace armnn
armnn::Decoder< float >
Resize.hpp
armnn::ResizeDescriptor::m_HalfPixelCenters
bool m_HalfPixelCenters
Half Pixel Centers.
Definition:
Descriptors.hpp:1018
BaseIterator.hpp
armnn::RefResizeWorkload::ExecuteAsync
void ExecuteAsync(ExecutionData &executionData) override
Definition:
RefResizeWorkload.cpp:25
armnn::experimental::ExecutionData::m_Data
void * m_Data
Definition:
ExecutionData.hpp:16
armnn::TensorInfo
Definition:
Tensor.hpp:152
Profiling.hpp
armnn::ResizeDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Definition:
Descriptors.hpp:1014
ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition:
RefWorkloadUtils.hpp:22
RefResizeWorkload.hpp
armnn::ResizeDescriptor::m_Method
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
Definition:
Descriptors.hpp:1012
armnn::Encoder< float >
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition:
WorkloadData.hpp:66
armnn::RefResizeWorkload::Execute
void Execute() const override
Definition:
RefResizeWorkload.cpp:20
armnn::GetTensorInfo
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
Definition:
RefWorkloadUtils.hpp:33
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition:
WorkloadData.hpp:27
armnn::Resize
void Resize(Decoder< float > &in, const TensorInfo &inputInfo, Encoder< float > &out, const TensorInfo &outputInfo, DataLayoutIndexed dataLayout, ResizeMethod resizeMethod, bool alignCorners, bool halfPixelCenters)
Definition:
Resize.cpp:65
RefWorkloadUtils.hpp
armnn::ResizeDescriptor::m_AlignCorners
bool m_AlignCorners
Aligned corners.
Definition:
Descriptors.hpp:1016
armnn::BaseWorkload< ResizeQueueDescriptor >::m_Data
ResizeQueueDescriptor m_Data
Definition:
Workload.hpp:89
Decoders.hpp
armnn::LayerType::Map
@ Map
armnn::experimental::WorkingMemDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition:
WorkingMemDescriptor.hpp:20
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
armnn::experimental::WorkingMemDescriptor
Definition:
WorkingMemDescriptor.hpp:18
Encoders.hpp
armnn::experimental::WorkingMemDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition:
WorkingMemDescriptor.hpp:21
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition:
WorkloadData.hpp:26
armnn::experimental::ExecutionData
Definition:
ExecutionData.hpp:14
src
backends
reference
workloads
RefResizeWorkload.cpp
Generated on Wed Aug 28 2024 14:31:51 for Arm NN by
1.8.17