From 9aed8fb43441228343b925b42464a55042c47ca0 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Wed, 17 Nov 2021 13:16:45 +0000 Subject: IVGCVSW-6040 Update 21.11 Doxygen Documents Signed-off-by: Nikhil Raj Change-Id: Ia36ec98c4bebc27a69103911ea3409cd7db587a5 --- ...ef_elementwise_unary_workload_8cpp_source.xhtml | 158 +++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 21.11/_ref_elementwise_unary_workload_8cpp_source.xhtml (limited to '21.11/_ref_elementwise_unary_workload_8cpp_source.xhtml') diff --git a/21.11/_ref_elementwise_unary_workload_8cpp_source.xhtml b/21.11/_ref_elementwise_unary_workload_8cpp_source.xhtml new file mode 100644 index 0000000000..117b970411 --- /dev/null +++ b/21.11/_ref_elementwise_unary_workload_8cpp_source.xhtml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + +ArmNN: src/backends/reference/workloads/RefElementwiseUnaryWorkload.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
RefElementwiseUnaryWorkload.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd and Contributors. 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 "Log.hpp"
15 #include "Rsqrt.hpp"
16 #include "Sin.hpp"
17 #include "Sqrt.hpp"
18 
19 #include <Profiling.hpp>
20 
21 #include <armnn/TypesUtils.hpp>
22 
23 #include <functional>
24 
25 namespace armnn
26 {
27 
29  const WorkloadInfo& info)
31 {}
32 
34 {
36 }
37 
39 {
40 
41  Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs);
42 }
43 
44 void RefElementwiseUnaryWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
45 {
46  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefElementwiseUnaryWorkload_Execute");
47 
48  const TensorInfo& inputInfo = GetTensorInfo(inputs[0]);
49  const TensorInfo& outputInfo = GetTensorInfo(outputs[0]);
50 
51  const TensorShape& inShape = inputInfo.GetShape();
52  const TensorShape& outShape = outputInfo.GetShape();
53 
54  std::unique_ptr<Decoder<InType>> input = MakeDecoder<InType>(inputInfo, inputs[0]->Map());
55  std::unique_ptr<Encoder<OutType>> output= MakeEncoder<OutType>(outputInfo, outputs[0]->Map());
56 
57  using AbsFunction = ElementwiseUnaryFunction<abs<InType>>;
58  using ExpFunction = ElementwiseUnaryFunction<exp<InType>>;
59  using LogFunction = ElementwiseUnaryFunction<log<InType>>;
61  using RsqrtFunction = ElementwiseUnaryFunction<rsqrt<InType>>;
62  using SinFunction = ElementwiseUnaryFunction<sin<InType>>;
63  using SqrtFunction = ElementwiseUnaryFunction<sqrt<InType>>;
64 
66  {
68  {
69  AbsFunction(inShape, outShape, *input, *output);
70  break;
71  }
73  {
74  ExpFunction(inShape, outShape, *input, *output);
75  break;
76  }
78  {
79  LogFunction(inShape, outShape, *input, *output);
80  break;
81  }
83  {
84  NegFunction(inShape, outShape, *input, *output);
85  break;
86  }
88  {
89  RsqrtFunction(inShape, outShape, *input, *output);
90  break;
91  }
93  {
94  SinFunction(inShape, outShape, *input, *output);
95  break;
96  }
98  {
99  SqrtFunction(inShape, outShape, *input, *output);
100  break;
101  }
102  default:
103  {
104  throw InvalidArgumentException(std::string("Unsupported unary operation ") +
106  }
107  }
108 }
109 
110 } // namespace armnn
+
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
+
const TensorShape & GetShape() const
Definition: Tensor.hpp:191
+
CPU Execution: Reference C++ kernels.
+ + + + + + +
Copyright (c) 2021 ARM Limited and Contributors.
+ + + + +
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
+ + + +
constexpr char const * GetUnaryOperationAsCString(UnaryOperation operation)
Definition: TypesUtils.hpp:71
+ + + + + + + + + +
#define CHECK_LOCATION()
Definition: Exceptions.hpp:209
+
void ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) override
+
RefElementwiseUnaryWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
+ + +
std::vector< ITensorHandle * > m_Outputs
+ + +
Contains information about TensorInfos of a layer.
+
std::vector< ITensorHandle * > m_Inputs
+ + + +
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
+ + +
+
+ + + + -- cgit v1.2.1