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 | #pragma once |
| 7 | |
Sadik Armagan | 2e6dc3a | 2019-04-03 17:48:18 +0100 | [diff] [blame] | 8 | #include "BaseIterator.hpp" |
David Beck | 591cdb7 | 2018-09-11 16:37:14 +0100 | [diff] [blame] | 9 | #include <armnn/Tensor.hpp> |
| 10 | |
| 11 | namespace armnn |
| 12 | { |
| 13 | |
Derek Lamberti | f30f7d3 | 2019-04-09 10:25:02 +0100 | [diff] [blame] | 14 | template <typename Functor> |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 15 | struct ElementwiseBinaryFunction |
David Beck | 591cdb7 | 2018-09-11 16:37:14 +0100 | [diff] [blame] | 16 | { |
Derek Lamberti | f30f7d3 | 2019-04-09 10:25:02 +0100 | [diff] [blame] | 17 | using OutType = typename Functor::result_type; |
| 18 | using InType = typename Functor::first_argument_type; |
| 19 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 20 | ElementwiseBinaryFunction(const TensorShape& inShape0, |
| 21 | const TensorShape& inShape1, |
| 22 | const TensorShape& outShape, |
| 23 | Decoder<InType>& inData0, |
| 24 | Decoder<InType>& inData1, |
| 25 | Encoder<OutType>& outData); |
| 26 | }; |
| 27 | |
| 28 | template <typename Functor> |
| 29 | struct ElementwiseUnaryFunction |
| 30 | { |
| 31 | using OutType = typename Functor::result_type; |
| 32 | using InType = typename Functor::argument_type; |
| 33 | |
| 34 | ElementwiseUnaryFunction(const TensorShape& inShape, |
| 35 | const TensorShape& outShape, |
| 36 | Decoder<InType>& inData, |
| 37 | Encoder<OutType>& outData); |
David Beck | 591cdb7 | 2018-09-11 16:37:14 +0100 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | } //namespace armnn |