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_stack_workload_8cpp_source.xhtml | 139 +++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 20.02/_neon_stack_workload_8cpp_source.xhtml (limited to '20.02/_neon_stack_workload_8cpp_source.xhtml') diff --git a/20.02/_neon_stack_workload_8cpp_source.xhtml b/20.02/_neon_stack_workload_8cpp_source.xhtml new file mode 100644 index 0000000000..ad5290af14 --- /dev/null +++ b/20.02/_neon_stack_workload_8cpp_source.xhtml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + +ArmNN: src/backends/neon/workloads/NeonStackWorkload.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
NeonStackWorkload.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "NeonStackWorkload.hpp"
6 #include "NeonWorkloadUtils.hpp"
7 
11 
12 #include <boost/numeric/conversion/cast.hpp>
13 #include <boost/polymorphic_pointer_cast.hpp>
14 
15 namespace armnn
16 {
17 using namespace armcomputetensorutils;
18 
19 namespace
20 {
21 int CalcAxis(const unsigned int axis, const unsigned int inputDimensions)
22 {
23  const int intAxis = boost::numeric_cast<int>(axis);
24  return boost::numeric_cast<int>(inputDimensions) - intAxis;
25 }
26 } //namespace
27 
28 arm_compute::Status NeonStackWorkloadValidate(const std::vector<const TensorInfo*>& inputs,
29  const TensorInfo& output,
30  const StackDescriptor& descriptor)
31 {
32  std::vector<arm_compute::TensorInfo> aclInputs;
33  for (const TensorInfo* input : inputs)
34  {
35  arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(*input, armnn::DataLayout::NCHW);
36  aclInputs.emplace_back(aclInputInfo);
37  }
38 
39  std::vector<arm_compute::ITensorInfo*> aclInputPtrs;
40  for (arm_compute::ITensorInfo& input : aclInputs)
41  {
42  aclInputPtrs.emplace_back(&input);
43  }
44 
45  const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
46  int aclAxis = CalcAxis(descriptor.m_Axis, descriptor.m_InputShape.GetNumDimensions());
47  return arm_compute::NEStackLayer::validate(aclInputPtrs, aclAxis, &aclOutputInfo);
48 }
49 
51 : BaseWorkload<StackQueueDescriptor>(descriptor, info)
52 {
53  std::vector<arm_compute::ITensor*> aclInputs;
54  for (auto input : m_Data.m_Inputs)
55  {
56  arm_compute::ITensor& aclInput = boost::polymorphic_pointer_downcast<IAclTensorHandle>(input)->GetTensor();
57  aclInputs.emplace_back(&aclInput);
58  }
59  arm_compute::ITensor& output = boost::polymorphic_pointer_downcast<IAclTensorHandle>(
60  m_Data.m_Outputs[0])->GetTensor();
61 
62  m_Layer.reset(new arm_compute::NEStackLayer());
63  int aclAxis = CalcAxis(descriptor.m_Parameters.m_Axis, descriptor.m_Parameters.m_InputShape.GetNumDimensions());
64  m_Layer->configure(aclInputs, aclAxis, &output);
65 }
66 
68 {
69  if (m_Layer)
70  {
71  ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonStackWorkload_Execute");
72  m_Layer->run();
73  }
74 }
75 
76 } //namespace armnn
uint32_t m_Axis
0-based axis along which to stack the input tensors.
+ +
TensorShape m_InputShape
Required shape of all input tensors.
+
const StackQueueDescriptor m_Data
Definition: Workload.hpp:46
+
#define ARMNN_SCOPED_PROFILING_EVENT_NEON(name)
+ + + +
void Execute() const override
+ +
Copyright (c) 2020 ARM Limited.
+ +
A StackDescriptor for the StackLayer.
+
arm_compute::Status NeonStackWorkloadValidate(const std::vector< const TensorInfo *> &inputs, const TensorInfo &output, const StackDescriptor &descriptor)
+ +
NeonStackWorkload(const StackQueueDescriptor &descriptor, const WorkloadInfo &info)
+
Status
enumeration
Definition: Types.hpp:26
+ +
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:33
+ +
std::vector< ITensorHandle * > m_Outputs
+ +
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:43
+
Contains information about inputs and outputs to a layer.
+
std::vector< ITensorHandle * > m_Inputs
+ +
+
+ + + + -- cgit v1.2.1