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