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 --- ...ef_elementwise_unary_workload_8cpp_source.xhtml | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 20.02/_ref_elementwise_unary_workload_8cpp_source.xhtml (limited to '20.02/_ref_elementwise_unary_workload_8cpp_source.xhtml') diff --git a/20.02/_ref_elementwise_unary_workload_8cpp_source.xhtml b/20.02/_ref_elementwise_unary_workload_8cpp_source.xhtml new file mode 100644 index 0000000000..8e9d43f3c9 --- /dev/null +++ b/20.02/_ref_elementwise_unary_workload_8cpp_source.xhtml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + +ArmNN: src/backends/reference/workloads/RefElementwiseUnaryWorkload.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
RefElementwiseUnaryWorkload.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "Decoders.hpp"
10 #include "Encoders.hpp"
11 #include "RefWorkloadUtils.hpp"
12 #include "Abs.hpp"
13 #include "Exp.hpp"
14 #include "Rsqrt.hpp"
15 #include "Sqrt.hpp"
16 
17 #include <Profiling.hpp>
18 
19 #include <armnn/TypesUtils.hpp>
20 
21 #include <functional>
22 
23 namespace armnn
24 {
25 
27  const WorkloadInfo& info)
29 {}
30 
32 {
33  const TensorInfo& inputInfo = GetTensorInfo(m_Data.m_Inputs[0]);
34  const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]);
35 
36  m_Input = MakeDecoder<InType>(inputInfo);
37 
38  m_Output = MakeEncoder<OutType>(outputInfo);
39 }
40 
42 {
43  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefElementwiseUnaryWorkload_Execute");
44 
45  const TensorInfo& inputInfo = GetTensorInfo(m_Data.m_Inputs[0]);
46  const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]);
47 
48  const TensorShape& inShape = inputInfo.GetShape();
49  const TensorShape& outShape = outputInfo.GetShape();
50 
51  m_Input->Reset(m_Data.m_Inputs[0]->Map());
52  m_Output->Reset(m_Data.m_Outputs[0]->Map());
53 
54  using AbsFunction = ElementwiseUnaryFunction<abs<InType>>;
55  using ExpFunction = ElementwiseUnaryFunction<exp<InType>>;
57  using RsqrtFunction = ElementwiseUnaryFunction<rsqrt<InType>>;
58  using SqrtFunction = ElementwiseUnaryFunction<sqrt<InType>>;
59 
61  {
63  {
64  AbsFunction(inShape, outShape, *m_Input, *m_Output);
65  break;
66  }
68  {
69  ExpFunction(inShape, outShape, *m_Input, *m_Output);
70  break;
71  }
73  {
74  NegFunction(inShape, outShape, *m_Input, *m_Output);
75  break;
76  }
78  {
79  RsqrtFunction(inShape, outShape, *m_Input, *m_Output);
80  break;
81  }
83  {
84  SqrtFunction(inShape, outShape, *m_Input, *m_Output);
85  break;
86  }
87  default:
88  {
89  throw InvalidArgumentException(std::string("Unsupported unary operation ") +
91  }
92  }
93 }
94 
95 } // namespace armnn
+
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
Definition: Descriptors.hpp:98
+
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+
CPU Execution: Reference C++ kernels.
+ + + + +
const ElementwiseUnaryQueueDescriptor m_Data
Definition: Workload.hpp:46
+
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
+ + +
Copyright (c) 2020 ARM Limited.
+ + + + +
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:169
+ + +
constexpr char const * GetUnaryOperationAsCString(UnaryOperation operation)
Definition: TypesUtils.hpp:71
+ + + + + +
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192
+
RefElementwiseUnaryWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
+ +
std::vector< ITensorHandle * > m_Outputs
+ +
Contains information about inputs and outputs to a layer.
+
std::vector< ITensorHandle * > m_Inputs
+ + + + + +
+
+ + + + -- cgit v1.2.1