blob: ef4a2dc7d53fb43c1d96e5149f03c478631e63ed [file] [log] [blame]
David Beck591cdb72018-09-11 16:37:14 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Sadik Armagan2e6dc3a2019-04-03 17:48:18 +01008#include "BaseIterator.hpp"
David Beck591cdb72018-09-11 16:37:14 +01009#include <armnn/Tensor.hpp>
10
11namespace armnn
12{
13
Derek Lambertif30f7d32019-04-09 10:25:02 +010014template <typename Functor>
josh minor4a3c6102020-01-06 16:40:46 -060015struct ElementwiseBinaryFunction
David Beck591cdb72018-09-11 16:37:14 +010016{
Derek Lambertif30f7d32019-04-09 10:25:02 +010017 using OutType = typename Functor::result_type;
18 using InType = typename Functor::first_argument_type;
19
josh minor4a3c6102020-01-06 16:40:46 -060020 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
28template <typename Functor>
29struct 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 Beck591cdb72018-09-11 16:37:14 +010038};
39
James Conroyaba90cd2020-11-06 16:28:18 +000040template <typename Functor>
41struct LogicalBinaryFunction
42{
43 using OutType = bool;
44 using InType = bool;
45
46 LogicalBinaryFunction(const TensorShape& inShape0,
47 const TensorShape& inShape1,
48 const TensorShape& outShape,
49 Decoder<InType>& inData0,
50 Decoder<InType>& inData1,
51 Encoder<OutType>& outData);
52};
53
54template <typename Functor>
55struct LogicalUnaryFunction
56{
57 using OutType = bool;
58 using InType = bool;
59
60 LogicalUnaryFunction(const TensorShape& inShape,
61 const TensorShape& outShape,
62 Decoder<InType>& inData,
63 Encoder<OutType>& outData);
64};
65
David Beck591cdb72018-09-11 16:37:14 +010066} //namespace armnn