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