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