aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/ElementwiseFunction.cpp
blob: bea3d2fb891902c5355848228e76f1fe65b799b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "ElementwiseFunction.hpp"
#include "Broadcast.hpp"
#include <functional>

namespace armnn
{

template <typename Functor>
ElementwiseFunction<Functor>::ElementwiseFunction(const TensorShape& inShape0,
                                                const TensorShape& inShape1,
                                                const TensorShape& outShape,
                                                const float* inData0,
                                                const float* inData1,
                                                float* outData)
{
    BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData);
}

} //namespace armnn

template struct armnn::ElementwiseFunction<std::plus<float>>;
template struct armnn::ElementwiseFunction<std::minus<float>>;
template struct armnn::ElementwiseFunction<std::multiplies<float>>;
template struct armnn::ElementwiseFunction<std::divides<float>>;