David Beck | 591cdb7 | 2018-09-11 16:37:14 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "ArithmeticFunction.hpp" |
| 7 | #include "Broadcast.hpp" |
| 8 | #include <functional> |
| 9 | |
| 10 | namespace armnn |
| 11 | { |
| 12 | |
| 13 | template <typename Functor> |
| 14 | ArithmeticFunction<Functor>::ArithmeticFunction(const TensorShape& inShape0, |
| 15 | const TensorShape& inShape1, |
| 16 | const TensorShape& outShape, |
| 17 | const float* inData0, |
| 18 | const float* inData1, |
| 19 | float* outData) |
| 20 | { |
| 21 | BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData); |
| 22 | } |
| 23 | |
| 24 | } //namespace armnn |
| 25 | |
| 26 | template struct armnn::ArithmeticFunction<std::plus<float>>; |
| 27 | template struct armnn::ArithmeticFunction<std::minus<float>>; |
| 28 | template struct armnn::ArithmeticFunction<std::multiplies<float>>; |
| 29 | template struct armnn::ArithmeticFunction<std::divides<float>>; |