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