David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 7 | #include <armnn/Deprecated.hpp> |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 8 | #include <armnn/DescriptorsFwd.hpp> |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 9 | #include <armnn/LstmParams.hpp> |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 10 | #include <armnn/Optional.hpp> |
| 11 | #include <armnn/QuantizedLstmParams.hpp> |
Matthew Bentham | 313e1c8 | 2019-03-25 17:37:47 +0000 | [diff] [blame] | 12 | |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 13 | #include <cctype> |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 14 | #include <functional> |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 15 | #include <memory> |
Matthew Bentham | 313e1c8 | 2019-03-25 17:37:47 +0000 | [diff] [blame] | 16 | #include <vector> |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 17 | |
| 18 | namespace armnn |
| 19 | { |
| 20 | |
| 21 | class TensorInfo; |
| 22 | |
| 23 | class ILayerSupport |
| 24 | { |
| 25 | protected: |
| 26 | ILayerSupport() {} |
| 27 | virtual ~ILayerSupport() {} |
| 28 | |
| 29 | public: |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame] | 30 | virtual bool IsAbsSupported(const TensorInfo& input, |
| 31 | const TensorInfo& output, |
| 32 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 33 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 34 | virtual bool IsActivationSupported(const TensorInfo& input, |
| 35 | const TensorInfo& output, |
| 36 | const ActivationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 37 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 38 | |
| 39 | virtual bool IsAdditionSupported(const TensorInfo& input0, |
| 40 | const TensorInfo& input1, |
| 41 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 42 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 43 | |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 44 | virtual bool IsArgMinMaxSupported(const TensorInfo& input, |
| 45 | const TensorInfo& output, |
| 46 | const ArgMinMaxDescriptor& descriptor, |
| 47 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 48 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 49 | virtual bool IsBatchNormalizationSupported(const TensorInfo& input, |
| 50 | const TensorInfo& output, |
| 51 | const TensorInfo& mean, |
| 52 | const TensorInfo& var, |
| 53 | const TensorInfo& beta, |
| 54 | const TensorInfo& gamma, |
| 55 | const BatchNormalizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 56 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 57 | |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 58 | virtual bool IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 59 | const TensorInfo& output, |
| 60 | const BatchToSpaceNdDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 61 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 62 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 63 | virtual bool IsComparisonSupported(const TensorInfo& input0, |
| 64 | const TensorInfo& input1, |
| 65 | const TensorInfo& output, |
| 66 | const ComparisonDescriptor& descriptor, |
| 67 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 68 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 69 | virtual bool IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 70 | const TensorInfo& output, |
| 71 | const OriginsDescriptor& descriptor, |
| 72 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 73 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 74 | virtual bool IsConstantSupported(const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 75 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 76 | |
| 77 | virtual bool IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 78 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 79 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 80 | |
| 81 | virtual bool IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 82 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 83 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 84 | |
| 85 | virtual bool IsConvolution2dSupported(const TensorInfo& input, |
| 86 | const TensorInfo& output, |
| 87 | const Convolution2dDescriptor& descriptor, |
| 88 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 89 | const Optional<TensorInfo>& biases, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 90 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 91 | |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 92 | virtual bool IsDebugSupported(const TensorInfo& input, |
| 93 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 94 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 95 | |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 96 | virtual bool IsDepthToSpaceSupported(const TensorInfo& input, |
| 97 | const TensorInfo& output, |
| 98 | const DepthToSpaceDescriptor& descriptor, |
| 99 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 100 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 101 | virtual bool IsDepthwiseConvolutionSupported( |
| 102 | const TensorInfo& input, |
| 103 | const TensorInfo& output, |
| 104 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 105 | const TensorInfo& weights, |
| 106 | const Optional<TensorInfo>& biases, |
| 107 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 108 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 109 | virtual bool IsDequantizeSupported(const TensorInfo& input, |
| 110 | const TensorInfo& output, |
| 111 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 112 | |
Derek Lamberti | 6a5e5e8 | 2019-12-05 14:41:20 +0000 | [diff] [blame] | 113 | virtual bool IsDetectionPostProcessSupported(const TensorInfo& boxEncodings, |
| 114 | const TensorInfo& scores, |
| 115 | const TensorInfo& anchors, |
| 116 | const TensorInfo& detectionBoxes, |
| 117 | const TensorInfo& detectionClasses, |
| 118 | const TensorInfo& detectionScores, |
| 119 | const TensorInfo& numDetections, |
| 120 | const DetectionPostProcessDescriptor& descriptor, |
| 121 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const =0; |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 122 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 123 | virtual bool IsDilatedDepthwiseConvolutionSupported( |
| 124 | const TensorInfo& input, |
| 125 | const TensorInfo& output, |
| 126 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 127 | const TensorInfo& weights, |
| 128 | const Optional<TensorInfo>& biases, |
| 129 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 130 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 131 | virtual bool IsDivisionSupported(const TensorInfo& input0, |
| 132 | const TensorInfo& input1, |
| 133 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 134 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 135 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 136 | ARMNN_DEPRECATED_MSG("Use IsComparisonSupported instead") |
FrancisMurtagh | 2099595 | 2018-12-17 12:11:36 +0000 | [diff] [blame] | 137 | virtual bool IsEqualSupported(const TensorInfo& input0, |
| 138 | const TensorInfo& input1, |
| 139 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 140 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
FrancisMurtagh | 2099595 | 2018-12-17 12:11:36 +0000 | [diff] [blame] | 141 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 142 | virtual bool IsFakeQuantizationSupported(const TensorInfo& input, |
| 143 | const FakeQuantizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 144 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 145 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 146 | virtual bool IsFloorSupported(const TensorInfo& input, |
| 147 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 148 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 149 | |
| 150 | virtual bool IsFullyConnectedSupported(const TensorInfo& input, |
| 151 | const TensorInfo& output, |
| 152 | const TensorInfo& weights, |
| 153 | const TensorInfo& biases, |
| 154 | const FullyConnectedDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 155 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 156 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 157 | virtual bool IsGatherSupported(const TensorInfo& input0, |
| 158 | const TensorInfo& input1, |
| 159 | const TensorInfo& output, |
| 160 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 161 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 162 | ARMNN_DEPRECATED_MSG("Use IsComparisonSupported instead") |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 163 | virtual bool IsGreaterSupported(const TensorInfo& input0, |
| 164 | const TensorInfo& input1, |
| 165 | const TensorInfo& ouput, |
| 166 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 167 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 168 | virtual bool IsInputSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 169 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 170 | |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 171 | virtual bool IsInstanceNormalizationSupported( |
| 172 | const TensorInfo& input, |
| 173 | const TensorInfo& output, |
| 174 | const InstanceNormalizationDescriptor& descriptor, |
| 175 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 176 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 177 | virtual bool IsL2NormalizationSupported(const TensorInfo& input, |
| 178 | const TensorInfo& output, |
| 179 | const L2NormalizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 180 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 181 | |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 182 | virtual bool IsLogSoftmaxSupported(const TensorInfo& input, |
| 183 | const TensorInfo& output, |
| 184 | const LogSoftmaxDescriptor& descriptor, |
| 185 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 186 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 187 | virtual bool IsLstmSupported(const TensorInfo& input, |
| 188 | const TensorInfo& outputStateIn, |
| 189 | const TensorInfo& cellStateIn, |
| 190 | const TensorInfo& scratchBuffer, |
| 191 | const TensorInfo& outputStateOut, |
| 192 | const TensorInfo& cellStateOut, |
| 193 | const TensorInfo& output, |
| 194 | const LstmDescriptor& descriptor, |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 195 | const LstmInputParamsInfo& paramsInfo, |
| 196 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 197 | |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 198 | virtual bool IsMaximumSupported(const TensorInfo& input0, |
| 199 | const TensorInfo& input1, |
| 200 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 201 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 202 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 203 | virtual bool IsMeanSupported(const TensorInfo& input, |
| 204 | const TensorInfo& output, |
| 205 | const MeanDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 206 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 207 | |
| 208 | virtual bool IsMemCopySupported(const TensorInfo& input, |
| 209 | const TensorInfo& output, |
| 210 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 211 | |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 212 | virtual bool IsMemImportSupported(const TensorInfo& input, |
| 213 | const TensorInfo& output, |
| 214 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 215 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 216 | virtual bool IsMergeSupported(const TensorInfo& input0, |
| 217 | const TensorInfo& input1, |
| 218 | const TensorInfo& output, |
| 219 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 220 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 221 | ARMNN_DEPRECATED_MSG("Use IsConcatSupported instead") |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 222 | virtual bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 223 | const TensorInfo& output, |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 224 | const OriginsDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 225 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 226 | |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 227 | virtual bool IsMinimumSupported(const TensorInfo& input0, |
| 228 | const TensorInfo& input1, |
| 229 | const TensorInfo& ouput, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 230 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 231 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 232 | virtual bool IsMultiplicationSupported(const TensorInfo& input0, |
| 233 | const TensorInfo& input1, |
| 234 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 235 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 236 | |
| 237 | virtual bool IsNormalizationSupported(const TensorInfo& input, |
| 238 | const TensorInfo& output, |
| 239 | const NormalizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 240 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 241 | |
| 242 | virtual bool IsOutputSupported(const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 243 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 244 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 245 | virtual bool IsPadSupported(const TensorInfo& input, |
| 246 | const TensorInfo& output, |
| 247 | const PadDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 248 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 249 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 250 | virtual bool IsPermuteSupported(const TensorInfo& input, |
| 251 | const TensorInfo& output, |
| 252 | const PermuteDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 253 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 254 | |
| 255 | virtual bool IsPooling2dSupported(const TensorInfo& input, |
| 256 | const TensorInfo& output, |
| 257 | const Pooling2dDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 258 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 259 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 260 | virtual bool IsPreCompiledSupported(const TensorInfo& input, |
| 261 | const PreCompiledDescriptor& descriptor, |
| 262 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 263 | |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 264 | virtual bool IsPreluSupported(const TensorInfo& input, |
| 265 | const TensorInfo& alpha, |
| 266 | const TensorInfo& output, |
| 267 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 268 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 269 | virtual bool IsQuantizeSupported(const TensorInfo& input, |
| 270 | const TensorInfo& output, |
| 271 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 272 | |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 273 | virtual bool IsQuantizedLstmSupported(const TensorInfo& input, |
| 274 | const TensorInfo& previousCellStateIn, |
| 275 | const TensorInfo& previousOutputIn, |
| 276 | const TensorInfo& cellStateOut, |
| 277 | const TensorInfo& output, |
| 278 | const QuantizedLstmInputParamsInfo& paramsInfo, |
| 279 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 280 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 281 | virtual bool IsReshapeSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 282 | const ReshapeDescriptor& descriptor, |
| 283 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 284 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 285 | ARMNN_DEPRECATED_MSG("Use IsResizeSupported instead") |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 286 | virtual bool IsResizeBilinearSupported(const TensorInfo& input, |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 287 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 288 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 289 | |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 290 | virtual bool IsResizeSupported(const TensorInfo& input, |
| 291 | const TensorInfo& output, |
| 292 | const ResizeDescriptor& descriptor, |
| 293 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 294 | |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 295 | virtual bool IsRsqrtSupported(const TensorInfo& input, |
| 296 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 297 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 298 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 299 | virtual bool IsSliceSupported(const TensorInfo& input, |
| 300 | const TensorInfo& output, |
| 301 | const SliceDescriptor& descriptor, |
| 302 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 303 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 304 | virtual bool IsSoftmaxSupported(const TensorInfo& input, |
| 305 | const TensorInfo& output, |
| 306 | const SoftmaxDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 307 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 308 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 309 | virtual bool IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 310 | const TensorInfo& output, |
| 311 | const SpaceToBatchNdDescriptor& descriptor, |
| 312 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 313 | |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 314 | virtual bool IsSpaceToDepthSupported(const TensorInfo& input, |
| 315 | const TensorInfo& output, |
| 316 | const SpaceToDepthDescriptor& descriptor, |
| 317 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 318 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 319 | ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead") |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 320 | virtual bool IsSplitterSupported(const TensorInfo& input, |
| 321 | const ViewsDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 322 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 323 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 324 | virtual bool IsSplitterSupported(const TensorInfo& input, |
| 325 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 326 | const ViewsDescriptor& descriptor, |
| 327 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 328 | |
Matthew Jackson | 81e601c | 2019-07-11 12:07:09 +0100 | [diff] [blame] | 329 | virtual bool IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 330 | const TensorInfo& output, |
| 331 | const StackDescriptor& descriptor, |
| 332 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 333 | |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 334 | virtual bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs, |
| 335 | const std::vector<const TensorInfo*>& outputs, |
| 336 | const StandInDescriptor& descriptor, |
| 337 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 338 | |
| 339 | |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 340 | virtual bool IsStridedSliceSupported(const TensorInfo& input, |
| 341 | const TensorInfo& output, |
| 342 | const StridedSliceDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 343 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 344 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 345 | virtual bool IsSubtractionSupported(const TensorInfo& input0, |
| 346 | const TensorInfo& input1, |
| 347 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 348 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 349 | |
| 350 | virtual bool IsSwitchSupported(const TensorInfo& input0, |
| 351 | const TensorInfo& input1, |
| 352 | const TensorInfo& output0, |
| 353 | const TensorInfo& output1, |
| 354 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 355 | |
| 356 | virtual bool IsTransposeConvolution2dSupported( |
| 357 | const TensorInfo& input, |
| 358 | const TensorInfo& output, |
| 359 | const TransposeConvolution2dDescriptor& descriptor, |
| 360 | const TensorInfo& weights, |
| 361 | const Optional<TensorInfo>& biases, |
| 362 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 363 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 364 | }; // class ILayerSupport |
| 365 | |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 366 | using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>; |
| 367 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 368 | } // namespace armnn |