blob: 5cd756ba1b5fda6b6c6575d4974c8e4c1f872973 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5#pragma once
6
7#include <armnn/DescriptorsFwd.hpp>
arovir01085f0a42018-10-08 14:48:19 +01008#include <armnn/Optional.hpp>
telsoa014fcda012018-03-09 14:13:49 +00009#include <armnn/Types.hpp>
10#include <armnn/Tensor.hpp>
telsoa01c577f2c2018-08-31 09:22:23 +010011#include <armnn/ArmNN.hpp>
telsoa014fcda012018-03-09 14:13:49 +000012
13namespace armnn
14{
arovir014424b0a2018-10-04 10:46:04 +010015
16class ClLayerSupport : public ILayerSupport
17{
18 // TODO implement
19};
20
telsoa014fcda012018-03-09 14:13:49 +000021bool IsClDirectConvolution2dSupported(const TensorInfo& weightInfo, const Convolution2dDescriptor& desc);
arovir01085f0a42018-10-08 14:48:19 +010022bool IsClDepthwiseConvolution2dDescParamsSupported(Optional<std::string&> reasonIfUnsupported,
telsoa014fcda012018-03-09 14:13:49 +000023 const DepthwiseConvolution2dDescriptor& parameters,
24 const TensorInfo& weights);
25
26bool IsActivationSupportedCl(const TensorInfo& input,
telsoa01c577f2c2018-08-31 09:22:23 +010027 const TensorInfo& output,
telsoa014fcda012018-03-09 14:13:49 +000028 const ActivationDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +010029 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000030
31bool IsAdditionSupportedCl(const TensorInfo& input0,
32 const TensorInfo& input1,
33 const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +010034 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000035
36bool IsBatchNormalizationSupportedCl(const TensorInfo& input,
telsoa01c577f2c2018-08-31 09:22:23 +010037 const TensorInfo& output,
38 const TensorInfo& mean,
39 const TensorInfo& var,
40 const TensorInfo& beta,
41 const TensorInfo& gamma,
telsoa014fcda012018-03-09 14:13:49 +000042 const BatchNormalizationDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +010043 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000044
45bool IsConstantSupportedCl(const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +010046 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000047
48bool IsConvolution2dSupportedCl(const TensorInfo& input,
surmeh013537c2c2018-05-18 16:31:43 +010049 const TensorInfo& output,
telsoa014fcda012018-03-09 14:13:49 +000050 const Convolution2dDescriptor& descriptor,
51 const TensorInfo& weights,
David Beck5eec11d2018-10-04 15:43:17 +010052 const Optional<TensorInfo>& biases,
arovir01085f0a42018-10-08 14:48:19 +010053 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000054
55bool IsDepthwiseConvolutionSupportedCl(const TensorInfo& input,
telsoa01c577f2c2018-08-31 09:22:23 +010056 const TensorInfo& output,
telsoa014fcda012018-03-09 14:13:49 +000057 const DepthwiseConvolution2dDescriptor& descriptor,
58 const TensorInfo& weights,
David Beck5eec11d2018-10-04 15:43:17 +010059 const Optional<TensorInfo>& biases,
arovir01085f0a42018-10-08 14:48:19 +010060 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000061
Francis Murtaghe7a86a42018-08-29 12:42:10 +010062bool IsDivisionSupportedCl(const TensorInfo& input0,
63 const TensorInfo& input1,
64 const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +010065 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
Francis Murtaghe7a86a42018-08-29 12:42:10 +010066
David Beckc2044fe2018-09-05 15:00:38 +010067bool IsSubtractionSupportedCl(const TensorInfo& input0,
68 const TensorInfo& input1,
69 const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +010070 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
David Beckc2044fe2018-09-05 15:00:38 +010071
telsoa014fcda012018-03-09 14:13:49 +000072bool IsFullyConnectedSupportedCl(const TensorInfo& input,
telsoa01c577f2c2018-08-31 09:22:23 +010073 const TensorInfo& output,
74 const TensorInfo& weights,
75 const TensorInfo& biases,
telsoa014fcda012018-03-09 14:13:49 +000076 const FullyConnectedDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +010077 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000078
79bool IsInputSupportedCl(const TensorInfo& input,
arovir01085f0a42018-10-08 14:48:19 +010080 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000081
82bool IsL2NormalizationSupportedCl(const TensorInfo& input,
telsoa01c577f2c2018-08-31 09:22:23 +010083 const TensorInfo& output,
Matteo Martincighbcd3c852018-09-28 14:14:12 +010084 const L2NormalizationDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +010085 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +000086
arovir01085f0a42018-10-08 14:48:19 +010087bool IsLstmSupportedCl(const TensorInfo& input,
88 const TensorInfo& outputStateIn,
89 const TensorInfo& cellStateIn,
90 const TensorInfo& scratchBuffer,
91 const TensorInfo& outputStateOut,
92 const TensorInfo& cellStateOut,
93 const TensorInfo& output,
94 const LstmDescriptor& descriptor,
95 const TensorInfo& inputToForgetWeights,
96 const TensorInfo& inputToCellWeights,
97 const TensorInfo& inputToOutputWeights,
98 const TensorInfo& recurrentToForgetWeights,
99 const TensorInfo& recurrentToCellWeights,
100 const TensorInfo& recurrentToOutputWeights,
101 const TensorInfo& forgetGateBias,
102 const TensorInfo& cellBias,
103 const TensorInfo& outputGateBias,
104 const TensorInfo* inputToInputWeights,
105 const TensorInfo* recurrentToInputWeights,
106 const TensorInfo* cellToInputWeights,
107 const TensorInfo* inputGateBias,
108 const TensorInfo* projectionWeights,
109 const TensorInfo* projectionBias,
110 const TensorInfo* cellToForgetWeights,
111 const TensorInfo* cellToOutputWeights,
112 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa01c577f2c2018-08-31 09:22:23 +0100113
telsoa014fcda012018-03-09 14:13:49 +0000114bool IsMergerSupportedCl(const std::vector<const TensorInfo*> inputs,
115 const OriginsDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100116 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000117
118bool IsMultiplicationSupportedCl(const TensorInfo& input0,
119 const TensorInfo& input1,
telsoa01c577f2c2018-08-31 09:22:23 +0100120 const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +0100121 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000122
123bool IsNormalizationSupportedCl(const TensorInfo& input,
124 const TensorInfo& output,
125 const NormalizationDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100126 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000127
128bool IsOutputSupportedCl(const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +0100129 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
jimfly01e1fa50c2018-09-21 12:09:51 +0100130
telsoa014fcda012018-03-09 14:13:49 +0000131bool IsPermuteSupportedCl(const TensorInfo& input,
132 const TensorInfo& output,
133 const PermuteDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100134 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000135
136bool IsPooling2dSupportedCl(const TensorInfo& input,
137 const TensorInfo& output,
138 const Pooling2dDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100139 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000140
141bool IsResizeBilinearSupportedCl(const TensorInfo& input,
arovir01085f0a42018-10-08 14:48:19 +0100142 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000143
144bool IsSoftmaxSupportedCl(const TensorInfo& input,
telsoa01c577f2c2018-08-31 09:22:23 +0100145 const TensorInfo& output,
telsoa014fcda012018-03-09 14:13:49 +0000146 const SoftmaxDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100147 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000148
149bool IsSplitterSupportedCl(const TensorInfo& input,
150 const ViewsDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100151 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000152
153bool IsFakeQuantizationSupportedCl(const TensorInfo& input,
154 const FakeQuantizationDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100155 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000156
157bool IsReshapeSupportedCl(const TensorInfo& input,
arovir01085f0a42018-10-08 14:48:19 +0100158 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa014fcda012018-03-09 14:13:49 +0000159
160bool IsFloorSupportedCl(const TensorInfo& input,
161 const TensorInfo& output,
arovir01085f0a42018-10-08 14:48:19 +0100162 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
163
164bool IsConvertFp16ToFp32SupportedCl(const TensorInfo& input,
165 const TensorInfo& output,
166 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
167
168bool IsConvertFp32ToFp16SupportedCl(const TensorInfo& input,
169 const TensorInfo& output,
170 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa01c577f2c2018-08-31 09:22:23 +0100171
narpra0132b90462018-09-13 11:07:48 +0100172bool IsMeanSupportedCl(const TensorInfo& input,
173 const TensorInfo& output,
174 const MeanDescriptor& descriptor,
arovir01085f0a42018-10-08 14:48:19 +0100175 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
narpra0132b90462018-09-13 11:07:48 +0100176
arovir01085f0a42018-10-08 14:48:19 +0100177bool IsPadSupportedCl(const TensorInfo& input,
178 const TensorInfo& output,
179 const PadDescriptor& descriptor,
180 Optional<std::string&> reasonIfUnsupported = EmptyOptional());
telsoa01c577f2c2018-08-31 09:22:23 +0100181
telsoa014fcda012018-03-09 14:13:49 +0000182}