telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. 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 | |
| 6 | #include "NeonLayerSupport.hpp" |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 7 | #include "NeonBackendId.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 8 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 9 | #include <armnn/Descriptors.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 10 | #include <InternalTypes.hpp> |
| 11 | #include <LayerSupportCommon.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 12 | #include <armnn/Tensor.hpp> |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 13 | #include <armnn/Types.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 14 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 15 | #include <backendsCommon/BackendRegistry.hpp> |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 16 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 17 | #include <boost/core/ignore_unused.hpp> |
| 18 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 19 | #if defined(ARMCOMPUTENEON_ENABLED) |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 20 | #include <aclCommon/ArmComputeUtils.hpp> |
Aron Virginas-Tar | 914e4db | 2019-09-09 13:36:45 +0100 | [diff] [blame] | 21 | #include "workloads/NeonAbsWorkload.hpp" |
Matthew Bentham | 955258d | 2018-12-10 10:48:52 +0000 | [diff] [blame] | 22 | #include "workloads/NeonAdditionWorkload.hpp" |
Nattapat Chaimanowong | d4b7059 | 2018-10-12 11:21:49 +0100 | [diff] [blame] | 23 | #include "workloads/NeonActivationWorkload.hpp" |
Matthew Bentham | c48ac8c | 2018-12-12 16:15:59 +0000 | [diff] [blame] | 24 | #include "workloads/NeonBatchNormalizationWorkload.hpp" |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 25 | #include "workloads/NeonConvolution2dWorkload.hpp" |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame^] | 26 | #include "workloads/NeonDepthToSpaceWorkload.hpp" |
Nattapat Chaimanowong | 7714088 | 2018-10-17 11:12:19 +0100 | [diff] [blame] | 27 | #include "workloads/NeonDepthwiseConvolutionWorkload.hpp" |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 28 | #include "workloads/NeonDequantizeWorkload.hpp" |
kevmay01 | eed8592 | 2019-01-28 08:37:25 +0000 | [diff] [blame] | 29 | #include "workloads/NeonGreaterWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 30 | #include "workloads/NeonL2NormalizationFloatWorkload.hpp" |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 31 | #include "workloads/NeonLstmFloatWorkload.hpp" |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 32 | #include "workloads/NeonMaximumWorkload.hpp" |
Matthew Bentham | fd89996 | 2018-12-31 15:49:42 +0000 | [diff] [blame] | 33 | #include "workloads/NeonMeanWorkload.hpp" |
Jim Flynn | 39d487d | 2019-05-17 15:44:36 +0100 | [diff] [blame] | 34 | #include "workloads/NeonConcatWorkload.hpp" |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 35 | #include "workloads/NeonMinimumWorkload.hpp" |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 36 | #include "workloads/NeonMultiplicationWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 37 | #include "workloads/NeonNormalizationFloatWorkload.hpp" |
| 38 | #include "workloads/NeonFullyConnectedWorkload.hpp" |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 39 | #include "workloads/NeonPadWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 40 | #include "workloads/NeonPermuteWorkload.hpp" |
Nattapat Chaimanowong | 5d2e700 | 2018-10-12 16:03:56 +0100 | [diff] [blame] | 41 | #include "workloads/NeonPooling2dWorkload.hpp" |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 42 | #include "workloads/NeonPreluWorkload.hpp" |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 43 | #include "workloads/NeonQuantizeWorkload.hpp" |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 44 | #include "workloads/NeonQuantizedLstmWorkload.hpp" |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 45 | #include "workloads/NeonResizeWorkload.hpp" |
Aron Virginas-Tar | 0dd3b43 | 2019-09-10 13:55:09 +0100 | [diff] [blame] | 46 | #include "workloads/NeonRsqrtWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 47 | #include "workloads/NeonSoftmaxBaseWorkload.hpp" |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 48 | #include "workloads/NeonSpaceToDepthWorkload.hpp" |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 49 | #include "workloads/NeonSplitterWorkload.hpp" |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 50 | #include "workloads/NeonStackWorkload.hpp" |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 51 | #include "workloads/NeonStridedSliceWorkload.hpp" |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 52 | #include "workloads/NeonSubtractionWorkload.hpp" |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 53 | #include "workloads/NeonTransposeConvolution2dWorkload.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 54 | #endif |
| 55 | |
| 56 | using namespace boost; |
| 57 | |
| 58 | namespace armnn |
| 59 | { |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 60 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 61 | namespace |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 62 | { |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 63 | |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 64 | bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 65 | { |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 66 | #if defined(ARMCOMPUTENEON_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 67 | return true; |
| 68 | #else |
Derek Lamberti | 0790dce | 2019-04-15 18:37:35 +0100 | [diff] [blame] | 69 | SetValueChecked(reasonIfUnsupported, "The armnn library has been built without NEON support"); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 70 | return false; |
| 71 | #endif |
| 72 | } |
| 73 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 74 | template<typename FloatFunc, typename Uint8Func, typename ... Params> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 75 | bool IsSupportedForDataTypeNeon(Optional<std::string&> reasonIfUnsupported, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | DataType dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 77 | FloatFunc floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 78 | Uint8Func uint8FuncPtr, |
| 79 | Params&&... params) |
| 80 | { |
| 81 | return IsNeonBackendSupported(reasonIfUnsupported) && |
| 82 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 83 | dataType, |
| 84 | floatFuncPtr, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 85 | floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 86 | uint8FuncPtr, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 87 | &FalseFunc<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 88 | &FalseFunc<>, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 89 | std::forward<Params>(params)...); |
| 90 | } |
| 91 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 92 | #if defined(ARMCOMPUTENEON_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 93 | template<class FuncType, class... Args> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 94 | inline bool IsWorkloadSupported(FuncType& func, Optional<std::string&> reasonIfUnsupported, Args&&... args) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 95 | { |
| 96 | arm_compute::Status aclStatus = func(std::forward<Args>(args)...); |
| 97 | const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK); |
| 98 | if (!supported && reasonIfUnsupported) |
| 99 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 100 | reasonIfUnsupported.value() = aclStatus.error_description(); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 101 | } |
| 102 | return supported; |
| 103 | } |
| 104 | |
| 105 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
| 106 | return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__); |
| 107 | #else |
| 108 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
| 109 | return IsNeonBackendSupported(reasonIfUnsupported); |
| 110 | #endif |
| 111 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 112 | } // anonymous namespace |
| 113 | |
Aron Virginas-Tar | 914e4db | 2019-09-09 13:36:45 +0100 | [diff] [blame] | 114 | bool NeonLayerSupport::IsAbsSupported(const TensorInfo& input, |
| 115 | const TensorInfo& output, |
| 116 | Optional<std::string&> reasonIfUnsupported) const |
| 117 | { |
| 118 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAbsWorkloadValidate, |
| 119 | reasonIfUnsupported, |
| 120 | input, |
| 121 | output); |
| 122 | } |
| 123 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 124 | bool NeonLayerSupport::IsActivationSupported(const TensorInfo& input, |
| 125 | const TensorInfo& output, |
| 126 | const ActivationDescriptor& descriptor, |
| 127 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 128 | { |
| 129 | ignore_unused(descriptor); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 130 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonActivationWorkloadValidate, |
| 131 | reasonIfUnsupported, |
| 132 | input, |
| 133 | output, |
| 134 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 135 | } |
| 136 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 137 | bool NeonLayerSupport::IsAdditionSupported(const TensorInfo& input0, |
| 138 | const TensorInfo& input1, |
| 139 | const TensorInfo& output, |
| 140 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 141 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 142 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAdditionWorkloadValidate, |
| 143 | reasonIfUnsupported, |
| 144 | input0, |
| 145 | input1, |
| 146 | output); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 147 | } |
| 148 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 149 | bool NeonLayerSupport::IsBatchNormalizationSupported(const TensorInfo& input, |
| 150 | const TensorInfo& output, |
| 151 | const TensorInfo& mean, |
| 152 | const TensorInfo& var, |
| 153 | const TensorInfo& beta, |
| 154 | const TensorInfo& gamma, |
| 155 | const BatchNormalizationDescriptor& descriptor, |
| 156 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 157 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 158 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonBatchNormalizationValidate, |
| 159 | reasonIfUnsupported, |
| 160 | input, |
| 161 | output, |
| 162 | mean, |
| 163 | var, |
| 164 | beta, |
| 165 | gamma, |
| 166 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 167 | } |
| 168 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 169 | bool NeonLayerSupport::IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 170 | const TensorInfo& output, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 171 | const ConcatDescriptor& descriptor, |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 172 | Optional<std::string&> reasonIfUnsupported) const |
| 173 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 174 | if (descriptor.GetNumDimensions() <= descriptor.GetConcatAxis()) |
| 175 | { |
| 176 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Concat axis > Number of dimensions."); |
| 177 | return false; |
| 178 | } |
| 179 | |
| 180 | unsigned int concatInnerAxis = (descriptor.GetNumDimensions() - descriptor.GetConcatAxis()) - 1; |
| 181 | if(concatInnerAxis < 3) // Width, height, or channels |
| 182 | { |
| 183 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConcatWorkloadValidate, |
| 184 | reasonIfUnsupported, |
| 185 | inputs, |
| 186 | output, |
| 187 | descriptor); |
| 188 | } |
| 189 | else if (concatInnerAxis == 3) |
| 190 | { |
| 191 | for (auto& input : inputs) |
| 192 | { |
| 193 | if (input && !output.IsTypeSpaceMatch(*input)) // Cannot use sub-tensors if the types are not same space |
| 194 | { |
| 195 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Types and quantization parameters must match."); |
| 196 | return false; |
| 197 | } |
| 198 | } |
| 199 | return true; // Sub-tensors support concat along batch |
| 200 | } |
| 201 | else // > 4 dimensions not supported. |
| 202 | { |
| 203 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Maximum of 4 dimensions supported."); |
| 204 | return false; |
| 205 | } |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 206 | } |
| 207 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 208 | bool NeonLayerSupport::IsConstantSupported(const TensorInfo& output, |
| 209 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 210 | { |
| 211 | return IsSupportedForDataTypeNeon(reasonIfUnsupported, |
| 212 | output.GetDataType(), |
| 213 | &TrueFunc<>, |
| 214 | &TrueFunc<>); |
| 215 | } |
| 216 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 217 | bool NeonLayerSupport::IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 218 | const TensorInfo& output, |
| 219 | Optional<std::string&> reasonIfUnsupported) const |
| 220 | { |
| 221 | ignore_unused(input); |
| 222 | ignore_unused(output); |
| 223 | ignore_unused(reasonIfUnsupported); |
| 224 | return true; |
| 225 | } |
| 226 | |
| 227 | bool NeonLayerSupport::IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 228 | const TensorInfo& output, |
| 229 | Optional<std::string&> reasonIfUnsupported) const |
| 230 | { |
| 231 | ignore_unused(input); |
| 232 | ignore_unused(output); |
| 233 | ignore_unused(reasonIfUnsupported); |
| 234 | return true; |
| 235 | } |
| 236 | |
| 237 | bool NeonLayerSupport::IsConvolution2dSupported(const TensorInfo& input, |
| 238 | const TensorInfo& output, |
| 239 | const Convolution2dDescriptor& descriptor, |
| 240 | const TensorInfo& weights, |
| 241 | const Optional<TensorInfo>& biases, |
| 242 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 243 | { |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 244 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConvolution2dWorkloadValidate, |
| 245 | reasonIfUnsupported, |
| 246 | input, |
| 247 | output, |
| 248 | descriptor, |
| 249 | weights, |
| 250 | biases); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 251 | } |
| 252 | |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame^] | 253 | bool NeonLayerSupport::IsDepthToSpaceSupported(const TensorInfo& input, |
| 254 | const TensorInfo& output, |
| 255 | const DepthToSpaceDescriptor& descriptor, |
| 256 | Optional<std::string&> reasonIfUnsupported) const |
| 257 | { |
| 258 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthToSpaceWorkloadValidate, |
| 259 | reasonIfUnsupported, |
| 260 | input, |
| 261 | output, |
| 262 | descriptor); |
| 263 | } |
| 264 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 265 | bool NeonLayerSupport::IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 266 | const TensorInfo& output, |
| 267 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 268 | const TensorInfo& weights, |
| 269 | const Optional<TensorInfo>& biases, |
| 270 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 271 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 272 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate, |
| 273 | reasonIfUnsupported, |
| 274 | input, |
| 275 | output, |
| 276 | descriptor, |
| 277 | weights, |
| 278 | biases); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 279 | } |
| 280 | |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 281 | bool NeonLayerSupport::IsDequantizeSupported(const TensorInfo& input, |
| 282 | const TensorInfo& output, |
| 283 | Optional<std::string&> reasonIfUnsupported) const |
| 284 | { |
| 285 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDequantizeWorkloadValidate, |
| 286 | reasonIfUnsupported, |
| 287 | input, |
| 288 | output); |
| 289 | } |
| 290 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 291 | bool NeonLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 292 | const TensorInfo& output, |
| 293 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 294 | const TensorInfo& weights, |
| 295 | const Optional<TensorInfo>& biases, |
| 296 | Optional<std::string&> reasonIfUnsupported) const |
| 297 | { |
| 298 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate, |
| 299 | reasonIfUnsupported, |
| 300 | input, |
| 301 | output, |
| 302 | descriptor, |
| 303 | weights, |
| 304 | biases); |
| 305 | } |
| 306 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 307 | bool NeonLayerSupport::IsFloorSupported(const TensorInfo& input, |
| 308 | const TensorInfo& output, |
| 309 | Optional<std::string&> reasonIfUnsupported) const |
| 310 | { |
| 311 | ignore_unused(output); |
| 312 | return IsNeonBackendSupported(reasonIfUnsupported) && |
| 313 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 314 | input.GetDataType(), |
| 315 | &FalseFuncF16<>, |
| 316 | &TrueFunc<>, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 317 | &FalseFuncU8<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 318 | &FalseFuncI32<>, |
| 319 | &FalseFuncU8<>); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | bool NeonLayerSupport::IsFullyConnectedSupported(const TensorInfo& input, |
| 323 | const TensorInfo& output, |
| 324 | const TensorInfo& weights, |
| 325 | const TensorInfo& biases, |
| 326 | const FullyConnectedDescriptor& descriptor, |
| 327 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 328 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 329 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonFullyConnectedWorkloadValidate, |
| 330 | reasonIfUnsupported, |
| 331 | input, |
| 332 | output, |
| 333 | weights, |
| 334 | biases, |
| 335 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 336 | } |
| 337 | |
kevmay01 | eed8592 | 2019-01-28 08:37:25 +0000 | [diff] [blame] | 338 | bool NeonLayerSupport::IsGreaterSupported(const armnn::TensorInfo& input0, |
| 339 | const armnn::TensorInfo& input1, |
| 340 | const armnn::TensorInfo& output, |
| 341 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 342 | { |
| 343 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonGreaterWorkloadValidate, |
| 344 | reasonIfUnsupported, |
| 345 | input0, |
| 346 | input1, |
| 347 | output); |
| 348 | } |
| 349 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 350 | bool NeonLayerSupport::IsInputSupported(const TensorInfo& input, |
| 351 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 352 | { |
Francis Murtagh | b3fc252 | 2019-08-09 13:20:50 +0100 | [diff] [blame] | 353 | return IsNeonBackendSupported(reasonIfUnsupported); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 354 | } |
| 355 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 356 | bool NeonLayerSupport::IsL2NormalizationSupported(const TensorInfo& input, |
| 357 | const TensorInfo& output, |
| 358 | const L2NormalizationDescriptor& descriptor, |
| 359 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 360 | { |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 361 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonL2NormalizationWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 362 | } |
| 363 | |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 364 | bool NeonLayerSupport::IsLstmSupported(const TensorInfo& input, |
| 365 | const TensorInfo& outputStateIn, |
| 366 | const TensorInfo& cellStateIn, |
| 367 | const TensorInfo& scratchBuffer, |
| 368 | const TensorInfo& outputStateOut, |
| 369 | const TensorInfo& cellStateOut, |
| 370 | const TensorInfo& output, |
| 371 | const LstmDescriptor& descriptor, |
| 372 | const LstmInputParamsInfo& paramsInfo, |
| 373 | Optional<std::string&> reasonIfUnsupported) const |
| 374 | { |
| 375 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLstmFloatWorkloadValidate, |
| 376 | reasonIfUnsupported, |
| 377 | input, |
| 378 | outputStateIn, |
| 379 | cellStateIn, |
| 380 | scratchBuffer, |
| 381 | outputStateOut, |
| 382 | cellStateOut, |
| 383 | output, |
| 384 | descriptor, |
| 385 | paramsInfo); |
| 386 | } |
| 387 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 388 | bool NeonLayerSupport::IsMaximumSupported(const TensorInfo& input0, |
| 389 | const TensorInfo& input1, |
| 390 | const TensorInfo& output, |
| 391 | Optional<std::string&> reasonIfUnsupported) const |
| 392 | { |
| 393 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMaximumWorkloadValidate, |
| 394 | reasonIfUnsupported, |
| 395 | input0, |
| 396 | input1, |
| 397 | output); |
| 398 | } |
| 399 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 400 | bool NeonLayerSupport::IsMeanSupported(const TensorInfo& input, |
| 401 | const TensorInfo& output, |
| 402 | const MeanDescriptor& descriptor, |
| 403 | Optional<std::string&> reasonIfUnsupported) const |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 404 | { |
Matthew Bentham | fd89996 | 2018-12-31 15:49:42 +0000 | [diff] [blame] | 405 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMeanWorkloadValidate, |
| 406 | reasonIfUnsupported, |
| 407 | input, |
| 408 | output, |
| 409 | descriptor); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 410 | } |
| 411 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 412 | bool NeonLayerSupport::IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 413 | const TensorInfo& output, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 414 | const MergerDescriptor& descriptor, |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 415 | Optional<std::string&> reasonIfUnsupported) const |
| 416 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 417 | return IsConcatSupported(inputs, output, descriptor, reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 418 | } |
| 419 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 420 | bool NeonLayerSupport::IsMinimumSupported(const TensorInfo& input0, |
| 421 | const TensorInfo& input1, |
| 422 | const TensorInfo& output, |
| 423 | Optional<std::string&> reasonIfUnsupported) const |
| 424 | { |
| 425 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMinimumWorkloadValidate, |
| 426 | reasonIfUnsupported, |
| 427 | input0, |
| 428 | input1, |
| 429 | output); |
| 430 | } |
| 431 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 432 | bool NeonLayerSupport::IsMultiplicationSupported(const TensorInfo& input0, |
| 433 | const TensorInfo& input1, |
| 434 | const TensorInfo& output, |
| 435 | Optional<std::string&> reasonIfUnsupported) const |
| 436 | { |
| 437 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMultiplicationWorkloadValidate, |
| 438 | reasonIfUnsupported, |
| 439 | input0, |
| 440 | input1, |
| 441 | output); |
| 442 | } |
| 443 | |
| 444 | bool NeonLayerSupport::IsNormalizationSupported(const TensorInfo& input, |
| 445 | const TensorInfo& output, |
| 446 | const NormalizationDescriptor& descriptor, |
| 447 | Optional<std::string&> reasonIfUnsupported) const |
| 448 | { |
| 449 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonNormalizationWorkloadValidate, |
| 450 | reasonIfUnsupported, |
| 451 | input, |
| 452 | output, |
| 453 | descriptor); |
| 454 | } |
| 455 | |
| 456 | bool NeonLayerSupport::IsOutputSupported(const TensorInfo& output, |
| 457 | Optional<std::string&> reasonIfUnsupported) const |
| 458 | { |
Francis Murtagh | b3fc252 | 2019-08-09 13:20:50 +0100 | [diff] [blame] | 459 | return IsNeonBackendSupported(reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 460 | } |
| 461 | |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 462 | bool NeonLayerSupport::IsPadSupported(const TensorInfo& input, |
| 463 | const TensorInfo& output, |
| 464 | const PadDescriptor& descriptor, |
| 465 | Optional<std::string&> reasonIfUnsupported) const |
| 466 | { |
| 467 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPadWorkloadValidate, |
| 468 | reasonIfUnsupported, |
| 469 | input, |
| 470 | output, |
| 471 | descriptor); |
| 472 | } |
| 473 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 474 | bool NeonLayerSupport::IsPermuteSupported(const TensorInfo& input, |
| 475 | const TensorInfo& output, |
| 476 | const PermuteDescriptor& descriptor, |
| 477 | Optional<std::string&> reasonIfUnsupported) const |
| 478 | { |
| 479 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPermuteWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 480 | } |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 481 | |
| 482 | bool NeonLayerSupport::IsPooling2dSupported(const TensorInfo& input, |
| 483 | const TensorInfo& output, |
| 484 | const Pooling2dDescriptor& descriptor, |
| 485 | Optional<std::string&> reasonIfUnsupported) const |
| 486 | { |
| 487 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPooling2dWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 488 | } |
| 489 | |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 490 | bool NeonLayerSupport::IsPreluSupported(const armnn::TensorInfo &input, |
| 491 | const armnn::TensorInfo &alpha, |
| 492 | const armnn::TensorInfo &output, |
| 493 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 494 | { |
| 495 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPreluWorkloadValidate, reasonIfUnsupported, input, alpha, output); |
| 496 | } |
| 497 | |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 498 | bool NeonLayerSupport::IsQuantizeSupported(const TensorInfo& input, |
| 499 | const TensorInfo& output, |
| 500 | Optional<std::string&> reasonIfUnsupported) const |
| 501 | { |
| 502 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQuantizeWorkloadValidate, |
| 503 | reasonIfUnsupported, |
| 504 | input, |
| 505 | output); |
| 506 | } |
| 507 | |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 508 | bool NeonLayerSupport::IsQuantizedLstmSupported(const TensorInfo& input, |
| 509 | const TensorInfo& cellStateIn, |
| 510 | const TensorInfo& outputStateIn, |
| 511 | const TensorInfo& cellStateOut, |
| 512 | const TensorInfo& outputStateOut, |
| 513 | const QuantizedLstmInputParamsInfo& paramsInfo, |
| 514 | Optional<std::string&> reasonIfUnsupported) const |
| 515 | { |
| 516 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQuantizedLstmWorkloadValidate, |
| 517 | reasonIfUnsupported, |
| 518 | input, |
| 519 | cellStateIn, |
| 520 | outputStateIn, |
| 521 | cellStateOut, |
| 522 | outputStateOut, |
| 523 | paramsInfo); |
| 524 | } |
| 525 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 526 | bool NeonLayerSupport::IsReshapeSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 527 | const ReshapeDescriptor& descriptor, |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 528 | Optional<std::string&> reasonIfUnsupported) const |
| 529 | { |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 530 | ignore_unused(descriptor); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 531 | return IsSupportedForDataTypeNeon(reasonIfUnsupported, |
| 532 | input.GetDataType(), |
| 533 | &TrueFunc<>, |
| 534 | &TrueFunc<>); |
| 535 | } |
| 536 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 537 | bool NeonLayerSupport::IsResizeSupported(const TensorInfo& input, |
| 538 | const TensorInfo& output, |
| 539 | const ResizeDescriptor& descriptor, |
| 540 | Optional<std::string&> reasonIfUnsupported) const |
| 541 | { |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 542 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonResizeWorkloadValidate, |
| 543 | reasonIfUnsupported, |
| 544 | input, |
| 545 | output, |
| 546 | descriptor); |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 547 | } |
| 548 | |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 549 | bool NeonLayerSupport::IsResizeBilinearSupported(const TensorInfo& input, |
| 550 | const TensorInfo& output, |
| 551 | Optional<std::string&> reasonIfUnsupported) const |
| 552 | { |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 553 | ResizeDescriptor descriptor; |
| 554 | descriptor.m_Method = ResizeMethod::Bilinear; |
| 555 | descriptor.m_DataLayout = DataLayout::NCHW; |
| 556 | |
| 557 | const TensorShape& outputShape = output.GetShape(); |
| 558 | descriptor.m_TargetHeight = outputShape[2]; |
| 559 | descriptor.m_TargetWidth = outputShape[3]; |
| 560 | |
| 561 | return IsResizeSupported(input, output, descriptor, reasonIfUnsupported); |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 562 | } |
| 563 | |
Aron Virginas-Tar | 0dd3b43 | 2019-09-10 13:55:09 +0100 | [diff] [blame] | 564 | bool NeonLayerSupport::IsRsqrtSupported(const TensorInfo& input, |
| 565 | const TensorInfo& output, |
| 566 | Optional<std::string&> reasonIfUnsupported) const |
| 567 | { |
| 568 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonRsqrtWorkloadValidate, reasonIfUnsupported, input, output); |
| 569 | } |
| 570 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 571 | bool NeonLayerSupport::IsSoftmaxSupported(const TensorInfo& input, |
| 572 | const TensorInfo& output, |
| 573 | const SoftmaxDescriptor& descriptor, |
| 574 | Optional<std::string&> reasonIfUnsupported) const |
| 575 | { |
| 576 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSoftmaxWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 577 | } |
| 578 | |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 579 | bool NeonLayerSupport::IsSpaceToDepthSupported(const TensorInfo& input, |
| 580 | const TensorInfo& output, |
| 581 | const SpaceToDepthDescriptor& descriptor, |
| 582 | Optional<std::string&> reasonIfUnsupported) const |
| 583 | { |
| 584 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSpaceToDepthWorkloadValidate, |
| 585 | reasonIfUnsupported, |
| 586 | input, |
| 587 | output, |
| 588 | descriptor); |
| 589 | } |
| 590 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 591 | bool NeonLayerSupport::IsSplitterSupported(const TensorInfo& input, |
| 592 | const ViewsDescriptor& descriptor, |
| 593 | Optional<std::string&> reasonIfUnsupported) const |
| 594 | { |
| 595 | ignore_unused(descriptor); |
| 596 | return IsSupportedForDataTypeNeon(reasonIfUnsupported, |
| 597 | input.GetDataType(), |
| 598 | &TrueFunc<>, |
| 599 | &TrueFunc<>); |
| 600 | } |
| 601 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 602 | bool NeonLayerSupport::IsSplitterSupported(const TensorInfo& input, |
| 603 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 604 | const ViewsDescriptor& descriptor, |
| 605 | Optional<std::string&> reasonIfUnsupported) const |
| 606 | { |
| 607 | #if defined(ARMCOMPUTENEON_ENABLED) |
| 608 | // Split along the last dimension, cannot use sub-tensors |
| 609 | // as width and height of the sub-tensors do not match |
| 610 | // the width and height of the parent tensor |
| 611 | // in case of input with more than 2D. |
| 612 | std::set<unsigned int> splitAxis = ComputeSplitAxis(descriptor, input.GetShape()); |
| 613 | if (descriptor.GetNumDimensions() > 2 && splitAxis.size() == 1 && |
| 614 | *splitAxis.begin() == descriptor.GetNumDimensions() - 1 ) |
| 615 | { |
| 616 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSplitterWorkloadValidate, |
| 617 | reasonIfUnsupported, |
| 618 | input, |
| 619 | outputs, |
| 620 | *splitAxis.begin()); |
| 621 | } |
| 622 | #endif |
| 623 | for (auto output : outputs) |
| 624 | { |
| 625 | if (!input.IsTypeSpaceMatch(output)) // Cannot use sub-tensors if the types are not same space |
| 626 | { |
| 627 | SetValueChecked(reasonIfUnsupported, "Neon Splitter: Types and quantization parameters must match."); |
| 628 | return false; |
| 629 | } |
| 630 | } |
| 631 | return true; |
| 632 | } |
| 633 | |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 634 | bool NeonLayerSupport::IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
| 635 | const TensorInfo& output, |
| 636 | const StackDescriptor& descriptor, |
| 637 | Optional<std::string&> reasonIfUnsupported) const |
| 638 | { |
| 639 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonStackWorkloadValidate, |
| 640 | reasonIfUnsupported, |
| 641 | inputs, |
| 642 | output, |
| 643 | descriptor); |
| 644 | } |
| 645 | |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 646 | bool NeonLayerSupport::IsStridedSliceSupported(const TensorInfo& input, |
| 647 | const TensorInfo& output, |
| 648 | const StridedSliceDescriptor& descriptor, |
| 649 | Optional<std::string&> reasonIfUnsupported) const |
| 650 | { |
| 651 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonStridedSliceWorkloadValidate, |
| 652 | reasonIfUnsupported, |
| 653 | input, |
| 654 | output, |
| 655 | descriptor); |
| 656 | } |
| 657 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 658 | bool NeonLayerSupport::IsSubtractionSupported(const TensorInfo& input0, |
| 659 | const TensorInfo& input1, |
| 660 | const TensorInfo& output, |
| 661 | Optional<std::string&> reasonIfUnsupported) const |
| 662 | { |
| 663 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSubtractionWorkloadValidate, |
| 664 | reasonIfUnsupported, |
| 665 | input0, |
| 666 | input1, |
| 667 | output); |
| 668 | } |
| 669 | |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 670 | bool NeonLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input, |
| 671 | const TensorInfo& output, |
| 672 | const TransposeConvolution2dDescriptor& descriptor, |
| 673 | const TensorInfo& weights, |
| 674 | const Optional<TensorInfo>& biases, |
| 675 | Optional<std::string&> reasonIfUnsupported) const |
| 676 | { |
| 677 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeConvolution2dWorkloadValidate, |
| 678 | reasonIfUnsupported, |
| 679 | input, |
| 680 | output, |
| 681 | descriptor, |
| 682 | weights, |
| 683 | biases); |
| 684 | } |
| 685 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 686 | } // namespace armnn |