From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_neon_pad_workload_8cpp_source.xhtml | 137 +++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 20.02/_neon_pad_workload_8cpp_source.xhtml (limited to '20.02/_neon_pad_workload_8cpp_source.xhtml') diff --git a/20.02/_neon_pad_workload_8cpp_source.xhtml b/20.02/_neon_pad_workload_8cpp_source.xhtml new file mode 100644 index 0000000000..2ef72bbbe4 --- /dev/null +++ b/20.02/_neon_pad_workload_8cpp_source.xhtml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + +ArmNN: src/backends/neon/workloads/NeonPadWorkload.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
NeonPadWorkload.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "NeonPadWorkload.hpp"
7 
10 #include <arm_compute/core/Types.h>
11 #include <arm_compute/runtime/NEON/functions/NEPadLayer.h>
12 
13 #include "NeonWorkloadUtils.hpp"
14 
15 namespace armnn
16 {
17 using namespace armcomputetensorutils;
18 
20  : BaseWorkload<PadQueueDescriptor>(descriptor, info)
21 {
22  m_Data.ValidateInputsOutputs("NeonPadWorkload", 1, 1);
23 
24  arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
25  arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
26 
27  std::vector<std::pair<unsigned int, unsigned int>> reversed_PadList(descriptor.m_Parameters.m_PadList.size());
28 
29  std::reverse_copy(std::begin(descriptor.m_Parameters.m_PadList),
30  std::end(descriptor.m_Parameters.m_PadList),
31  std::begin(reversed_PadList));
32 
33  arm_compute::PaddingList padList = static_cast<arm_compute::PaddingList>(reversed_PadList);
34 
35  arm_compute::PixelValue pixelValue = GetPixelValue(input, descriptor.m_Parameters.m_PadValue);
36 
37  auto layer = std::make_unique<arm_compute::NEPadLayer>();
38  layer->configure(&input, &output, padList, pixelValue);
39  m_Layer.reset(layer.release());
40 }
41 
43 {
44  ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonPadWorkload_Execute");
45  m_Layer->run();
46 }
47 
49  const TensorInfo& output,
50  const PadDescriptor& descriptor)
51 {
52  const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input);
53  const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
54 
55  std::vector<std::pair<unsigned int, unsigned int>> reversed_PadList(descriptor.m_PadList.size());
56 
57  std::reverse_copy(std::begin(descriptor.m_PadList),
58  std::end(descriptor.m_PadList),
59  std::begin(reversed_PadList));
60 
61  arm_compute::PaddingList padList = static_cast<arm_compute::PaddingList>(reversed_PadList);
62 
63  return arm_compute::NEPadLayer::validate(&aclInputInfo, &aclOutputInfo, padList);
64 }
65 
66 } // namespace armnn
float m_PadValue
Optional value to use for padding, defaults to 0.
+ +
const PadQueueDescriptor m_Data
Definition: Workload.hpp:46
+
#define ARMNN_SCOPED_PROFILING_EVENT_NEON(name)
+ + +
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
+
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding for input dimension.
+
Copyright (c) 2020 ARM Limited.
+ + + +
A PadDescriptor for the PadLayer.
+ +
NeonPadWorkload(const PadQueueDescriptor &descriptor, const WorkloadInfo &info)
+
Status
enumeration
Definition: Types.hpp:26
+ +
arm_compute::Status NeonPadWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor)
+
std::vector< ITensorHandle * > m_Outputs
+ +
Contains information about inputs and outputs to a layer.
+
std::vector< ITensorHandle * > m_Inputs
+ +
void Execute() const override
+
+
+ + + + -- cgit v1.2.1