telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 2 | // Copyright © 2017 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 | |
| 6 | #include "NeonLayerSupport.hpp" |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 7 | #include "NeonBackendId.hpp" |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 8 | #include "NeonBackendModelContext.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 9 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 10 | #include <armnn/Descriptors.hpp> |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 11 | #include <armnn/Exceptions.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> |
Matteo Martincigh | c601aa6 | 2019-10-29 15:03:22 +0000 | [diff] [blame] | 14 | #include <armnn/BackendRegistry.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 15 | |
Matteo Martincigh | c601aa6 | 2019-10-29 15:03:22 +0000 | [diff] [blame] | 16 | #include <InternalTypes.hpp> |
| 17 | #include <LayerSupportCommon.hpp> |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 18 | #include <armnn/utility/IgnoreUnused.hpp> |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 19 | #include <armnn/utility/PolymorphicDowncast.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 20 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 21 | #if defined(ARMCOMPUTENEON_ENABLED) |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 22 | #include <aclCommon/ArmComputeUtils.hpp> |
Aron Virginas-Tar | 710f664 | 2019-11-27 14:48:32 +0000 | [diff] [blame] | 23 | #include <aclCommon/ArmComputeTensorUtils.hpp> |
Aron Virginas-Tar | 914e4db | 2019-09-09 13:36:45 +0100 | [diff] [blame] | 24 | #include "workloads/NeonAbsWorkload.hpp" |
Matthew Bentham | 955258d | 2018-12-10 10:48:52 +0000 | [diff] [blame] | 25 | #include "workloads/NeonAdditionWorkload.hpp" |
Nattapat Chaimanowong | d4b7059 | 2018-10-12 11:21:49 +0100 | [diff] [blame] | 26 | #include "workloads/NeonActivationWorkload.hpp" |
James Conroy | d47a064 | 2019-09-17 14:22:06 +0100 | [diff] [blame] | 27 | #include "workloads/NeonArgMinMaxWorkload.hpp" |
Matthew Bentham | c48ac8c | 2018-12-12 16:15:59 +0000 | [diff] [blame] | 28 | #include "workloads/NeonBatchNormalizationWorkload.hpp" |
Mike Kelly | 5685802 | 2020-01-27 12:14:47 +0000 | [diff] [blame] | 29 | #include "workloads/NeonBatchToSpaceNdWorkload.hpp" |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 30 | #include "workloads/NeonExpWorkload.hpp" |
Teresa Charlin | cedd34f | 2020-03-30 11:17:30 +0100 | [diff] [blame] | 31 | #include "workloads/NeonComparisonWorkload.hpp" |
Mike Kelly | 0886ac4 | 2020-04-27 09:55:40 +0100 | [diff] [blame] | 32 | #include "workloads/NeonConstantWorkload.hpp" |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 33 | #include "workloads/NeonConvolution2dWorkload.hpp" |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame] | 34 | #include "workloads/NeonDepthToSpaceWorkload.hpp" |
Nattapat Chaimanowong | 7714088 | 2018-10-17 11:12:19 +0100 | [diff] [blame] | 35 | #include "workloads/NeonDepthwiseConvolutionWorkload.hpp" |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 36 | #include "workloads/NeonDequantizeWorkload.hpp" |
Sadik Armagan | 0d4863d | 2019-10-09 14:26:32 +0100 | [diff] [blame] | 37 | #include "workloads/NeonInstanceNormalizationWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 38 | #include "workloads/NeonL2NormalizationFloatWorkload.hpp" |
Keith Davis | 69e653f | 2020-07-02 11:49:26 +0100 | [diff] [blame] | 39 | #include "workloads/NeonLogSoftmaxWorkload.hpp" |
James Conroy | 177df1e | 2020-11-13 10:18:51 +0000 | [diff] [blame] | 40 | #include "workloads/NeonLogicalAndWorkload.hpp" |
| 41 | #include "workloads/NeonLogicalNotWorkload.hpp" |
| 42 | #include "workloads/NeonLogicalOrWorkload.hpp" |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 43 | #include "workloads/NeonLstmFloatWorkload.hpp" |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 44 | #include "workloads/NeonMaximumWorkload.hpp" |
Matthew Bentham | fd89996 | 2018-12-31 15:49:42 +0000 | [diff] [blame] | 45 | #include "workloads/NeonMeanWorkload.hpp" |
Jim Flynn | 39d487d | 2019-05-17 15:44:36 +0100 | [diff] [blame] | 46 | #include "workloads/NeonConcatWorkload.hpp" |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 47 | #include "workloads/NeonMinimumWorkload.hpp" |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 48 | #include "workloads/NeonMultiplicationWorkload.hpp" |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 49 | #include "workloads/NeonDivisionWorkload.hpp" |
Sadik Armagan | ac47210 | 2020-03-24 09:54:36 +0000 | [diff] [blame] | 50 | #include "workloads/NeonNegWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 51 | #include "workloads/NeonNormalizationFloatWorkload.hpp" |
| 52 | #include "workloads/NeonFullyConnectedWorkload.hpp" |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 53 | #include "workloads/NeonGatherWorkload.hpp" |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 54 | #include "workloads/NeonPadWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 55 | #include "workloads/NeonPermuteWorkload.hpp" |
Nattapat Chaimanowong | 5d2e700 | 2018-10-12 16:03:56 +0100 | [diff] [blame] | 56 | #include "workloads/NeonPooling2dWorkload.hpp" |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 57 | #include "workloads/NeonPreluWorkload.hpp" |
James Conroy | cc34093 | 2020-05-12 18:08:52 +0100 | [diff] [blame] | 58 | #include "workloads/NeonQLstmWorkload.hpp" |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 59 | #include "workloads/NeonQuantizeWorkload.hpp" |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 60 | #include "workloads/NeonQuantizedLstmWorkload.hpp" |
Sadik Armagan | a274748 | 2021-02-09 10:28:54 +0000 | [diff] [blame] | 61 | #include "workloads/NeonReduceWorkload.hpp" |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 62 | #include "workloads/NeonReshapeWorkload.hpp" |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 63 | #include "workloads/NeonResizeWorkload.hpp" |
Aron Virginas-Tar | 0dd3b43 | 2019-09-10 13:55:09 +0100 | [diff] [blame] | 64 | #include "workloads/NeonRsqrtWorkload.hpp" |
josh minor | 036f02d | 2019-11-15 14:53:22 -0600 | [diff] [blame] | 65 | #include "workloads/NeonSliceWorkload.hpp" |
Sadik Armagan | be88a57 | 2020-04-30 11:39:37 +0100 | [diff] [blame] | 66 | #include "workloads/NeonSoftmaxWorkload.hpp" |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 67 | #include "workloads/NeonSpaceToBatchNdWorkload.hpp" |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 68 | #include "workloads/NeonSpaceToDepthWorkload.hpp" |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 69 | #include "workloads/NeonSplitterWorkload.hpp" |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 70 | #include "workloads/NeonStackWorkload.hpp" |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 71 | #include "workloads/NeonStridedSliceWorkload.hpp" |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 72 | #include "workloads/NeonSubtractionWorkload.hpp" |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 73 | #include "workloads/NeonTransposeConvolution2dWorkload.hpp" |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 74 | #include "workloads/NeonTransposeWorkload.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 75 | #endif |
| 76 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 77 | namespace armnn |
| 78 | { |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 79 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 80 | namespace |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 81 | { |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 82 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 83 | template< typename ... Args> |
| 84 | bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 85 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 86 | IgnoreUnused(reasonIfUnsupported, (args)...); |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 87 | #if defined(ARMCOMPUTENEON_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 88 | return true; |
| 89 | #else |
Derek Lamberti | 0790dce | 2019-04-15 18:37:35 +0100 | [diff] [blame] | 90 | SetValueChecked(reasonIfUnsupported, "The armnn library has been built without NEON support"); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 91 | return false; |
| 92 | #endif |
| 93 | } |
| 94 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 95 | template<typename FloatFunc, typename Uint8Func, typename ... Params> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 96 | bool IsSupportedForDataTypeNeon(Optional<std::string&> reasonIfUnsupported, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 97 | DataType dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 98 | FloatFunc floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 99 | Uint8Func uint8FuncPtr, |
| 100 | Params&&... params) |
| 101 | { |
| 102 | return IsNeonBackendSupported(reasonIfUnsupported) && |
| 103 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 104 | dataType, |
| 105 | floatFuncPtr, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 106 | floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 107 | uint8FuncPtr, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 108 | &FalseFunc<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 109 | &FalseFunc<>, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 110 | std::forward<Params>(params)...); |
| 111 | } |
| 112 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 113 | #if defined(ARMCOMPUTENEON_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 114 | template<class FuncType, class... Args> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 115 | inline bool IsWorkloadSupported(FuncType& func, Optional<std::string&> reasonIfUnsupported, Args&&... args) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 116 | { |
| 117 | arm_compute::Status aclStatus = func(std::forward<Args>(args)...); |
| 118 | const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK); |
| 119 | if (!supported && reasonIfUnsupported) |
| 120 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 121 | reasonIfUnsupported.value() = aclStatus.error_description(); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 122 | } |
| 123 | return supported; |
| 124 | } |
| 125 | |
| 126 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
| 127 | return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__); |
| 128 | #else |
| 129 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 130 | return IsNeonBackendSupported(reasonIfUnsupported, __VA_ARGS__); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 131 | #endif |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 132 | } // anonymous namespace |
| 133 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 134 | NeonLayerSupport::NeonLayerSupport(const IBackendInternal::IBackendSpecificModelContextPtr& modelContextPtr) |
| 135 | : m_ModelContextPtr(modelContextPtr) |
| 136 | { |
| 137 | } |
| 138 | |
| 139 | NeonLayerSupport::NeonLayerSupport() |
| 140 | : m_ModelContextPtr(nullptr) |
| 141 | { |
| 142 | } |
| 143 | |
Aron Virginas-Tar | 914e4db | 2019-09-09 13:36:45 +0100 | [diff] [blame] | 144 | bool NeonLayerSupport::IsAbsSupported(const TensorInfo& input, |
| 145 | const TensorInfo& output, |
| 146 | Optional<std::string&> reasonIfUnsupported) const |
| 147 | { |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 148 | ElementwiseUnaryDescriptor descriptor(UnaryOperation::Abs); |
| 149 | return IsElementwiseUnarySupported(input, output, descriptor, reasonIfUnsupported); |
Aron Virginas-Tar | 914e4db | 2019-09-09 13:36:45 +0100 | [diff] [blame] | 150 | } |
| 151 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 152 | bool NeonLayerSupport::IsActivationSupported(const TensorInfo& input, |
| 153 | const TensorInfo& output, |
| 154 | const ActivationDescriptor& descriptor, |
| 155 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 156 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 157 | IgnoreUnused(descriptor); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 158 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonActivationWorkloadValidate, |
| 159 | reasonIfUnsupported, |
| 160 | input, |
| 161 | output, |
| 162 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 163 | } |
| 164 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 165 | bool NeonLayerSupport::IsAdditionSupported(const TensorInfo& input0, |
| 166 | const TensorInfo& input1, |
| 167 | const TensorInfo& output, |
| 168 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 169 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 170 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAdditionWorkloadValidate, |
| 171 | reasonIfUnsupported, |
| 172 | input0, |
| 173 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 174 | output, |
| 175 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 176 | } |
| 177 | |
James Conroy | d47a064 | 2019-09-17 14:22:06 +0100 | [diff] [blame] | 178 | bool NeonLayerSupport::IsArgMinMaxSupported(const TensorInfo& input, |
| 179 | const TensorInfo& output, |
| 180 | const ArgMinMaxDescriptor& descriptor, |
| 181 | Optional<std::string&> reasonIfUnsupported) const |
| 182 | { |
| 183 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonArgMinMaxWorkloadValidate, |
| 184 | reasonIfUnsupported, |
| 185 | input, |
| 186 | output, |
| 187 | descriptor); |
| 188 | } |
| 189 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 190 | bool NeonLayerSupport::IsBatchNormalizationSupported(const TensorInfo& input, |
| 191 | const TensorInfo& output, |
| 192 | const TensorInfo& mean, |
| 193 | const TensorInfo& var, |
| 194 | const TensorInfo& beta, |
| 195 | const TensorInfo& gamma, |
| 196 | const BatchNormalizationDescriptor& descriptor, |
| 197 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 198 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 199 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonBatchNormalizationValidate, |
| 200 | reasonIfUnsupported, |
| 201 | input, |
| 202 | output, |
| 203 | mean, |
| 204 | var, |
| 205 | beta, |
| 206 | gamma, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 207 | descriptor, |
| 208 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 209 | } |
| 210 | |
Mike Kelly | 5685802 | 2020-01-27 12:14:47 +0000 | [diff] [blame] | 211 | bool NeonLayerSupport::IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 212 | const TensorInfo& output, |
| 213 | const BatchToSpaceNdDescriptor& descriptor, |
| 214 | Optional<std::string&> reasonIfUnsupported) const |
| 215 | { |
| 216 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonBatchToSpaceNdWorkloadValidate, |
| 217 | reasonIfUnsupported, |
| 218 | input, |
| 219 | output, |
| 220 | descriptor); |
| 221 | } |
| 222 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 223 | bool NeonLayerSupport::IsComparisonSupported(const TensorInfo& input0, |
| 224 | const TensorInfo& input1, |
| 225 | const TensorInfo& output, |
| 226 | const ComparisonDescriptor& descriptor, |
| 227 | Optional<std::string&> reasonIfUnsupported) const |
| 228 | { |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 229 | |
Teresa Charlin | cedd34f | 2020-03-30 11:17:30 +0100 | [diff] [blame] | 230 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonComparisonWorkloadValidate, |
| 231 | reasonIfUnsupported, |
| 232 | input0, |
| 233 | input1, |
| 234 | output, |
| 235 | descriptor); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 236 | } |
| 237 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 238 | bool NeonLayerSupport::IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 239 | const TensorInfo& output, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 240 | const ConcatDescriptor& descriptor, |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 241 | Optional<std::string&> reasonIfUnsupported) const |
| 242 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 243 | if (descriptor.GetNumDimensions() <= descriptor.GetConcatAxis()) |
| 244 | { |
| 245 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Concat axis > Number of dimensions."); |
| 246 | return false; |
| 247 | } |
| 248 | |
| 249 | unsigned int concatInnerAxis = (descriptor.GetNumDimensions() - descriptor.GetConcatAxis()) - 1; |
| 250 | if(concatInnerAxis < 3) // Width, height, or channels |
| 251 | { |
| 252 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConcatWorkloadValidate, |
| 253 | reasonIfUnsupported, |
| 254 | inputs, |
| 255 | output, |
| 256 | descriptor); |
| 257 | } |
| 258 | else if (concatInnerAxis == 3) |
| 259 | { |
| 260 | for (auto& input : inputs) |
| 261 | { |
| 262 | if (input && !output.IsTypeSpaceMatch(*input)) // Cannot use sub-tensors if the types are not same space |
| 263 | { |
| 264 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Types and quantization parameters must match."); |
| 265 | return false; |
| 266 | } |
| 267 | } |
| 268 | return true; // Sub-tensors support concat along batch |
| 269 | } |
| 270 | else // > 4 dimensions not supported. |
| 271 | { |
| 272 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Maximum of 4 dimensions supported."); |
| 273 | return false; |
| 274 | } |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 275 | } |
| 276 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 277 | bool NeonLayerSupport::IsConstantSupported(const TensorInfo& output, |
| 278 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 279 | { |
Mike Kelly | 0886ac4 | 2020-04-27 09:55:40 +0100 | [diff] [blame] | 280 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConstantWorkloadValidate, |
| 281 | reasonIfUnsupported, |
| 282 | output); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 283 | } |
| 284 | |
Narumol Prangnawarat | 250d392 | 2020-03-30 16:11:04 +0100 | [diff] [blame] | 285 | bool NeonLayerSupport::IsConvertBf16ToFp32Supported(const TensorInfo& input, |
| 286 | const TensorInfo& output, |
| 287 | Optional<std::string&> reasonIfUnsupported) const |
| 288 | { |
| 289 | armnn::IgnoreUnused(input); |
| 290 | armnn::IgnoreUnused(output); |
| 291 | armnn::IgnoreUnused(reasonIfUnsupported); |
| 292 | return true; |
| 293 | } |
| 294 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 295 | bool NeonLayerSupport::IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 296 | const TensorInfo& output, |
| 297 | Optional<std::string&> reasonIfUnsupported) const |
| 298 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 299 | armnn::IgnoreUnused(input); |
| 300 | armnn::IgnoreUnused(output); |
| 301 | armnn::IgnoreUnused(reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 302 | return true; |
| 303 | } |
| 304 | |
Narumol Prangnawarat | 250d392 | 2020-03-30 16:11:04 +0100 | [diff] [blame] | 305 | bool NeonLayerSupport::IsConvertFp32ToBf16Supported(const TensorInfo& input, |
| 306 | const TensorInfo& output, |
| 307 | Optional<std::string&> reasonIfUnsupported) const |
| 308 | { |
| 309 | armnn::IgnoreUnused(input); |
| 310 | armnn::IgnoreUnused(output); |
| 311 | armnn::IgnoreUnused(reasonIfUnsupported); |
| 312 | return true; |
| 313 | } |
| 314 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 315 | bool NeonLayerSupport::IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 316 | const TensorInfo& output, |
| 317 | Optional<std::string&> reasonIfUnsupported) const |
| 318 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 319 | armnn::IgnoreUnused(input); |
| 320 | armnn::IgnoreUnused(output); |
| 321 | armnn::IgnoreUnused(reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 322 | return true; |
| 323 | } |
| 324 | |
| 325 | bool NeonLayerSupport::IsConvolution2dSupported(const TensorInfo& input, |
| 326 | const TensorInfo& output, |
| 327 | const Convolution2dDescriptor& descriptor, |
| 328 | const TensorInfo& weights, |
| 329 | const Optional<TensorInfo>& biases, |
| 330 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 331 | { |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 332 | bool isFastMathEnabled = false; |
| 333 | #if defined(ARMCOMPUTENEON_ENABLED) |
| 334 | if (m_ModelContextPtr) |
| 335 | { |
| 336 | if (m_ModelContextPtr.get() != nullptr) |
| 337 | { |
Sadik Armagan | 04a7297 | 2020-09-14 15:44:18 +0100 | [diff] [blame] | 338 | auto modelOptions = dynamic_cast<NeonBackendModelContext*>(m_ModelContextPtr.get()); |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 339 | if (modelOptions) |
| 340 | { |
| 341 | isFastMathEnabled = modelOptions->IsFastMathEnabled(); |
| 342 | } |
| 343 | } |
| 344 | } |
| 345 | #endif |
| 346 | |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 347 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConvolution2dWorkloadValidate, |
| 348 | reasonIfUnsupported, |
| 349 | input, |
| 350 | output, |
| 351 | descriptor, |
| 352 | weights, |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 353 | biases, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 354 | isFastMathEnabled, |
| 355 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 356 | } |
| 357 | |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame] | 358 | bool NeonLayerSupport::IsDepthToSpaceSupported(const TensorInfo& input, |
| 359 | const TensorInfo& output, |
| 360 | const DepthToSpaceDescriptor& descriptor, |
| 361 | Optional<std::string&> reasonIfUnsupported) const |
| 362 | { |
| 363 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthToSpaceWorkloadValidate, |
| 364 | reasonIfUnsupported, |
| 365 | input, |
| 366 | output, |
| 367 | descriptor); |
| 368 | } |
| 369 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 370 | bool NeonLayerSupport::IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 371 | const TensorInfo& output, |
| 372 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 373 | const TensorInfo& weights, |
| 374 | const Optional<TensorInfo>& biases, |
| 375 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 376 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 377 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate, |
| 378 | reasonIfUnsupported, |
| 379 | input, |
| 380 | output, |
| 381 | descriptor, |
| 382 | weights, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 383 | biases, |
| 384 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 385 | } |
| 386 | |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 387 | bool NeonLayerSupport::IsDequantizeSupported(const TensorInfo& input, |
| 388 | const TensorInfo& output, |
| 389 | Optional<std::string&> reasonIfUnsupported) const |
| 390 | { |
| 391 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDequantizeWorkloadValidate, |
| 392 | reasonIfUnsupported, |
| 393 | input, |
| 394 | output); |
| 395 | } |
| 396 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 397 | bool NeonLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 398 | const TensorInfo& output, |
| 399 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 400 | const TensorInfo& weights, |
| 401 | const Optional<TensorInfo>& biases, |
| 402 | Optional<std::string&> reasonIfUnsupported) const |
| 403 | { |
| 404 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate, |
| 405 | reasonIfUnsupported, |
| 406 | input, |
| 407 | output, |
| 408 | descriptor, |
| 409 | weights, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 410 | biases, |
| 411 | nullptr); |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 412 | } |
| 413 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 414 | bool NeonLayerSupport::IsElementwiseUnarySupported(const TensorInfo& input, |
| 415 | const TensorInfo& output, |
| 416 | const ElementwiseUnaryDescriptor& descriptor, |
| 417 | Optional<std::string&> reasonIfUnsupported) const |
| 418 | { |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 419 | switch(descriptor.m_Operation) |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 420 | { |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 421 | case UnaryOperation::Abs: |
| 422 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAbsWorkloadValidate, |
| 423 | reasonIfUnsupported, |
| 424 | input, |
| 425 | output); |
| 426 | case UnaryOperation::Exp: |
| 427 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonExpWorkloadValidate, |
| 428 | reasonIfUnsupported, |
| 429 | input, |
| 430 | output); |
| 431 | case UnaryOperation::Neg: |
| 432 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonNegWorkloadValidate, |
| 433 | reasonIfUnsupported, |
| 434 | input, |
| 435 | output); |
| 436 | case UnaryOperation::Rsqrt: |
| 437 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonRsqrtWorkloadValidate, |
| 438 | reasonIfUnsupported, |
| 439 | input, |
| 440 | output); |
James Conroy | 177df1e | 2020-11-13 10:18:51 +0000 | [diff] [blame] | 441 | case UnaryOperation::LogicalNot: |
| 442 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogicalNotWorkloadValidate, |
| 443 | reasonIfUnsupported, |
| 444 | input, |
| 445 | output); |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 446 | default: |
| 447 | return false; |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 448 | } |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 449 | } |
| 450 | |
Teresa Charlin | 4b10fef | 2020-07-29 09:36:41 +0100 | [diff] [blame] | 451 | bool NeonLayerSupport::IsFillSupported(const TensorInfo& input, |
| 452 | const TensorInfo& output, |
| 453 | const FillDescriptor& descriptor, |
| 454 | Optional<std::string&> reasonIfUnsupported) const |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 455 | { |
Teresa Charlin | 4b10fef | 2020-07-29 09:36:41 +0100 | [diff] [blame] | 456 | armnn::IgnoreUnused(input); |
| 457 | armnn::IgnoreUnused(output); |
| 458 | armnn::IgnoreUnused(descriptor); |
| 459 | |
| 460 | return IsNeonBackendSupported(reasonIfUnsupported); |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 461 | } |
| 462 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 463 | bool NeonLayerSupport::IsFloorSupported(const TensorInfo& input, |
| 464 | const TensorInfo& output, |
| 465 | Optional<std::string&> reasonIfUnsupported) const |
| 466 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 467 | armnn::IgnoreUnused(output); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 468 | return IsNeonBackendSupported(reasonIfUnsupported) && |
| 469 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 470 | input.GetDataType(), |
| 471 | &FalseFuncF16<>, |
| 472 | &TrueFunc<>, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 473 | &FalseFuncU8<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 474 | &FalseFuncI32<>, |
| 475 | &FalseFuncU8<>); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 476 | } |
| 477 | |
| 478 | bool NeonLayerSupport::IsFullyConnectedSupported(const TensorInfo& input, |
| 479 | const TensorInfo& output, |
| 480 | const TensorInfo& weights, |
| 481 | const TensorInfo& biases, |
| 482 | const FullyConnectedDescriptor& descriptor, |
| 483 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 484 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 485 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonFullyConnectedWorkloadValidate, |
| 486 | reasonIfUnsupported, |
| 487 | input, |
| 488 | output, |
| 489 | weights, |
| 490 | biases, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 491 | descriptor, |
| 492 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 493 | } |
| 494 | |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 495 | bool NeonLayerSupport::IsGatherSupported(const TensorInfo& input0, |
| 496 | const TensorInfo& input1, |
| 497 | const TensorInfo& output, |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 498 | const GatherDescriptor& descriptor, |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 499 | Optional<std::string&> reasonIfUnsupported) const |
| 500 | { |
| 501 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonGatherWorkloadValidate, |
| 502 | reasonIfUnsupported, |
| 503 | input0, |
| 504 | input1, |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 505 | output, |
| 506 | descriptor); |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 507 | } |
| 508 | |
kevmay01 | eed8592 | 2019-01-28 08:37:25 +0000 | [diff] [blame] | 509 | bool NeonLayerSupport::IsGreaterSupported(const armnn::TensorInfo& input0, |
| 510 | const armnn::TensorInfo& input1, |
| 511 | const armnn::TensorInfo& output, |
| 512 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 513 | { |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 514 | ComparisonDescriptor descriptor(ComparisonOperation::Greater); |
| 515 | return IsComparisonSupported(input0, input1, output, descriptor, reasonIfUnsupported); |
kevmay01 | eed8592 | 2019-01-28 08:37:25 +0000 | [diff] [blame] | 516 | } |
| 517 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 518 | bool NeonLayerSupport::IsInputSupported(const TensorInfo& input, |
| 519 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 520 | { |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 521 | return IsNeonBackendSupported(reasonIfUnsupported, input); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 522 | } |
| 523 | |
Sadik Armagan | 0d4863d | 2019-10-09 14:26:32 +0100 | [diff] [blame] | 524 | bool NeonLayerSupport::IsInstanceNormalizationSupported(const TensorInfo& input, |
| 525 | const TensorInfo& output, |
| 526 | const InstanceNormalizationDescriptor& descriptor, |
| 527 | Optional<std::string&> reasonIfUnsupported) const |
| 528 | { |
| 529 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonInstanceNormalizationWorkloadValidate, |
| 530 | reasonIfUnsupported, |
| 531 | input, |
| 532 | output, |
| 533 | descriptor); |
| 534 | } |
| 535 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 536 | bool NeonLayerSupport::IsL2NormalizationSupported(const TensorInfo& input, |
| 537 | const TensorInfo& output, |
| 538 | const L2NormalizationDescriptor& descriptor, |
| 539 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 540 | { |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 541 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonL2NormalizationWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 542 | } |
| 543 | |
James Conroy | 177df1e | 2020-11-13 10:18:51 +0000 | [diff] [blame] | 544 | bool NeonLayerSupport::IsLogicalBinarySupported(const TensorInfo& input0, |
| 545 | const TensorInfo& input1, |
| 546 | const TensorInfo& output, |
| 547 | const LogicalBinaryDescriptor& descriptor, |
| 548 | Optional<std::string&> reasonIfUnsupported) const |
| 549 | { |
| 550 | switch(descriptor.m_Operation) |
| 551 | { |
| 552 | case LogicalBinaryOperation::LogicalAnd: |
| 553 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogicalAndWorkloadValidate, |
| 554 | reasonIfUnsupported, |
| 555 | input0, |
| 556 | input1, |
| 557 | output); |
| 558 | case LogicalBinaryOperation::LogicalOr: |
| 559 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogicalOrWorkloadValidate, |
| 560 | reasonIfUnsupported, |
| 561 | input0, |
| 562 | input1, |
| 563 | output); |
| 564 | default: |
| 565 | return false; |
| 566 | } |
| 567 | } |
| 568 | |
Keith Davis | 69e653f | 2020-07-02 11:49:26 +0100 | [diff] [blame] | 569 | bool NeonLayerSupport::IsLogSoftmaxSupported(const TensorInfo& input, |
| 570 | const TensorInfo& output, |
| 571 | const LogSoftmaxDescriptor& descriptor, |
| 572 | Optional<std::string&> reasonIfUnsupported) const |
| 573 | { |
| 574 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogSoftmaxWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 575 | } |
| 576 | |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 577 | bool NeonLayerSupport::IsLstmSupported(const TensorInfo& input, |
| 578 | const TensorInfo& outputStateIn, |
| 579 | const TensorInfo& cellStateIn, |
| 580 | const TensorInfo& scratchBuffer, |
| 581 | const TensorInfo& outputStateOut, |
| 582 | const TensorInfo& cellStateOut, |
| 583 | const TensorInfo& output, |
| 584 | const LstmDescriptor& descriptor, |
| 585 | const LstmInputParamsInfo& paramsInfo, |
| 586 | Optional<std::string&> reasonIfUnsupported) const |
| 587 | { |
| 588 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLstmFloatWorkloadValidate, |
| 589 | reasonIfUnsupported, |
| 590 | input, |
| 591 | outputStateIn, |
| 592 | cellStateIn, |
| 593 | scratchBuffer, |
| 594 | outputStateOut, |
| 595 | cellStateOut, |
| 596 | output, |
| 597 | descriptor, |
| 598 | paramsInfo); |
| 599 | } |
| 600 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 601 | bool NeonLayerSupport::IsMaximumSupported(const TensorInfo& input0, |
| 602 | const TensorInfo& input1, |
| 603 | const TensorInfo& output, |
| 604 | Optional<std::string&> reasonIfUnsupported) const |
| 605 | { |
| 606 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMaximumWorkloadValidate, |
| 607 | reasonIfUnsupported, |
| 608 | input0, |
| 609 | input1, |
| 610 | output); |
| 611 | } |
| 612 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 613 | bool NeonLayerSupport::IsMeanSupported(const TensorInfo& input, |
| 614 | const TensorInfo& output, |
| 615 | const MeanDescriptor& descriptor, |
| 616 | Optional<std::string&> reasonIfUnsupported) const |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 617 | { |
Matthew Bentham | fd89996 | 2018-12-31 15:49:42 +0000 | [diff] [blame] | 618 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMeanWorkloadValidate, |
| 619 | reasonIfUnsupported, |
| 620 | input, |
| 621 | output, |
| 622 | descriptor); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 623 | } |
| 624 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 625 | bool NeonLayerSupport::IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 626 | const TensorInfo& output, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 627 | const MergerDescriptor& descriptor, |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 628 | Optional<std::string&> reasonIfUnsupported) const |
| 629 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 630 | return IsConcatSupported(inputs, output, descriptor, reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 631 | } |
| 632 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 633 | bool NeonLayerSupport::IsMinimumSupported(const TensorInfo& input0, |
| 634 | const TensorInfo& input1, |
| 635 | const TensorInfo& output, |
| 636 | Optional<std::string&> reasonIfUnsupported) const |
| 637 | { |
| 638 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMinimumWorkloadValidate, |
| 639 | reasonIfUnsupported, |
| 640 | input0, |
| 641 | input1, |
| 642 | output); |
| 643 | } |
| 644 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 645 | bool NeonLayerSupport::IsMultiplicationSupported(const TensorInfo& input0, |
| 646 | const TensorInfo& input1, |
| 647 | const TensorInfo& output, |
| 648 | Optional<std::string&> reasonIfUnsupported) const |
| 649 | { |
| 650 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMultiplicationWorkloadValidate, |
| 651 | reasonIfUnsupported, |
| 652 | input0, |
| 653 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 654 | output, |
| 655 | nullptr); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 656 | } |
| 657 | |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 658 | bool NeonLayerSupport::IsDivisionSupported(const TensorInfo& input0, |
| 659 | const TensorInfo& input1, |
| 660 | const TensorInfo& output, |
| 661 | Optional<std::string&> reasonIfUnsupported) const |
| 662 | { |
| 663 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDivisionWorkloadValidate, |
| 664 | reasonIfUnsupported, |
| 665 | input0, |
| 666 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 667 | output, |
| 668 | nullptr); |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 669 | } |
| 670 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 671 | bool NeonLayerSupport::IsNormalizationSupported(const TensorInfo& input, |
| 672 | const TensorInfo& output, |
| 673 | const NormalizationDescriptor& descriptor, |
| 674 | Optional<std::string&> reasonIfUnsupported) const |
| 675 | { |
| 676 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonNormalizationWorkloadValidate, |
| 677 | reasonIfUnsupported, |
| 678 | input, |
| 679 | output, |
| 680 | descriptor); |
| 681 | } |
| 682 | |
| 683 | bool NeonLayerSupport::IsOutputSupported(const TensorInfo& output, |
| 684 | Optional<std::string&> reasonIfUnsupported) const |
| 685 | { |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 686 | return IsNeonBackendSupported(reasonIfUnsupported, output); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 687 | } |
| 688 | |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 689 | bool NeonLayerSupport::IsPadSupported(const TensorInfo& input, |
| 690 | const TensorInfo& output, |
| 691 | const PadDescriptor& descriptor, |
| 692 | Optional<std::string&> reasonIfUnsupported) const |
| 693 | { |
| 694 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPadWorkloadValidate, |
| 695 | reasonIfUnsupported, |
| 696 | input, |
| 697 | output, |
| 698 | descriptor); |
| 699 | } |
| 700 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 701 | bool NeonLayerSupport::IsPermuteSupported(const TensorInfo& input, |
| 702 | const TensorInfo& output, |
| 703 | const PermuteDescriptor& descriptor, |
| 704 | Optional<std::string&> reasonIfUnsupported) const |
| 705 | { |
| 706 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPermuteWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 707 | } |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 708 | |
| 709 | bool NeonLayerSupport::IsPooling2dSupported(const TensorInfo& input, |
| 710 | const TensorInfo& output, |
| 711 | const Pooling2dDescriptor& descriptor, |
| 712 | Optional<std::string&> reasonIfUnsupported) const |
| 713 | { |
| 714 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPooling2dWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 715 | } |
| 716 | |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 717 | bool NeonLayerSupport::IsPreluSupported(const armnn::TensorInfo &input, |
| 718 | const armnn::TensorInfo &alpha, |
| 719 | const armnn::TensorInfo &output, |
| 720 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 721 | { |
| 722 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPreluWorkloadValidate, reasonIfUnsupported, input, alpha, output); |
| 723 | } |
| 724 | |
James Conroy | cc34093 | 2020-05-12 18:08:52 +0100 | [diff] [blame] | 725 | bool NeonLayerSupport::IsQLstmSupported(const TensorInfo& input, |
| 726 | const TensorInfo& previousOutputIn, |
| 727 | const TensorInfo& previousCellStateIn, |
| 728 | const TensorInfo& outputStateOut, |
| 729 | const TensorInfo& cellStateOut, |
| 730 | const TensorInfo& output, |
| 731 | const QLstmDescriptor& descriptor, |
| 732 | const LstmInputParamsInfo& paramsInfo, |
| 733 | Optional<std::string&> reasonIfUnsupported) const |
| 734 | { |
| 735 | // Check required here in order to pass IsLayerSupported for datatypes tests |
| 736 | if (input.GetDataType() == armnn::DataType::QAsymmS8 && |
| 737 | previousOutputIn.GetDataType() == armnn::DataType::QAsymmS8 && |
| 738 | previousCellStateIn.GetDataType() == armnn::DataType::QSymmS16 && |
| 739 | outputStateOut.GetDataType() == armnn::DataType::QAsymmS8 && |
| 740 | cellStateOut.GetDataType() == armnn::DataType::QSymmS16 && |
| 741 | output.GetDataType() == armnn::DataType::QAsymmS8) |
| 742 | { |
| 743 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQLstmWorkloadValidate, |
| 744 | reasonIfUnsupported, |
| 745 | input, |
| 746 | previousCellStateIn, |
| 747 | previousOutputIn, |
| 748 | cellStateOut, |
| 749 | outputStateOut, |
| 750 | output, |
| 751 | descriptor, |
| 752 | paramsInfo); |
| 753 | } |
| 754 | else |
| 755 | { |
| 756 | return false; |
| 757 | } |
| 758 | } |
| 759 | |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 760 | bool NeonLayerSupport::IsQuantizeSupported(const TensorInfo& input, |
| 761 | const TensorInfo& output, |
| 762 | Optional<std::string&> reasonIfUnsupported) const |
| 763 | { |
| 764 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQuantizeWorkloadValidate, |
| 765 | reasonIfUnsupported, |
| 766 | input, |
| 767 | output); |
| 768 | } |
| 769 | |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 770 | bool NeonLayerSupport::IsQuantizedLstmSupported(const TensorInfo& input, |
| 771 | const TensorInfo& cellStateIn, |
| 772 | const TensorInfo& outputStateIn, |
| 773 | const TensorInfo& cellStateOut, |
| 774 | const TensorInfo& outputStateOut, |
| 775 | const QuantizedLstmInputParamsInfo& paramsInfo, |
| 776 | Optional<std::string&> reasonIfUnsupported) const |
| 777 | { |
| 778 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQuantizedLstmWorkloadValidate, |
| 779 | reasonIfUnsupported, |
| 780 | input, |
| 781 | cellStateIn, |
| 782 | outputStateIn, |
| 783 | cellStateOut, |
| 784 | outputStateOut, |
| 785 | paramsInfo); |
| 786 | } |
| 787 | |
Sadik Armagan | a274748 | 2021-02-09 10:28:54 +0000 | [diff] [blame] | 788 | bool NeonLayerSupport::IsReduceSupported(const TensorInfo& input, |
| 789 | const TensorInfo& output, |
| 790 | const ReduceDescriptor& descriptor, |
| 791 | Optional<std::string&> reasonIfUnsupported) const |
| 792 | { |
| 793 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonReduceWorkloadValidate, |
| 794 | reasonIfUnsupported, |
| 795 | input, |
| 796 | output, |
| 797 | descriptor); |
| 798 | } |
| 799 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 800 | bool NeonLayerSupport::IsReshapeSupported(const TensorInfo& input, |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 801 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 802 | const ReshapeDescriptor& descriptor, |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 803 | Optional<std::string&> reasonIfUnsupported) const |
| 804 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 805 | armnn::IgnoreUnused(descriptor); |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 806 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonReshapeWorkloadValidate, |
| 807 | reasonIfUnsupported, |
| 808 | input, |
| 809 | output); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 810 | } |
| 811 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 812 | bool NeonLayerSupport::IsResizeSupported(const TensorInfo& input, |
| 813 | const TensorInfo& output, |
| 814 | const ResizeDescriptor& descriptor, |
| 815 | Optional<std::string&> reasonIfUnsupported) const |
| 816 | { |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 817 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonResizeWorkloadValidate, |
| 818 | reasonIfUnsupported, |
| 819 | input, |
| 820 | output, |
| 821 | descriptor); |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 822 | } |
| 823 | |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 824 | bool NeonLayerSupport::IsResizeBilinearSupported(const TensorInfo& input, |
| 825 | const TensorInfo& output, |
| 826 | Optional<std::string&> reasonIfUnsupported) const |
| 827 | { |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 828 | ResizeDescriptor descriptor; |
| 829 | descriptor.m_Method = ResizeMethod::Bilinear; |
| 830 | descriptor.m_DataLayout = DataLayout::NCHW; |
| 831 | |
| 832 | const TensorShape& outputShape = output.GetShape(); |
| 833 | descriptor.m_TargetHeight = outputShape[2]; |
| 834 | descriptor.m_TargetWidth = outputShape[3]; |
| 835 | |
| 836 | return IsResizeSupported(input, output, descriptor, reasonIfUnsupported); |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 837 | } |
| 838 | |
Aron Virginas-Tar | 0dd3b43 | 2019-09-10 13:55:09 +0100 | [diff] [blame] | 839 | bool NeonLayerSupport::IsRsqrtSupported(const TensorInfo& input, |
| 840 | const TensorInfo& output, |
| 841 | Optional<std::string&> reasonIfUnsupported) const |
| 842 | { |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 843 | ElementwiseUnaryDescriptor descriptor(UnaryOperation::Rsqrt); |
| 844 | return IsElementwiseUnarySupported(input, output, descriptor, reasonIfUnsupported); |
Aron Virginas-Tar | 0dd3b43 | 2019-09-10 13:55:09 +0100 | [diff] [blame] | 845 | } |
| 846 | |
josh minor | 036f02d | 2019-11-15 14:53:22 -0600 | [diff] [blame] | 847 | bool NeonLayerSupport::IsSliceSupported(const TensorInfo& input, |
| 848 | const TensorInfo& output, |
| 849 | const SliceDescriptor& descriptor, |
| 850 | Optional<std::string&> reasonIfUnsupported) const |
| 851 | { |
| 852 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSliceWorkloadValidate, |
| 853 | reasonIfUnsupported, |
| 854 | input, |
| 855 | output, |
| 856 | descriptor); |
| 857 | } |
| 858 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 859 | bool NeonLayerSupport::IsSoftmaxSupported(const TensorInfo& input, |
| 860 | const TensorInfo& output, |
| 861 | const SoftmaxDescriptor& descriptor, |
| 862 | Optional<std::string&> reasonIfUnsupported) const |
| 863 | { |
| 864 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSoftmaxWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 865 | } |
| 866 | |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 867 | bool NeonLayerSupport::IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 868 | const TensorInfo& output, |
| 869 | const SpaceToBatchNdDescriptor& descriptor, |
| 870 | Optional<std::string&> reasonIfUnsupported) const |
| 871 | { |
| 872 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSpaceToBatchNdWorkloadValidate, |
| 873 | reasonIfUnsupported, |
| 874 | input, |
| 875 | output, |
| 876 | descriptor); |
| 877 | } |
| 878 | |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 879 | bool NeonLayerSupport::IsSpaceToDepthSupported(const TensorInfo& input, |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 880 | const TensorInfo& output, |
| 881 | const SpaceToDepthDescriptor& descriptor, |
| 882 | Optional<std::string&> reasonIfUnsupported) const |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 883 | { |
| 884 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSpaceToDepthWorkloadValidate, |
| 885 | reasonIfUnsupported, |
| 886 | input, |
| 887 | output, |
| 888 | descriptor); |
| 889 | } |
| 890 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 891 | bool NeonLayerSupport::IsSplitterSupported(const TensorInfo& input, |
| 892 | const ViewsDescriptor& descriptor, |
| 893 | Optional<std::string&> reasonIfUnsupported) const |
| 894 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 895 | armnn::IgnoreUnused(descriptor); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 896 | return IsSupportedForDataTypeNeon(reasonIfUnsupported, |
| 897 | input.GetDataType(), |
| 898 | &TrueFunc<>, |
| 899 | &TrueFunc<>); |
| 900 | } |
| 901 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 902 | bool NeonLayerSupport::IsSplitterSupported(const TensorInfo& input, |
| 903 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 904 | const ViewsDescriptor& descriptor, |
| 905 | Optional<std::string&> reasonIfUnsupported) const |
| 906 | { |
| 907 | #if defined(ARMCOMPUTENEON_ENABLED) |
| 908 | // Split along the last dimension, cannot use sub-tensors |
| 909 | // as width and height of the sub-tensors do not match |
| 910 | // the width and height of the parent tensor |
| 911 | // in case of input with more than 2D. |
| 912 | std::set<unsigned int> splitAxis = ComputeSplitAxis(descriptor, input.GetShape()); |
| 913 | if (descriptor.GetNumDimensions() > 2 && splitAxis.size() == 1 && |
| 914 | *splitAxis.begin() == descriptor.GetNumDimensions() - 1 ) |
| 915 | { |
| 916 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSplitterWorkloadValidate, |
| 917 | reasonIfUnsupported, |
| 918 | input, |
| 919 | outputs, |
| 920 | *splitAxis.begin()); |
| 921 | } |
| 922 | #endif |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 923 | IgnoreUnused(descriptor); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 924 | for (auto output : outputs) |
| 925 | { |
| 926 | if (!input.IsTypeSpaceMatch(output)) // Cannot use sub-tensors if the types are not same space |
| 927 | { |
| 928 | SetValueChecked(reasonIfUnsupported, "Neon Splitter: Types and quantization parameters must match."); |
| 929 | return false; |
| 930 | } |
| 931 | } |
| 932 | return true; |
| 933 | } |
| 934 | |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 935 | bool NeonLayerSupport::IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
| 936 | const TensorInfo& output, |
| 937 | const StackDescriptor& descriptor, |
| 938 | Optional<std::string&> reasonIfUnsupported) const |
| 939 | { |
| 940 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonStackWorkloadValidate, |
| 941 | reasonIfUnsupported, |
| 942 | inputs, |
| 943 | output, |
| 944 | descriptor); |
| 945 | } |
| 946 | |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 947 | bool NeonLayerSupport::IsStridedSliceSupported(const TensorInfo& input, |
| 948 | const TensorInfo& output, |
| 949 | const StridedSliceDescriptor& descriptor, |
| 950 | Optional<std::string&> reasonIfUnsupported) const |
| 951 | { |
| 952 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonStridedSliceWorkloadValidate, |
| 953 | reasonIfUnsupported, |
| 954 | input, |
| 955 | output, |
| 956 | descriptor); |
| 957 | } |
| 958 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 959 | bool NeonLayerSupport::IsSubtractionSupported(const TensorInfo& input0, |
| 960 | const TensorInfo& input1, |
| 961 | const TensorInfo& output, |
| 962 | Optional<std::string&> reasonIfUnsupported) const |
| 963 | { |
| 964 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSubtractionWorkloadValidate, |
| 965 | reasonIfUnsupported, |
| 966 | input0, |
| 967 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 968 | output, |
| 969 | nullptr); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 970 | } |
| 971 | |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 972 | bool NeonLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input, |
| 973 | const TensorInfo& output, |
| 974 | const TransposeConvolution2dDescriptor& descriptor, |
| 975 | const TensorInfo& weights, |
| 976 | const Optional<TensorInfo>& biases, |
| 977 | Optional<std::string&> reasonIfUnsupported) const |
| 978 | { |
| 979 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeConvolution2dWorkloadValidate, |
| 980 | reasonIfUnsupported, |
| 981 | input, |
| 982 | output, |
| 983 | descriptor, |
| 984 | weights, |
| 985 | biases); |
| 986 | } |
| 987 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 988 | bool NeonLayerSupport::IsTransposeSupported(const TensorInfo& input, |
| 989 | const TensorInfo& output, |
| 990 | const TransposeDescriptor& descriptor, |
| 991 | Optional<std::string&> reasonIfUnsupported) const |
| 992 | { |
| 993 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 994 | } |
| 995 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 996 | } // namespace armnn |