ArmNN
 21.08
ElementwiseFunction.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. 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 "Log.hpp"
14 #include "Rsqrt.hpp"
15 #include "Sin.hpp"
16 #include "Sqrt.hpp"
17 
18 
19 namespace armnn
20 {
21 
22 template <typename Functor>
24  const TensorShape& inShape1,
25  const TensorShape& outShape,
26  Decoder<InType>& inData0,
27  Decoder<InType>& inData1,
28  Encoder<OutType>& outData)
29 {
30  BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData);
31 }
32 
33 template <typename Functor>
35  const TensorShape& outShape,
36  Decoder<InType>& inData,
37  Encoder<OutType>& outData)
38 {
39  BroadcastLoop(inShape, outShape).Unroll(Functor(), 0, inData, outData);
40 }
41 
42 template <typename Functor>
44  const TensorShape& inShape1,
45  const TensorShape& outShape,
46  Decoder<InType>& inData0,
47  Decoder<InType>& inData1,
48  Encoder<OutType>& outData)
49 {
50  BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData);
51 }
52 
53 template <typename Functor>
55  const TensorShape& outShape,
56  Decoder<InType>& inData,
57  Encoder<OutType>& outData)
58 {
59  BroadcastLoop(inShape, outShape).Unroll(Functor(), 0, inData, outData);
60 }
61 
62 } //namespace armnn
63 
70 
77 
78 // Comparison
85 
86 // Unary
94 
95 // 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)