ArmNN
 24.08
ElementwiseFunction.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2021,2023-2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include "Broadcast.hpp"
8 #include "Minimum.hpp"
9 #include "Maximum.hpp"
10 #include "Abs.hpp"
11 #include "Ceil.hpp"
12 #include "Exp.hpp"
13 #include "Log.hpp"
14 #include "Rsqrt.hpp"
15 #include "Sin.hpp"
16 #include "Sqrt.hpp"
17 #include "Power.hpp"
18 #include "SquaredDifference.hpp"
19 
20 
21 namespace armnn
22 {
23 
24 template <typename Functor>
26  const TensorShape& inShape1,
27  const TensorShape& outShape,
28  Decoder<InType>& inData0,
29  Decoder<InType>& inData1,
30  Encoder<OutType>& outData)
31 {
32  BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData);
33 }
34 
35 template <typename Functor>
37  const TensorShape& outShape,
38  Decoder<InType>& inData,
39  Encoder<OutType>& outData)
40 {
41  BroadcastLoop(inShape, outShape).Unroll(Functor(), 0, inData, outData);
42 }
43 
44 template <typename Functor>
46  const TensorShape& inShape1,
47  const TensorShape& outShape,
48  Decoder<InType>& inData0,
49  Decoder<InType>& inData1,
50  Encoder<OutType>& outData)
51 {
52  BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData);
53 }
54 
55 template <typename Functor>
57  const TensorShape& outShape,
58  Decoder<InType>& inData,
59  Encoder<OutType>& outData)
60 {
61  BroadcastLoop(inShape, outShape).Unroll(Functor(), 0, inData, outData);
62 }
63 
64 } //namespace armnn
65 
75 
85 
86 // Comparison
93 
94 // Unary
103 
104 // Logical Unary
Sin.hpp
armnn::Decoder
Definition: BaseIterator.hpp:35
Ceil.hpp
armnn::LogicalUnaryFunction::LogicalUnaryFunction
LogicalUnaryFunction(const TensorShape &inShape, const TensorShape &outShape, Decoder< InType > &inData, Encoder< OutType > &outData)
Definition: ElementwiseFunction.cpp:56
armnn::LogicalBinaryFunction
Definition: ElementwiseFunction.hpp:41
armnn::BroadcastLoop
Definition: Broadcast.hpp:14
Minimum.hpp
armnn::ElementwiseUnaryFunction::ElementwiseUnaryFunction
ElementwiseUnaryFunction(const TensorShape &inShape, const TensorShape &outShape, Decoder< InType > &inData, Encoder< OutType > &outData)
Definition: ElementwiseFunction.cpp:36
Rsqrt.hpp
armnn::ElementwiseBinaryFunction::ElementwiseBinaryFunction
ElementwiseBinaryFunction(const TensorShape &inShape0, const TensorShape &inShape1, const TensorShape &outShape, Decoder< InType > &inData0, Decoder< InType > &inData1, Encoder< OutType > &outData)
Definition: ElementwiseFunction.cpp:25
Broadcast.hpp
armnn::ElementwiseBinaryFunction
Definition: ElementwiseFunction.hpp:15
armnn::TensorShape
Definition: Tensor.hpp:20
armnn::Encoder
Definition: BaseIterator.hpp:50
Abs.hpp
armnn::BroadcastLoop::Unroll
void Unroll(Func operationFunc, unsigned int dimension, DecoderOp &inData0, DecoderOp &inData1, EncoderOp &outData)
Definition: Broadcast.hpp:26
armnn::LogicalBinaryFunction::LogicalBinaryFunction
LogicalBinaryFunction(const TensorShape &inShape0, const TensorShape &inShape1, const TensorShape &outShape, Decoder< InType > &inData0, Decoder< InType > &inData1, Encoder< OutType > &outData)
Definition: ElementwiseFunction.cpp:45
armnn::ElementwiseUnaryFunction
Definition: ElementwiseFunction.hpp:29
armnn::LogicalUnaryFunction
Definition: ElementwiseFunction.hpp:55
SquaredDifference.hpp
ElementwiseFunction.hpp
Maximum.hpp
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
Power.hpp
Exp.hpp
Sqrt.hpp
Log.hpp