telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Tianle Cheng | 21a9f33 | 2023-11-09 13:56:53 +0000 | [diff] [blame] | 2 | // Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | #pragma once |
| 6 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 7 | #include <armnn/backends/IBackendInternal.hpp> |
| 8 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 9 | #include <backendsCommon/LayerSupportBase.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 10 | |
| 11 | namespace armnn |
| 12 | { |
| 13 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 14 | class NeonLayerSupport : public LayerSupportBase |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 15 | { |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 16 | public: |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 17 | explicit NeonLayerSupport(const IBackendInternal::IBackendSpecificModelContextPtr& modelContextPtr); |
| 18 | NeonLayerSupport(); |
| 19 | |
| 20 | ~NeonLayerSupport() {} |
| 21 | |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 22 | bool IsLayerSupported(const LayerType& type, |
| 23 | const std::vector<TensorInfo>& infos, |
| 24 | const BaseDescriptor& descriptor, |
| 25 | const Optional<LstmInputParamsInfo>& lstmParamsInfo, |
| 26 | const Optional<QuantizedLstmInputParamsInfo>& quantizedLstmParamsInfo, |
| 27 | Optional<std::string&> reasonIfUnsupported) const override; |
| 28 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 29 | bool IsActivationSupported(const TensorInfo& input, |
| 30 | const TensorInfo& output, |
| 31 | const ActivationDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 32 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 33 | |
| 34 | bool IsAdditionSupported(const TensorInfo& input0, |
| 35 | const TensorInfo& input1, |
| 36 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 37 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 38 | |
James Conroy | d47a064 | 2019-09-17 14:22:06 +0100 | [diff] [blame] | 39 | bool IsArgMinMaxSupported(const TensorInfo& input, |
| 40 | const TensorInfo& output, |
| 41 | const ArgMinMaxDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 42 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
James Conroy | d47a064 | 2019-09-17 14:22:06 +0100 | [diff] [blame] | 43 | |
Teresa Charlin | 0f86ecf | 2022-10-13 15:47:08 +0100 | [diff] [blame] | 44 | bool IsBatchMatMulSupported(const TensorInfo& inputX, |
| 45 | const TensorInfo& inputY, |
| 46 | const TensorInfo& output, |
| 47 | const BatchMatMulDescriptor& descriptor, |
| 48 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
| 49 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 50 | 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, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 57 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 58 | |
Mike Kelly | 5685802 | 2020-01-27 12:14:47 +0000 | [diff] [blame] | 59 | bool IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 60 | const TensorInfo& output, |
| 61 | const BatchToSpaceNdDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 62 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Mike Kelly | 5685802 | 2020-01-27 12:14:47 +0000 | [diff] [blame] | 63 | |
Sadik Armagan | 48f011e | 2021-04-21 10:50:34 +0100 | [diff] [blame] | 64 | bool IsCastSupported(const TensorInfo& input, |
| 65 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 66 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | 48f011e | 2021-04-21 10:50:34 +0100 | [diff] [blame] | 67 | |
Teresa Charlin | e89dd69 | 2021-09-01 16:30:34 +0100 | [diff] [blame] | 68 | bool IsChannelShuffleSupported(const TensorInfo& input, |
| 69 | const TensorInfo& output, |
| 70 | const ChannelShuffleDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 71 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Teresa Charlin | e89dd69 | 2021-09-01 16:30:34 +0100 | [diff] [blame] | 72 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 73 | bool IsComparisonSupported(const TensorInfo& input0, |
| 74 | const TensorInfo& input1, |
| 75 | const TensorInfo& output, |
| 76 | const ComparisonDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 77 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 78 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 79 | bool IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 80 | const TensorInfo& output, |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 81 | const OriginsDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 82 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 83 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 84 | bool IsConstantSupported(const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 85 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 86 | |
| 87 | bool IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 88 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 89 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 90 | |
| 91 | bool IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 92 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 93 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 94 | |
| 95 | bool IsConvolution2dSupported(const TensorInfo& input, |
| 96 | const TensorInfo& output, |
| 97 | const Convolution2dDescriptor& descriptor, |
| 98 | const TensorInfo& weights, |
| 99 | const Optional<TensorInfo>& biases, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 100 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 101 | |
Teresa Charlin | ec5f7d1 | 2021-10-22 17:15:00 +0100 | [diff] [blame] | 102 | bool IsConvolution3dSupported(const TensorInfo& input, |
| 103 | const TensorInfo& output, |
| 104 | const Convolution3dDescriptor& descriptor, |
| 105 | const TensorInfo& weights, |
| 106 | const Optional<TensorInfo>& biases, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 107 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Teresa Charlin | ec5f7d1 | 2021-10-22 17:15:00 +0100 | [diff] [blame] | 108 | |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame] | 109 | bool IsDepthToSpaceSupported(const TensorInfo& input, |
| 110 | const TensorInfo& output, |
| 111 | const DepthToSpaceDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 112 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame] | 113 | |
| 114 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 115 | bool IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 116 | const TensorInfo& output, |
| 117 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 118 | const TensorInfo& weights, |
| 119 | const Optional<TensorInfo>& biases, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 120 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 121 | |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 122 | bool IsDequantizeSupported(const TensorInfo& input, |
| 123 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 124 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 125 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 126 | bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 127 | const TensorInfo& output, |
| 128 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 129 | const TensorInfo& weights, |
| 130 | const Optional<TensorInfo>& biases, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 131 | Optional<std::string&> reason = EmptyOptional()) const; |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 132 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 133 | bool IsElementwiseUnarySupported(const TensorInfo& input, |
| 134 | const TensorInfo& output, |
| 135 | const ElementwiseUnaryDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 136 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 137 | |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 138 | bool IsFillSupported(const TensorInfo& input, |
| 139 | const TensorInfo& output, |
| 140 | const FillDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 141 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 142 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 143 | bool IsFloorSupported(const TensorInfo& input, |
| 144 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 145 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 146 | |
| 147 | bool IsFullyConnectedSupported(const TensorInfo& input, |
| 148 | const TensorInfo& output, |
| 149 | const TensorInfo& weights, |
| 150 | const TensorInfo& biases, |
| 151 | const FullyConnectedDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 152 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 153 | |
Teresa Charlin | 9145e38 | 2023-08-17 18:44:58 +0100 | [diff] [blame] | 154 | bool IsFusedSupported(const std::vector<std::reference_wrapper<TensorInfo>>& inputs, |
| 155 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 156 | const FusedDescriptor& descriptor, |
| 157 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
| 158 | |
Teresa Charlin | bd22c7d | 2022-04-26 18:14:12 +0100 | [diff] [blame] | 159 | bool IsGatherNdSupported(const TensorInfo& input0, |
| 160 | const TensorInfo& input1, |
| 161 | const TensorInfo& output, |
| 162 | Optional<std::string&> reasonIfUnsupported) const; |
| 163 | |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 164 | bool IsGatherSupported(const TensorInfo& input0, |
| 165 | const TensorInfo& input1, |
| 166 | const TensorInfo& output, |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 167 | const GatherDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 168 | Optional<std::string&> reasonIfUnsupported) const; |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 169 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 170 | bool IsInputSupported(const TensorInfo& input, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 171 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 172 | |
Sadik Armagan | 0d4863d | 2019-10-09 14:26:32 +0100 | [diff] [blame] | 173 | bool IsInstanceNormalizationSupported(const TensorInfo& input, |
| 174 | const TensorInfo& output, |
| 175 | const InstanceNormalizationDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 176 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | 0d4863d | 2019-10-09 14:26:32 +0100 | [diff] [blame] | 177 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 178 | bool IsL2NormalizationSupported(const TensorInfo& input, |
| 179 | const TensorInfo& output, |
| 180 | const L2NormalizationDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 181 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 182 | |
James Conroy | 177df1e | 2020-11-13 10:18:51 +0000 | [diff] [blame] | 183 | bool IsLogicalBinarySupported(const TensorInfo& input0, |
| 184 | const TensorInfo& input1, |
| 185 | const TensorInfo& output, |
| 186 | const LogicalBinaryDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 187 | Optional<std::string&> reasonIfUnsupported) const; |
James Conroy | 177df1e | 2020-11-13 10:18:51 +0000 | [diff] [blame] | 188 | |
Keith Davis | 69e653f | 2020-07-02 11:49:26 +0100 | [diff] [blame] | 189 | bool IsLogSoftmaxSupported(const TensorInfo& input, |
| 190 | const TensorInfo& output, |
| 191 | const LogSoftmaxDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 192 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Keith Davis | 69e653f | 2020-07-02 11:49:26 +0100 | [diff] [blame] | 193 | |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 194 | bool IsLstmSupported(const TensorInfo& input, |
| 195 | const TensorInfo& outputStateIn, |
| 196 | const TensorInfo& cellStateIn, |
| 197 | const TensorInfo& scratchBuffer, |
| 198 | const TensorInfo& outputStateOut, |
| 199 | const TensorInfo& cellStateOut, |
| 200 | const TensorInfo& output, |
| 201 | const LstmDescriptor& descriptor, |
| 202 | const LstmInputParamsInfo& paramsInfo, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 203 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 204 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 205 | bool IsMaximumSupported(const TensorInfo& input0, |
| 206 | const TensorInfo& input1, |
| 207 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 208 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 209 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 210 | bool IsMeanSupported(const TensorInfo& input, |
| 211 | const TensorInfo& output, |
| 212 | const MeanDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 213 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 214 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 215 | bool IsMinimumSupported(const TensorInfo& input0, |
| 216 | const TensorInfo& input1, |
| 217 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 218 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 219 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 220 | bool IsMultiplicationSupported(const TensorInfo& input0, |
| 221 | const TensorInfo& input1, |
| 222 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 223 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 224 | |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 225 | bool IsDivisionSupported(const TensorInfo& input0, |
| 226 | const TensorInfo& input1, |
| 227 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 228 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 229 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 230 | bool IsNormalizationSupported(const TensorInfo& input, |
| 231 | const TensorInfo& output, |
| 232 | const NormalizationDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 233 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 234 | |
| 235 | bool IsOutputSupported(const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 236 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 237 | |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 238 | bool IsPadSupported(const TensorInfo& input, |
| 239 | const TensorInfo& output, |
| 240 | const PadDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 241 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 242 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 243 | bool IsPermuteSupported(const TensorInfo& input, |
| 244 | const TensorInfo& output, |
| 245 | const PermuteDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 246 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 247 | |
| 248 | bool IsPooling2dSupported(const TensorInfo& input, |
| 249 | const TensorInfo& output, |
| 250 | const Pooling2dDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 251 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Ryan OShea | 19e7942 | 2022-05-04 00:38:03 +0100 | [diff] [blame] | 252 | bool IsPooling3dSupported(const TensorInfo& input, |
| 253 | const TensorInfo& output, |
| 254 | const Pooling3dDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 255 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 256 | bool IsPreluSupported(const TensorInfo& input, |
| 257 | const TensorInfo& alpha, |
| 258 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 259 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 260 | |
James Conroy | cc34093 | 2020-05-12 18:08:52 +0100 | [diff] [blame] | 261 | bool IsQLstmSupported(const TensorInfo& input, |
| 262 | const TensorInfo& previousOutputIn, |
| 263 | const TensorInfo& previousCellStateIn, |
| 264 | const TensorInfo& outputStateOut, |
| 265 | const TensorInfo& cellStateOut, |
| 266 | const TensorInfo& output, |
| 267 | const QLstmDescriptor& descriptor, |
| 268 | const LstmInputParamsInfo& paramsInfo, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 269 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
James Conroy | cc34093 | 2020-05-12 18:08:52 +0100 | [diff] [blame] | 270 | |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 271 | bool IsQuantizeSupported(const TensorInfo& input, |
| 272 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 273 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 274 | |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 275 | bool IsQuantizedLstmSupported(const TensorInfo& input, |
| 276 | const TensorInfo& cellStateIn, |
| 277 | const TensorInfo& outputStateIn, |
| 278 | const TensorInfo& cellStateOut, |
| 279 | const TensorInfo& outputStateOut, |
| 280 | const QuantizedLstmInputParamsInfo& paramsInfo, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 281 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 282 | |
Sadik Armagan | a274748 | 2021-02-09 10:28:54 +0000 | [diff] [blame] | 283 | bool IsReduceSupported(const TensorInfo& input, |
| 284 | const TensorInfo& output, |
| 285 | const ReduceDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 286 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | a274748 | 2021-02-09 10:28:54 +0000 | [diff] [blame] | 287 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 288 | bool IsReshapeSupported(const TensorInfo& input, |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 289 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 290 | const ReshapeDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 291 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 292 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 293 | bool IsResizeSupported(const TensorInfo& input, |
| 294 | const TensorInfo& output, |
| 295 | const ResizeDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 296 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 297 | |
Tianle Cheng | 21a9f33 | 2023-11-09 13:56:53 +0000 | [diff] [blame] | 298 | bool IsReverseV2Supported(const TensorInfo& input, |
| 299 | const TensorInfo& axis, |
| 300 | const TensorInfo& output, |
| 301 | Optional<std::string&> reasonIfUnsupported) const; |
| 302 | |
josh minor | 036f02d | 2019-11-15 14:53:22 -0600 | [diff] [blame] | 303 | bool IsSliceSupported(const TensorInfo& input, |
| 304 | const TensorInfo& output, |
| 305 | const SliceDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 306 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
josh minor | 036f02d | 2019-11-15 14:53:22 -0600 | [diff] [blame] | 307 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 308 | bool IsSoftmaxSupported(const TensorInfo& input, |
| 309 | const TensorInfo& output, |
| 310 | const SoftmaxDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 311 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 312 | |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 313 | bool IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 314 | const TensorInfo& output, |
| 315 | const SpaceToBatchNdDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 316 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 317 | |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 318 | bool IsSpaceToDepthSupported(const TensorInfo& input, |
| 319 | const TensorInfo& output, |
| 320 | const SpaceToDepthDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 321 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 322 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 323 | bool IsSplitterSupported(const TensorInfo& input, |
| 324 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 325 | const ViewsDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 326 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 327 | |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 328 | bool IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
| 329 | const TensorInfo& output, |
| 330 | const StackDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 331 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 332 | |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 333 | bool IsStridedSliceSupported(const TensorInfo& input, |
| 334 | const TensorInfo& output, |
| 335 | const StridedSliceDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 336 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 337 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 338 | bool IsSubtractionSupported(const TensorInfo& input0, |
| 339 | const TensorInfo& input1, |
| 340 | const TensorInfo& output, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 341 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 342 | |
David Monahan | 36e6eae | 2023-07-26 18:37:45 +0100 | [diff] [blame] | 343 | bool IsTileSupported(const TensorInfo& input0, |
| 344 | const TensorInfo& output, |
| 345 | const TileDescriptor& descriptor, |
| 346 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
| 347 | |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 348 | bool IsTransposeConvolution2dSupported(const TensorInfo& input, |
| 349 | const TensorInfo& output, |
| 350 | const TransposeConvolution2dDescriptor& descriptor, |
| 351 | const TensorInfo& weights, |
| 352 | const Optional<TensorInfo>& biases, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 353 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 354 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 355 | bool IsTransposeSupported(const TensorInfo& input, |
| 356 | const TensorInfo& output, |
| 357 | const TransposeDescriptor& descriptor, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 358 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 359 | |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 360 | bool IsUnidirectionalSequenceLstmSupported(const TensorInfo& input, |
| 361 | const TensorInfo& outputStateIn, |
| 362 | const TensorInfo& cellStateIn, |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 363 | const TensorInfo& outputStateOut, |
| 364 | const TensorInfo& cellStateOut, |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 365 | const TensorInfo& output, |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 366 | const UnidirectionalSequenceLstmDescriptor& descriptor, |
| 367 | const LstmInputParamsInfo& paramsInfo, |
Francis Murtagh | 6627703 | 2023-07-28 13:01:32 +0100 | [diff] [blame] | 368 | Optional<std::string&> reasonIfUnsupported) const; |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 369 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 370 | private: |
| 371 | const IBackendInternal::IBackendSpecificModelContextPtr m_ModelContextPtr; |
| 372 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 373 | }; // class NeonLayerSupport |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 374 | |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 375 | } // namespace armnn |