20.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
6
#include "
ElementwiseFunction.hpp
"
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>
21
ElementwiseBinaryFunction<Functor>::ElementwiseBinaryFunction
(
const
TensorShape
& inShape0,
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>
32
ElementwiseUnaryFunction<Functor>::ElementwiseUnaryFunction
(
const
TensorShape
& inShape,
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
}
//namespace armnn
41
42
template
struct
armnn::ElementwiseBinaryFunction<std::plus<float>
>;
43
template
struct
armnn::ElementwiseBinaryFunction<std::minus<float>
>;
44
template
struct
armnn::ElementwiseBinaryFunction<std::multiplies<float>
>;
45
template
struct
armnn::ElementwiseBinaryFunction<std::divides<float>
>;
46
template
struct
armnn::ElementwiseBinaryFunction<armnn::maximum<float>
>;
47
template
struct
armnn::ElementwiseBinaryFunction<armnn::minimum<float>
>;
48
49
// Comparison
50
template
struct
armnn::ElementwiseBinaryFunction<std::equal_to<float>
>;
51
template
struct
armnn::ElementwiseBinaryFunction<std::greater<float>
>;
52
template
struct
armnn::ElementwiseBinaryFunction<std::greater_equal<float>
>;
53
template
struct
armnn::ElementwiseBinaryFunction<std::less<float>
>;
54
template
struct
armnn::ElementwiseBinaryFunction<std::less_equal<float>
>;
55
template
struct
armnn::ElementwiseBinaryFunction<std::not_equal_to<float>
>;
56
57
// Unary
58
template
struct
armnn::ElementwiseUnaryFunction<armnn::abs<float>
>;
59
template
struct
armnn::ElementwiseUnaryFunction<armnn::exp<float>
>;
60
template
struct
armnn::ElementwiseUnaryFunction<std::negate<float>
>;
61
template
struct
armnn::ElementwiseUnaryFunction<armnn::rsqrt<float>
>;
62
template
struct
armnn::ElementwiseUnaryFunction<armnn::sqrt<float>
>;
ElementwiseFunction.hpp
Broadcast.hpp
armnn::Encoder
Definition:
BaseIterator.hpp:51
armnn::ElementwiseUnaryFunction
Definition:
ElementwiseFunction.hpp:29
armnn
Copyright (c) 2020 ARM Limited.
Definition:
00_introduction.dox:25
armnn::TensorShape
Definition:
Tensor.hpp:20
Sqrt.hpp
armnn::ElementwiseUnaryFunction::ElementwiseUnaryFunction
ElementwiseUnaryFunction(const TensorShape &inShape, const TensorShape &outShape, Decoder< InType > &inData, Encoder< OutType > &outData)
Definition:
ElementwiseFunction.cpp:32
Abs.hpp
armnn::BroadcastLoop
Definition:
Broadcast.hpp:14
Exp.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:21
Minimum.hpp
armnn::ElementwiseBinaryFunction
Definition:
ElementwiseFunction.hpp:15
Maximum.hpp
Rsqrt.hpp
armnn::BroadcastLoop::Unroll
void Unroll(Func operationFunc, unsigned int dimension, DecoderOp &inData0, DecoderOp &inData1, EncoderOp &outData)
Definition:
Broadcast.hpp:26
armnn::Decoder
Definition:
BaseIterator.hpp:38
src
backends
reference
workloads
ElementwiseFunction.cpp
Generated on Fri Mar 13 2020 16:09:12 for ArmNN by
1.8.13