telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 2 | // Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | |
| 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 | |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 10 | #include <armnn/Exceptions.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 11 | #include <armnn/Tensor.hpp> |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 12 | #include <armnn/Types.hpp> |
Matteo Martincigh | c601aa6 | 2019-10-29 15:03:22 +0000 | [diff] [blame] | 13 | #include <armnn/BackendRegistry.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 14 | |
Matteo Martincigh | c601aa6 | 2019-10-29 15:03:22 +0000 | [diff] [blame] | 15 | #include <InternalTypes.hpp> |
| 16 | #include <LayerSupportCommon.hpp> |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 17 | #include <armnn/utility/IgnoreUnused.hpp> |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 18 | #include <armnn/utility/PolymorphicDowncast.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 19 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 20 | #if defined(ARMCOMPUTENEON_ENABLED) |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 21 | #include <aclCommon/ArmComputeUtils.hpp> |
Aron Virginas-Tar | 710f664 | 2019-11-27 14:48:32 +0000 | [diff] [blame] | 22 | #include <aclCommon/ArmComputeTensorUtils.hpp> |
Aron Virginas-Tar | 914e4db | 2019-09-09 13:36:45 +0100 | [diff] [blame] | 23 | #include "workloads/NeonAbsWorkload.hpp" |
Matthew Bentham | 955258d | 2018-12-10 10:48:52 +0000 | [diff] [blame] | 24 | #include "workloads/NeonAdditionWorkload.hpp" |
Nattapat Chaimanowong | d4b7059 | 2018-10-12 11:21:49 +0100 | [diff] [blame] | 25 | #include "workloads/NeonActivationWorkload.hpp" |
James Conroy | d47a064 | 2019-09-17 14:22:06 +0100 | [diff] [blame] | 26 | #include "workloads/NeonArgMinMaxWorkload.hpp" |
Teresa Charlin | 0f86ecf | 2022-10-13 15:47:08 +0100 | [diff] [blame] | 27 | #include "workloads/NeonBatchMatMulWorkload.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" |
Teresa Charlin | bd22c7d | 2022-04-26 18:14:12 +0100 | [diff] [blame] | 58 | #include "workloads/NeonGatherNdWorkload.hpp" |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 59 | #include "workloads/NeonPadWorkload.hpp" |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 60 | #include "workloads/NeonPermuteWorkload.hpp" |
Nattapat Chaimanowong | 5d2e700 | 2018-10-12 16:03:56 +0100 | [diff] [blame] | 61 | #include "workloads/NeonPooling2dWorkload.hpp" |
Ryan OShea | 19e7942 | 2022-05-04 00:38:03 +0100 | [diff] [blame] | 62 | #include "workloads/NeonPooling3dWorkload.hpp" |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 63 | #include "workloads/NeonPreluWorkload.hpp" |
James Conroy | cc34093 | 2020-05-12 18:08:52 +0100 | [diff] [blame] | 64 | #include "workloads/NeonQLstmWorkload.hpp" |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 65 | #include "workloads/NeonQuantizeWorkload.hpp" |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 66 | #include "workloads/NeonQuantizedLstmWorkload.hpp" |
Sadik Armagan | a274748 | 2021-02-09 10:28:54 +0000 | [diff] [blame] | 67 | #include "workloads/NeonReduceWorkload.hpp" |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 68 | #include "workloads/NeonReshapeWorkload.hpp" |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 69 | #include "workloads/NeonResizeWorkload.hpp" |
Aron Virginas-Tar | 0dd3b43 | 2019-09-10 13:55:09 +0100 | [diff] [blame] | 70 | #include "workloads/NeonRsqrtWorkload.hpp" |
Teresa Charlin | 50de4fa | 2021-05-31 18:47:33 +0100 | [diff] [blame] | 71 | #include "workloads/NeonSinWorkload.hpp" |
josh minor | 036f02d | 2019-11-15 14:53:22 -0600 | [diff] [blame] | 72 | #include "workloads/NeonSliceWorkload.hpp" |
Sadik Armagan | be88a57 | 2020-04-30 11:39:37 +0100 | [diff] [blame] | 73 | #include "workloads/NeonSoftmaxWorkload.hpp" |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 74 | #include "workloads/NeonSpaceToBatchNdWorkload.hpp" |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 75 | #include "workloads/NeonSpaceToDepthWorkload.hpp" |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 76 | #include "workloads/NeonSplitterWorkload.hpp" |
Teresa Charlin | 06145cc | 2022-05-05 15:31:30 +0100 | [diff] [blame] | 77 | #include "workloads/NeonSqrtWorkload.hpp" |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 78 | #include "workloads/NeonStackWorkload.hpp" |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 79 | #include "workloads/NeonStridedSliceWorkload.hpp" |
Conor Kennedy | b99480b | 2019-03-08 08:24:41 +0000 | [diff] [blame] | 80 | #include "workloads/NeonSubtractionWorkload.hpp" |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 81 | #include "workloads/NeonTransposeConvolution2dWorkload.hpp" |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 82 | #include "workloads/NeonTransposeWorkload.hpp" |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 83 | #include "workloads/NeonUnidirectionalSequenceLstmFloatWorkload.hpp" |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 84 | #include "workloads/NeonUnidirectionalSequenceLstmWorkload.hpp" |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 85 | #endif |
| 86 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 87 | namespace armnn |
| 88 | { |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 89 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 90 | namespace |
arovir01 | 7ff76c5 | 2018-10-09 09:40:58 +0100 | [diff] [blame] | 91 | { |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 92 | |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 93 | const TensorInfo OverrideDataType(const TensorInfo& info, Optional<DataType> type) |
| 94 | { |
| 95 | if (!type) |
| 96 | { |
| 97 | return info; |
| 98 | } |
| 99 | return TensorInfo(info.GetShape(), |
| 100 | type.value(), |
| 101 | info.GetQuantizationScale(), |
| 102 | info.GetQuantizationOffset(), |
| 103 | info.IsConstant()); |
| 104 | } |
| 105 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 106 | template< typename ... Args> |
| 107 | bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 108 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 109 | IgnoreUnused(reasonIfUnsupported, (args)...); |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 110 | #if defined(ARMCOMPUTENEON_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 111 | return true; |
| 112 | #else |
Derek Lamberti | 0790dce | 2019-04-15 18:37:35 +0100 | [diff] [blame] | 113 | SetValueChecked(reasonIfUnsupported, "The armnn library has been built without NEON support"); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 114 | return false; |
| 115 | #endif |
| 116 | } |
| 117 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 118 | template<typename FloatFunc, typename Uint8Func, typename ... Params> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 119 | bool IsSupportedForDataTypeNeon(Optional<std::string&> reasonIfUnsupported, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 120 | DataType dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 121 | FloatFunc floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 122 | Uint8Func uint8FuncPtr, |
| 123 | Params&&... params) |
| 124 | { |
| 125 | return IsNeonBackendSupported(reasonIfUnsupported) && |
| 126 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 127 | dataType, |
| 128 | floatFuncPtr, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 129 | floatFuncPtr, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 130 | uint8FuncPtr, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 131 | &FalseFunc<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 132 | &FalseFunc<>, |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 133 | std::forward<Params>(params)...); |
| 134 | } |
| 135 | |
Matteo Martincigh | d95e906 | 2019-01-31 15:35:59 +0000 | [diff] [blame] | 136 | #if defined(ARMCOMPUTENEON_ENABLED) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 137 | template<class FuncType, class... Args> |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 138 | inline bool IsWorkloadSupported(FuncType& func, Optional<std::string&> reasonIfUnsupported, Args&&... args) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 139 | { |
| 140 | arm_compute::Status aclStatus = func(std::forward<Args>(args)...); |
| 141 | const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK); |
| 142 | if (!supported && reasonIfUnsupported) |
| 143 | { |
arovir01 | 085f0a4 | 2018-10-08 14:48:19 +0100 | [diff] [blame] | 144 | reasonIfUnsupported.value() = aclStatus.error_description(); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 145 | } |
| 146 | return supported; |
| 147 | } |
| 148 | |
| 149 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
| 150 | return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__); |
| 151 | #else |
| 152 | #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \ |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 153 | return IsNeonBackendSupported(reasonIfUnsupported, __VA_ARGS__); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 154 | #endif |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 155 | } // anonymous namespace |
| 156 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 157 | NeonLayerSupport::NeonLayerSupport(const IBackendInternal::IBackendSpecificModelContextPtr& modelContextPtr) |
| 158 | : m_ModelContextPtr(modelContextPtr) |
| 159 | { |
| 160 | } |
| 161 | |
| 162 | NeonLayerSupport::NeonLayerSupport() |
| 163 | : m_ModelContextPtr(nullptr) |
| 164 | { |
| 165 | } |
| 166 | |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 167 | bool IsLayerTypeSupported(const LayerType& type, |
| 168 | const std::vector<TensorInfo>& infos, |
| 169 | const BaseDescriptor& descriptor, |
| 170 | const Optional<LstmInputParamsInfo>& lstmParamsInfo, |
| 171 | const Optional<QuantizedLstmInputParamsInfo>& quantizedLstmParamsInfo, |
| 172 | Optional<std::string&> reasonIfUnsupported, |
| 173 | const NeonLayerSupport& support) |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 174 | { |
| 175 | switch (type) |
| 176 | { |
| 177 | case LayerType::Activation: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 178 | return support.IsActivationSupported(infos[0], |
| 179 | infos[1], |
| 180 | *(PolymorphicDowncast<const ActivationDescriptor*>(&descriptor)), |
| 181 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 182 | case LayerType::Addition: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 183 | return support.IsAdditionSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 184 | case LayerType::ArgMinMax: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 185 | return support.IsArgMinMaxSupported(infos[0], |
| 186 | infos[1], |
| 187 | *(PolymorphicDowncast<const ArgMinMaxDescriptor*>(&descriptor)), |
| 188 | reasonIfUnsupported); |
Teresa Charlin | 0f86ecf | 2022-10-13 15:47:08 +0100 | [diff] [blame] | 189 | case LayerType::BatchMatMul: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 190 | return support.IsBatchMatMulSupported(infos[0], |
| 191 | infos[1], |
| 192 | infos[2], |
| 193 | *(PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor)), |
| 194 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 195 | case LayerType::BatchNormalization: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 196 | return support.IsBatchNormalizationSupported(infos[0], |
| 197 | infos[1], |
| 198 | infos[2], |
| 199 | infos[3], |
| 200 | infos[4], |
| 201 | infos[5], |
| 202 | *(PolymorphicDowncast<const |
| 203 | BatchNormalizationDescriptor*>(&descriptor)), |
| 204 | reasonIfUnsupported); |
| 205 | case LayerType::BatchToSpaceNd: |
| 206 | return support.IsBatchToSpaceNdSupported(infos[0], |
| 207 | infos[1], |
| 208 | *(PolymorphicDowncast<const |
| 209 | BatchToSpaceNdDescriptor*>(&descriptor)), |
| 210 | reasonIfUnsupported); |
| 211 | case LayerType::Cast: |
| 212 | return support.IsCastSupported(infos[0], infos[1], reasonIfUnsupported); |
| 213 | case LayerType::ChannelShuffle: |
| 214 | return support.IsChannelShuffleSupported(infos[0], |
| 215 | infos[1], |
| 216 | *(PolymorphicDowncast<const |
| 217 | ChannelShuffleDescriptor*>(&descriptor)), |
| 218 | reasonIfUnsupported); |
| 219 | case LayerType::Comparison: |
| 220 | return support.IsComparisonSupported(infos[0], |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 221 | infos[1], |
| 222 | infos[2], |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 223 | *(PolymorphicDowncast<const ComparisonDescriptor*>(&descriptor)), |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 224 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 225 | case LayerType::Concat: |
| 226 | { |
| 227 | std::vector<const TensorInfo*> inputInfos; |
| 228 | for (uint32_t i = 0; i < (infos.size() - 1); i++) |
| 229 | { |
| 230 | inputInfos.push_back(&infos[i]); |
| 231 | } |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 232 | return support.IsConcatSupported(inputInfos, |
| 233 | infos[infos.size() - 1], |
| 234 | *(PolymorphicDowncast<const OriginsDescriptor*>(&descriptor)), |
| 235 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 236 | } |
| 237 | case LayerType::Constant: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 238 | return support.IsConstantSupported(infos[0], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 239 | case LayerType::ConvertFp16ToFp32: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 240 | return support.IsConvertFp16ToFp32Supported(infos[0], infos[1], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 241 | case LayerType::ConvertFp32ToFp16: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 242 | return support.IsConvertFp32ToFp16Supported(infos[0], infos[1], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 243 | case LayerType::Convolution2d: |
| 244 | { |
| 245 | if (infos.size() != 4) |
| 246 | { |
| 247 | throw InvalidArgumentException("Invalid number of TransposeConvolution2d TensorInfos. " |
| 248 | "TensorInfos should be of format: {input, output, weights, biases}."); |
| 249 | } |
| 250 | |
| 251 | auto desc = *(PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor)); |
| 252 | if (infos[3] == TensorInfo()) |
| 253 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 254 | return support.IsConvolution2dSupported(infos[0], |
| 255 | infos[1], |
| 256 | desc, |
| 257 | infos[2], |
| 258 | EmptyOptional(), |
| 259 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 260 | } |
| 261 | else |
| 262 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 263 | return support.IsConvolution2dSupported(infos[0], |
| 264 | infos[1], |
| 265 | desc, |
| 266 | infos[2], |
| 267 | infos[3], |
| 268 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 269 | } |
| 270 | } |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 271 | case LayerType::Convolution3d: |
| 272 | { |
| 273 | if (infos.size() != 4) |
| 274 | { |
| 275 | throw InvalidArgumentException("Invalid number of Convolution3d TensorInfos. " |
| 276 | "TensorInfos should be of format: {input, output, weights, biases}."); |
| 277 | } |
| 278 | |
| 279 | auto desc = *(PolymorphicDowncast<const Convolution3dDescriptor*>(&descriptor)); |
| 280 | if (infos[3] == TensorInfo()) |
| 281 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 282 | return support.IsConvolution3dSupported(infos[0], |
| 283 | infos[1], |
| 284 | desc, |
| 285 | infos[2], |
| 286 | EmptyOptional(), |
| 287 | reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 288 | } |
| 289 | else |
| 290 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 291 | return support.IsConvolution3dSupported(infos[0], |
| 292 | infos[1], |
| 293 | desc, |
| 294 | infos[2], |
| 295 | infos[3], |
| 296 | reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 297 | } |
| 298 | } |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 299 | case LayerType::DepthToSpace: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 300 | return support.IsDepthToSpaceSupported(infos[0], |
| 301 | infos[1], |
| 302 | *(PolymorphicDowncast<const DepthToSpaceDescriptor*>(&descriptor)), |
| 303 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 304 | case LayerType::DepthwiseConvolution2d: |
| 305 | { |
| 306 | if (infos.size() != 4) |
| 307 | { |
| 308 | throw InvalidArgumentException("Invalid number of DepthwiseConvolution2d TensorInfos. " |
| 309 | "TensorInfos should be of format: {input, output, weights, biases}."); |
| 310 | } |
| 311 | |
| 312 | auto desc = *(PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor)); |
| 313 | if (infos[3] == TensorInfo()) |
| 314 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 315 | return support.IsDepthwiseConvolutionSupported(infos[0], |
| 316 | infos[1], |
| 317 | desc, |
| 318 | infos[2], |
| 319 | EmptyOptional(), |
| 320 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 321 | } |
| 322 | else |
| 323 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 324 | return support.IsDepthwiseConvolutionSupported(infos[0], |
| 325 | infos[1], |
| 326 | desc, |
| 327 | infos[2], |
| 328 | infos[3], |
| 329 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 330 | } |
| 331 | } |
| 332 | case LayerType::Dequantize: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 333 | return support.IsDequantizeSupported(infos[0], infos[1], reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 334 | case LayerType::DetectionPostProcess: |
| 335 | { |
| 336 | auto desc = *(PolymorphicDowncast<const DetectionPostProcessDescriptor*>(&descriptor)); |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 337 | return support.IsDetectionPostProcessSupported(infos[0], |
| 338 | infos[1], |
| 339 | infos[2], |
| 340 | infos[3], |
| 341 | infos[4], |
| 342 | infos[5], |
| 343 | infos[6], |
| 344 | desc, |
| 345 | reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 346 | } |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 347 | case LayerType::Division: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 348 | return support.IsDivisionSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 349 | case LayerType::ElementwiseBinary: |
| 350 | { |
| 351 | auto desc = *(PolymorphicDowncast<const ElementwiseBinaryDescriptor *>(&descriptor)); |
| 352 | |
| 353 | switch (desc.m_Operation) |
| 354 | { |
| 355 | case BinaryOperation::Add: |
| 356 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAdditionWorkloadValidate, |
| 357 | reasonIfUnsupported, |
| 358 | infos[0], |
| 359 | infos[1], |
| 360 | infos[2], |
| 361 | nullptr); |
| 362 | case BinaryOperation::Div: |
| 363 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDivisionWorkloadValidate, |
| 364 | reasonIfUnsupported, |
| 365 | infos[0], |
| 366 | infos[1], |
| 367 | infos[2], |
| 368 | nullptr); |
| 369 | case BinaryOperation::Maximum: |
| 370 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMaximumWorkloadValidate, |
| 371 | reasonIfUnsupported, |
| 372 | infos[0], |
| 373 | infos[1], |
| 374 | infos[2]); |
| 375 | case BinaryOperation::Minimum: |
| 376 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMinimumWorkloadValidate, |
| 377 | reasonIfUnsupported, |
| 378 | infos[0], |
| 379 | infos[1], |
| 380 | infos[2]); |
| 381 | case BinaryOperation::Mul: |
| 382 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMultiplicationWorkloadValidate, |
| 383 | reasonIfUnsupported, |
| 384 | infos[0], |
| 385 | infos[1], |
| 386 | infos[2], |
| 387 | nullptr); |
| 388 | case BinaryOperation::Sub: |
| 389 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSubtractionWorkloadValidate, |
| 390 | reasonIfUnsupported, |
| 391 | infos[0], |
| 392 | infos[1], |
| 393 | infos[2], |
| 394 | nullptr); |
| 395 | default: |
| 396 | return false; |
| 397 | } |
| 398 | } |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 399 | case LayerType::ElementwiseUnary: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 400 | return support.IsElementwiseUnarySupported(infos[0], |
| 401 | infos[1], |
| 402 | *(PolymorphicDowncast<const |
| 403 | ElementwiseUnaryDescriptor*>(&descriptor)), |
| 404 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 405 | case LayerType::Fill: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 406 | return support.IsFillSupported(infos[0], |
| 407 | infos[1], |
| 408 | *(PolymorphicDowncast<const FillDescriptor*>(&descriptor)), |
| 409 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 410 | case LayerType::Floor: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 411 | return support.IsFloorSupported(infos[0], infos[1], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 412 | case LayerType::FullyConnected: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 413 | return support.IsFullyConnectedSupported(infos[0], |
| 414 | infos[1], |
| 415 | infos[2], |
| 416 | infos[3], |
| 417 | *(PolymorphicDowncast<const |
| 418 | FullyConnectedDescriptor*>(&descriptor)), |
| 419 | reasonIfUnsupported); |
| 420 | case LayerType::Gather: |
| 421 | return support.IsGatherSupported(infos[0], |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 422 | infos[1], |
| 423 | infos[2], |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 424 | *(PolymorphicDowncast<const GatherDescriptor*>(&descriptor)), |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 425 | reasonIfUnsupported); |
Teresa Charlin | bd22c7d | 2022-04-26 18:14:12 +0100 | [diff] [blame] | 426 | case LayerType::GatherNd: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 427 | return support.IsGatherNdSupported(infos[0], |
| 428 | infos[1], |
| 429 | infos[2], |
| 430 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 431 | case LayerType::Input: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 432 | return support.IsInputSupported(infos[0], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 433 | case LayerType::InstanceNormalization: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 434 | return support.IsInstanceNormalizationSupported(infos[0], |
| 435 | infos[1], |
| 436 | *(PolymorphicDowncast<const |
| 437 | InstanceNormalizationDescriptor*>(&descriptor)), |
| 438 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 439 | case LayerType::L2Normalization: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 440 | return support.IsL2NormalizationSupported(infos[0], |
| 441 | infos[1], |
| 442 | *(PolymorphicDowncast<const |
| 443 | L2NormalizationDescriptor*>(&descriptor)), |
| 444 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 445 | case LayerType::LogicalBinary: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 446 | return support.IsLogicalBinarySupported(infos[0], |
| 447 | infos[1], |
| 448 | infos[2], |
| 449 | *(PolymorphicDowncast<const |
| 450 | LogicalBinaryDescriptor*>(&descriptor)), |
| 451 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 452 | case LayerType::LogSoftmax: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 453 | return support.IsLogSoftmaxSupported(infos[0], |
| 454 | infos[1], |
| 455 | *(PolymorphicDowncast<const LogSoftmaxDescriptor*>(&descriptor)), |
| 456 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 457 | case LayerType::Lstm: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 458 | return support.IsLstmSupported(infos[0], |
| 459 | infos[1], |
| 460 | infos[2], |
| 461 | infos[3], |
| 462 | infos[4], |
| 463 | infos[5], |
| 464 | infos[6], |
| 465 | *(PolymorphicDowncast<const LstmDescriptor*>(&descriptor)), |
| 466 | lstmParamsInfo.value(), |
| 467 | reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 468 | case LayerType::Map: |
| 469 | return true; |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 470 | case LayerType::Maximum: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 471 | return support.IsMaximumSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 472 | case LayerType::Mean: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 473 | return support.IsMeanSupported(infos[0], |
| 474 | infos[1], |
| 475 | *(PolymorphicDowncast<const MeanDescriptor*>(&descriptor)), |
| 476 | reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 477 | case LayerType::MemCopy: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 478 | return support.IsMemCopySupported(infos[0], infos[1], reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 479 | case LayerType::MemImport: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 480 | return support.IsMemImportSupported(infos[0], infos[1], reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 481 | case LayerType::Merge: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 482 | return support.IsMergeSupported(infos[0], |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 483 | infos[1], |
| 484 | infos[2], |
| 485 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 486 | case LayerType::Minimum: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 487 | return support.IsMinimumSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 488 | case LayerType::Multiplication: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 489 | return support.IsMultiplicationSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 490 | case LayerType::Normalization: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 491 | return support.IsNormalizationSupported(infos[0], |
| 492 | infos[1], |
| 493 | *(PolymorphicDowncast<const |
| 494 | NormalizationDescriptor*>(&descriptor)), |
| 495 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 496 | case LayerType::Output: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 497 | return support.IsOutputSupported(infos[0], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 498 | case LayerType::Pad: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 499 | return support.IsPadSupported(infos[0], |
| 500 | infos[1], |
| 501 | *(PolymorphicDowncast<const PadDescriptor*>(&descriptor)), |
| 502 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 503 | case LayerType::Permute: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 504 | return support.IsPermuteSupported(infos[0], |
| 505 | infos[1], |
| 506 | *(PolymorphicDowncast<const PermuteDescriptor*>(&descriptor)), |
| 507 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 508 | case LayerType::Pooling2d: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 509 | return support.IsPooling2dSupported(infos[0], |
| 510 | infos[1], |
| 511 | *(PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor)), |
| 512 | reasonIfUnsupported); |
Ryan OShea | 19e7942 | 2022-05-04 00:38:03 +0100 | [diff] [blame] | 513 | case LayerType::Pooling3d: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 514 | return support.IsPooling3dSupported(infos[0], |
| 515 | infos[1], |
| 516 | *(PolymorphicDowncast<const Pooling3dDescriptor*>(&descriptor)), |
| 517 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 518 | case LayerType::Prelu: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 519 | return support.IsPreluSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 520 | case LayerType::QLstm: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 521 | return support.IsQLstmSupported(infos[0], |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 522 | infos[1], |
| 523 | infos[2], |
| 524 | infos[3], |
| 525 | infos[4], |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 526 | infos[5], |
| 527 | *(PolymorphicDowncast<const QLstmDescriptor*>(&descriptor)), |
| 528 | lstmParamsInfo.value(), |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 529 | reasonIfUnsupported); |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 530 | case LayerType::Quantize: |
| 531 | return support.IsQuantizeSupported(infos[0], infos[1], reasonIfUnsupported); |
| 532 | case LayerType::QuantizedLstm: |
| 533 | return support.IsQuantizedLstmSupported(infos[0], |
| 534 | infos[1], |
| 535 | infos[2], |
| 536 | infos[3], |
| 537 | infos[4], |
| 538 | quantizedLstmParamsInfo.value(), |
| 539 | reasonIfUnsupported); |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 540 | case LayerType::Rank: |
| 541 | return true; |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 542 | case LayerType::Reshape: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 543 | return support.IsReshapeSupported(infos[0], |
| 544 | infos[1], |
| 545 | *(PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor)), |
| 546 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 547 | case LayerType::Resize: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 548 | return support.IsResizeSupported(infos[0], |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 549 | infos[1], |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 550 | *(PolymorphicDowncast<const ResizeDescriptor*>(&descriptor)), |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 551 | reasonIfUnsupported); |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 552 | case LayerType::Reduce: |
| 553 | return support.IsReduceSupported(infos[0], |
| 554 | infos[1], |
| 555 | *(PolymorphicDowncast<const ReduceDescriptor*>(&descriptor)), |
| 556 | reasonIfUnsupported); |
| 557 | case LayerType::Shape: |
| 558 | return support.IsShapeSupported(infos[0], |
| 559 | infos[1], |
| 560 | reasonIfUnsupported); |
| 561 | case LayerType::Slice: |
| 562 | return support.IsSliceSupported(infos[0], |
| 563 | infos[1], |
| 564 | *(PolymorphicDowncast<const SliceDescriptor*>(&descriptor)), |
| 565 | reasonIfUnsupported); |
| 566 | case LayerType::Softmax: |
| 567 | return support.IsSoftmaxSupported(infos[0], |
| 568 | infos[1], |
| 569 | *(PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor)), |
| 570 | reasonIfUnsupported); |
| 571 | case LayerType::SpaceToBatchNd: |
| 572 | return support.IsSpaceToBatchNdSupported(infos[0], |
| 573 | infos[1], |
| 574 | *(PolymorphicDowncast<const |
| 575 | SpaceToBatchNdDescriptor*>(&descriptor)), |
| 576 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 577 | case LayerType::SpaceToDepth: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 578 | return support.IsSpaceToDepthSupported(infos[0], |
| 579 | infos[1], |
| 580 | *(PolymorphicDowncast<const SpaceToDepthDescriptor*>(&descriptor)), |
| 581 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 582 | case LayerType::Splitter: |
| 583 | { |
| 584 | std::vector<TensorInfo> outputInfos; |
| 585 | for (uint32_t i = 1; i < infos.size(); i++) |
| 586 | { |
| 587 | outputInfos.push_back(infos[i]); |
| 588 | } |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 589 | return support.IsSplitterSupported(infos[0], |
| 590 | {outputInfos.begin(), outputInfos.end()}, |
| 591 | *(PolymorphicDowncast<const ViewsDescriptor*>(&descriptor)), |
| 592 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 593 | } |
| 594 | case LayerType::Stack: |
| 595 | { |
| 596 | std::vector<const TensorInfo*> inputInfos; |
| 597 | for (uint32_t i = 0; i < infos.size() - 1; i++) |
| 598 | { |
| 599 | inputInfos.push_back(&infos[i]); |
| 600 | } |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 601 | return support.IsStackSupported(inputInfos, |
| 602 | infos[infos.size() - 1], |
| 603 | *(PolymorphicDowncast<const StackDescriptor*>(&descriptor)), |
| 604 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 605 | } |
| 606 | case LayerType::StridedSlice: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 607 | return support.IsStridedSliceSupported(infos[0], |
| 608 | infos[1], |
| 609 | *(PolymorphicDowncast<const StridedSliceDescriptor*>(&descriptor)), |
| 610 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 611 | case LayerType::Subtraction: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 612 | return support.IsSubtractionSupported(infos[0], infos[1], infos[2], reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 613 | case LayerType::Transpose: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 614 | return support.IsTransposeSupported(infos[0], |
| 615 | infos[1], |
| 616 | *(PolymorphicDowncast<const TransposeDescriptor*>(&descriptor)), |
| 617 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 618 | case LayerType::TransposeConvolution2d: |
| 619 | { |
| 620 | if (infos.size() != 4) |
| 621 | { |
| 622 | throw InvalidArgumentException("Invalid number of TransposeConvolution2d TensorInfos. " |
| 623 | "TensorInfos should be of format: {input, output, weights, biases}."); |
| 624 | } |
| 625 | |
| 626 | auto desc = *(PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor)); |
| 627 | if (infos[3] == TensorInfo()) |
| 628 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 629 | return support.IsTransposeConvolution2dSupported(infos[0], |
| 630 | infos[1], |
| 631 | desc, |
| 632 | infos[2], |
| 633 | EmptyOptional(), |
| 634 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 635 | } |
| 636 | else |
| 637 | { |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 638 | return support.IsTransposeConvolution2dSupported(infos[0], |
| 639 | infos[1], |
| 640 | desc, |
| 641 | infos[2], |
| 642 | infos[3], |
| 643 | reasonIfUnsupported); |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 644 | } |
| 645 | } |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 646 | case LayerType::UnidirectionalSequenceLstm: |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 647 | { |
| 648 | auto desc = *(PolymorphicDowncast<const UnidirectionalSequenceLstmDescriptor*>(&descriptor)); |
| 649 | return support.IsUnidirectionalSequenceLstmSupported(infos[0], |
| 650 | infos[1], |
| 651 | infos[2], |
| 652 | infos[3], |
| 653 | infos[4], |
| 654 | infos[5], |
| 655 | desc, |
| 656 | lstmParamsInfo.value(), |
| 657 | reasonIfUnsupported); |
| 658 | } |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 659 | case LayerType::Unmap: |
| 660 | return true; |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 661 | default: |
| 662 | // layers not supported in neon by default: |
Cathal Corbett | 4952a3e | 2022-03-03 15:14:18 +0000 | [diff] [blame] | 663 | // debug, fakequantization, precompiled, |
Ryan OShea | 19e7942 | 2022-05-04 00:38:03 +0100 | [diff] [blame] | 664 | // standin, switch |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 665 | return false; |
| 666 | } |
| 667 | } |
| 668 | |
Cathal Corbett | 80f71a8 | 2022-12-20 18:25:40 +0000 | [diff] [blame] | 669 | bool NeonLayerSupport::IsLayerSupported(const LayerType& type, |
| 670 | const std::vector<TensorInfo>& infos, |
| 671 | const BaseDescriptor& descriptor, |
| 672 | const Optional<LstmInputParamsInfo>& lstmParamsInfo, |
| 673 | const Optional<QuantizedLstmInputParamsInfo>& quantizedLstmParamsInfo, |
| 674 | Optional<std::string&> reasonIfUnsupported) const |
| 675 | { |
| 676 | bool isSupported = IsLayerTypeSupported(type, |
| 677 | infos, |
| 678 | descriptor, |
| 679 | lstmParamsInfo, |
| 680 | quantizedLstmParamsInfo, |
| 681 | reasonIfUnsupported, |
| 682 | *this); |
| 683 | |
| 684 | // For android-nn-driver and support library, to run FP16 operations on CpuAcc we need at least v8.2 |
| 685 | // architecture. If the available architecture is older than v8.2, we can check if the operator is |
| 686 | // supported by changing operator inputs & outputs to be FP32. |
| 687 | // This does not change the operator datatype in the above parsers to be FP32. We are simply reporting |
| 688 | // to the parsers if the operator can supported in ArmNN. We will then re-enter ArmNN (Network.cpp) |
| 689 | // where we will recheck IsLayerSupported() on the FP16 datatype, update the operator to be FP32, |
| 690 | // and, insert convert layers around the FP32 operator. |
| 691 | if (reasonIfUnsupported.has_value()) |
| 692 | { |
| 693 | std::string checkStr = "This CPU architecture does not support F16 data type, you need v8.2 or above"; |
| 694 | if (!isSupported |
| 695 | && reasonIfUnsupported.value().find(checkStr) != std::string::npos) |
| 696 | { |
| 697 | std::vector<TensorInfo> newInfos; |
| 698 | for (auto info: infos) |
| 699 | { |
| 700 | newInfos.emplace_back(OverrideDataType(info, DataType::Float32)); |
| 701 | } |
| 702 | |
| 703 | std::string tmpString; |
| 704 | return IsLayerTypeSupported(type, |
| 705 | newInfos, |
| 706 | descriptor, |
| 707 | lstmParamsInfo, |
| 708 | quantizedLstmParamsInfo, |
| 709 | tmpString, |
| 710 | *this); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | return isSupported; |
| 715 | } |
| 716 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 717 | bool NeonLayerSupport::IsActivationSupported(const TensorInfo& input, |
| 718 | const TensorInfo& output, |
| 719 | const ActivationDescriptor& descriptor, |
| 720 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 721 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 722 | IgnoreUnused(descriptor); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 723 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonActivationWorkloadValidate, |
| 724 | reasonIfUnsupported, |
| 725 | input, |
| 726 | output, |
| 727 | descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 728 | } |
| 729 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 730 | bool NeonLayerSupport::IsAdditionSupported(const TensorInfo& input0, |
| 731 | const TensorInfo& input1, |
| 732 | const TensorInfo& output, |
| 733 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 734 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 735 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAdditionWorkloadValidate, |
| 736 | reasonIfUnsupported, |
| 737 | input0, |
| 738 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 739 | output, |
| 740 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 741 | } |
| 742 | |
James Conroy | d47a064 | 2019-09-17 14:22:06 +0100 | [diff] [blame] | 743 | bool NeonLayerSupport::IsArgMinMaxSupported(const TensorInfo& input, |
| 744 | const TensorInfo& output, |
| 745 | const ArgMinMaxDescriptor& descriptor, |
| 746 | Optional<std::string&> reasonIfUnsupported) const |
| 747 | { |
| 748 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonArgMinMaxWorkloadValidate, |
| 749 | reasonIfUnsupported, |
| 750 | input, |
| 751 | output, |
| 752 | descriptor); |
| 753 | } |
| 754 | |
Teresa Charlin | 0f86ecf | 2022-10-13 15:47:08 +0100 | [diff] [blame] | 755 | bool NeonLayerSupport::IsBatchMatMulSupported(const TensorInfo& inputX, |
| 756 | const TensorInfo& inputY, |
| 757 | const TensorInfo& output, |
| 758 | const BatchMatMulDescriptor& descriptor, |
| 759 | Optional<std::string&> reasonIfUnsupported) const |
| 760 | { |
| 761 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonBatchMatMulValidate, |
| 762 | reasonIfUnsupported, |
| 763 | inputX, |
| 764 | inputY, |
| 765 | output, |
| 766 | descriptor); |
| 767 | } |
| 768 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 769 | bool NeonLayerSupport::IsBatchNormalizationSupported(const TensorInfo& input, |
| 770 | const TensorInfo& output, |
| 771 | const TensorInfo& mean, |
| 772 | const TensorInfo& var, |
| 773 | const TensorInfo& beta, |
| 774 | const TensorInfo& gamma, |
| 775 | const BatchNormalizationDescriptor& descriptor, |
| 776 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 777 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 778 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonBatchNormalizationValidate, |
| 779 | reasonIfUnsupported, |
| 780 | input, |
| 781 | output, |
| 782 | mean, |
| 783 | var, |
| 784 | beta, |
| 785 | gamma, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 786 | descriptor, |
| 787 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 788 | } |
| 789 | |
Mike Kelly | 5685802 | 2020-01-27 12:14:47 +0000 | [diff] [blame] | 790 | bool NeonLayerSupport::IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 791 | const TensorInfo& output, |
| 792 | const BatchToSpaceNdDescriptor& descriptor, |
| 793 | Optional<std::string&> reasonIfUnsupported) const |
| 794 | { |
| 795 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonBatchToSpaceNdWorkloadValidate, |
| 796 | reasonIfUnsupported, |
| 797 | input, |
| 798 | output, |
| 799 | descriptor); |
| 800 | } |
| 801 | |
Sadik Armagan | 48f011e | 2021-04-21 10:50:34 +0100 | [diff] [blame] | 802 | bool NeonLayerSupport::IsCastSupported(const TensorInfo& input, |
| 803 | const TensorInfo& output, |
| 804 | Optional<std::string&> reasonIfUnsupported) const |
| 805 | { |
| 806 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonCastValidate, |
| 807 | reasonIfUnsupported, |
| 808 | input, |
| 809 | output); |
| 810 | } |
| 811 | |
Teresa Charlin | e89dd69 | 2021-09-01 16:30:34 +0100 | [diff] [blame] | 812 | bool NeonLayerSupport::IsChannelShuffleSupported(const TensorInfo& input, |
| 813 | const TensorInfo& output, |
| 814 | const ChannelShuffleDescriptor& descriptor, |
| 815 | Optional<std::string&> reasonIfUnsupported) const |
| 816 | { |
| 817 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonChannelShuffleValidate, |
| 818 | reasonIfUnsupported, |
| 819 | input, |
| 820 | output, |
| 821 | descriptor); |
| 822 | } |
| 823 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 824 | bool NeonLayerSupport::IsComparisonSupported(const TensorInfo& input0, |
| 825 | const TensorInfo& input1, |
| 826 | const TensorInfo& output, |
| 827 | const ComparisonDescriptor& descriptor, |
| 828 | Optional<std::string&> reasonIfUnsupported) const |
| 829 | { |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 830 | |
Teresa Charlin | cedd34f | 2020-03-30 11:17:30 +0100 | [diff] [blame] | 831 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonComparisonWorkloadValidate, |
| 832 | reasonIfUnsupported, |
| 833 | input0, |
| 834 | input1, |
| 835 | output, |
| 836 | descriptor); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 837 | } |
| 838 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 839 | bool NeonLayerSupport::IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 840 | const TensorInfo& output, |
Cathal Corbett | 34b429c | 2021-12-24 12:24:40 +0000 | [diff] [blame] | 841 | const OriginsDescriptor& descriptor, |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 842 | Optional<std::string&> reasonIfUnsupported) const |
| 843 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 844 | if (descriptor.GetNumDimensions() <= descriptor.GetConcatAxis()) |
| 845 | { |
| 846 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Concat axis > Number of dimensions."); |
| 847 | return false; |
| 848 | } |
| 849 | |
| 850 | unsigned int concatInnerAxis = (descriptor.GetNumDimensions() - descriptor.GetConcatAxis()) - 1; |
| 851 | if(concatInnerAxis < 3) // Width, height, or channels |
| 852 | { |
| 853 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConcatWorkloadValidate, |
| 854 | reasonIfUnsupported, |
| 855 | inputs, |
| 856 | output, |
| 857 | descriptor); |
| 858 | } |
| 859 | else if (concatInnerAxis == 3) |
| 860 | { |
| 861 | for (auto& input : inputs) |
| 862 | { |
| 863 | if (input && !output.IsTypeSpaceMatch(*input)) // Cannot use sub-tensors if the types are not same space |
| 864 | { |
| 865 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Types and quantization parameters must match."); |
| 866 | return false; |
| 867 | } |
| 868 | } |
| 869 | return true; // Sub-tensors support concat along batch |
| 870 | } |
| 871 | else // > 4 dimensions not supported. |
| 872 | { |
| 873 | SetValueChecked(reasonIfUnsupported, "Neon Concat: Maximum of 4 dimensions supported."); |
| 874 | return false; |
| 875 | } |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 876 | } |
| 877 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 878 | bool NeonLayerSupport::IsConstantSupported(const TensorInfo& output, |
| 879 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 880 | { |
Mike Kelly | 0886ac4 | 2020-04-27 09:55:40 +0100 | [diff] [blame] | 881 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConstantWorkloadValidate, |
| 882 | reasonIfUnsupported, |
| 883 | output); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 884 | } |
| 885 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 886 | bool NeonLayerSupport::IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 887 | const TensorInfo& output, |
| 888 | Optional<std::string&> reasonIfUnsupported) const |
| 889 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 890 | armnn::IgnoreUnused(input); |
| 891 | armnn::IgnoreUnused(output); |
| 892 | armnn::IgnoreUnused(reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 893 | return true; |
| 894 | } |
| 895 | |
| 896 | bool NeonLayerSupport::IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 897 | const TensorInfo& output, |
| 898 | Optional<std::string&> reasonIfUnsupported) const |
| 899 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 900 | armnn::IgnoreUnused(input); |
| 901 | armnn::IgnoreUnused(output); |
| 902 | armnn::IgnoreUnused(reasonIfUnsupported); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 903 | return true; |
| 904 | } |
| 905 | |
| 906 | bool NeonLayerSupport::IsConvolution2dSupported(const TensorInfo& input, |
| 907 | const TensorInfo& output, |
| 908 | const Convolution2dDescriptor& descriptor, |
| 909 | const TensorInfo& weights, |
| 910 | const Optional<TensorInfo>& biases, |
| 911 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 912 | { |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 913 | bool isFastMathEnabled = false; |
| 914 | #if defined(ARMCOMPUTENEON_ENABLED) |
| 915 | if (m_ModelContextPtr) |
| 916 | { |
| 917 | if (m_ModelContextPtr.get() != nullptr) |
| 918 | { |
Sadik Armagan | 04a7297 | 2020-09-14 15:44:18 +0100 | [diff] [blame] | 919 | auto modelOptions = dynamic_cast<NeonBackendModelContext*>(m_ModelContextPtr.get()); |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 920 | if (modelOptions) |
| 921 | { |
| 922 | isFastMathEnabled = modelOptions->IsFastMathEnabled(); |
| 923 | } |
| 924 | } |
| 925 | } |
| 926 | #endif |
| 927 | |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 928 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConvolution2dWorkloadValidate, |
| 929 | reasonIfUnsupported, |
| 930 | input, |
| 931 | output, |
| 932 | descriptor, |
| 933 | weights, |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 934 | biases, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 935 | isFastMathEnabled, |
| 936 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 937 | } |
| 938 | |
Teresa Charlin | ec5f7d1 | 2021-10-22 17:15:00 +0100 | [diff] [blame] | 939 | bool NeonLayerSupport::IsConvolution3dSupported(const TensorInfo& input, |
| 940 | const TensorInfo& output, |
| 941 | const Convolution3dDescriptor& descriptor, |
| 942 | const TensorInfo& weights, |
| 943 | const Optional<TensorInfo>& biases, |
| 944 | Optional<std::string&> reasonIfUnsupported) const |
| 945 | { |
| 946 | bool isFastMathEnabled = false; |
| 947 | #if defined(ARMCOMPUTENEON_ENABLED) |
| 948 | if (m_ModelContextPtr) |
| 949 | { |
| 950 | if (m_ModelContextPtr.get() != nullptr) |
| 951 | { |
| 952 | auto modelOptions = dynamic_cast<NeonBackendModelContext*>(m_ModelContextPtr.get()); |
| 953 | if (modelOptions) |
| 954 | { |
| 955 | isFastMathEnabled = modelOptions->IsFastMathEnabled(); |
| 956 | } |
| 957 | } |
| 958 | } |
| 959 | #endif |
| 960 | |
| 961 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConvolution3dWorkloadValidate, |
| 962 | reasonIfUnsupported, |
| 963 | input, |
| 964 | output, |
| 965 | descriptor, |
| 966 | weights, |
| 967 | biases, |
| 968 | isFastMathEnabled, |
| 969 | nullptr); |
| 970 | } |
| 971 | |
Aron Virginas-Tar | 2f00b74 | 2019-09-30 13:28:08 +0100 | [diff] [blame] | 972 | bool NeonLayerSupport::IsDepthToSpaceSupported(const TensorInfo& input, |
| 973 | const TensorInfo& output, |
| 974 | const DepthToSpaceDescriptor& descriptor, |
| 975 | Optional<std::string&> reasonIfUnsupported) const |
| 976 | { |
| 977 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthToSpaceWorkloadValidate, |
| 978 | reasonIfUnsupported, |
| 979 | input, |
| 980 | output, |
| 981 | descriptor); |
| 982 | } |
| 983 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 984 | bool NeonLayerSupport::IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 985 | const TensorInfo& output, |
| 986 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 987 | const TensorInfo& weights, |
| 988 | const Optional<TensorInfo>& biases, |
| 989 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 990 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 991 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate, |
| 992 | reasonIfUnsupported, |
| 993 | input, |
| 994 | output, |
| 995 | descriptor, |
| 996 | weights, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 997 | biases, |
| 998 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 999 | } |
| 1000 | |
Narumol Prangnawarat | 01961a7 | 2019-05-30 16:47:12 +0100 | [diff] [blame] | 1001 | bool NeonLayerSupport::IsDequantizeSupported(const TensorInfo& input, |
| 1002 | const TensorInfo& output, |
| 1003 | Optional<std::string&> reasonIfUnsupported) const |
| 1004 | { |
| 1005 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDequantizeWorkloadValidate, |
| 1006 | reasonIfUnsupported, |
| 1007 | input, |
| 1008 | output); |
| 1009 | } |
| 1010 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 1011 | bool NeonLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 1012 | const TensorInfo& output, |
| 1013 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 1014 | const TensorInfo& weights, |
| 1015 | const Optional<TensorInfo>& biases, |
| 1016 | Optional<std::string&> reasonIfUnsupported) const |
| 1017 | { |
| 1018 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate, |
| 1019 | reasonIfUnsupported, |
| 1020 | input, |
| 1021 | output, |
| 1022 | descriptor, |
| 1023 | weights, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1024 | biases, |
| 1025 | nullptr); |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 1026 | } |
| 1027 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 1028 | bool NeonLayerSupport::IsElementwiseUnarySupported(const TensorInfo& input, |
| 1029 | const TensorInfo& output, |
| 1030 | const ElementwiseUnaryDescriptor& descriptor, |
| 1031 | Optional<std::string&> reasonIfUnsupported) const |
| 1032 | { |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 1033 | switch(descriptor.m_Operation) |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 1034 | { |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 1035 | case UnaryOperation::Abs: |
| 1036 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAbsWorkloadValidate, |
| 1037 | reasonIfUnsupported, |
| 1038 | input, |
| 1039 | output); |
| 1040 | case UnaryOperation::Exp: |
| 1041 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonExpWorkloadValidate, |
| 1042 | reasonIfUnsupported, |
| 1043 | input, |
| 1044 | output); |
Teresa Charlin | 50de4fa | 2021-05-31 18:47:33 +0100 | [diff] [blame] | 1045 | case UnaryOperation::LogicalNot: |
| 1046 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogicalNotWorkloadValidate, |
| 1047 | reasonIfUnsupported, |
| 1048 | input, |
| 1049 | output); |
| 1050 | case UnaryOperation::Log: |
| 1051 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogWorkloadValidate, |
| 1052 | reasonIfUnsupported, |
| 1053 | input, |
| 1054 | output); |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 1055 | case UnaryOperation::Neg: |
| 1056 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonNegWorkloadValidate, |
| 1057 | reasonIfUnsupported, |
| 1058 | input, |
| 1059 | output); |
| 1060 | case UnaryOperation::Rsqrt: |
| 1061 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonRsqrtWorkloadValidate, |
| 1062 | reasonIfUnsupported, |
| 1063 | input, |
| 1064 | output); |
ryan.oshea3 | cff135b | 2021-10-07 15:28:14 +0000 | [diff] [blame] | 1065 | case UnaryOperation::Sin: |
| 1066 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSinWorkloadValidate, |
| 1067 | reasonIfUnsupported, |
| 1068 | input, |
| 1069 | output); |
Teresa Charlin | 06145cc | 2022-05-05 15:31:30 +0100 | [diff] [blame] | 1070 | case UnaryOperation::Sqrt: |
| 1071 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSqrtWorkloadValidate, |
| 1072 | reasonIfUnsupported, |
| 1073 | input, |
| 1074 | output); |
Derek Lamberti | c77874a | 2020-04-28 13:34:56 +0100 | [diff] [blame] | 1075 | default: |
| 1076 | return false; |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 1077 | } |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 1078 | } |
| 1079 | |
Teresa Charlin | 4b10fef | 2020-07-29 09:36:41 +0100 | [diff] [blame] | 1080 | bool NeonLayerSupport::IsFillSupported(const TensorInfo& input, |
| 1081 | const TensorInfo& output, |
| 1082 | const FillDescriptor& descriptor, |
| 1083 | Optional<std::string&> reasonIfUnsupported) const |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 1084 | { |
Teresa Charlin | 4b10fef | 2020-07-29 09:36:41 +0100 | [diff] [blame] | 1085 | armnn::IgnoreUnused(input); |
| 1086 | armnn::IgnoreUnused(output); |
| 1087 | armnn::IgnoreUnused(descriptor); |
| 1088 | |
| 1089 | return IsNeonBackendSupported(reasonIfUnsupported); |
Sadik Armagan | a792a05 | 2020-06-23 16:22:23 +0100 | [diff] [blame] | 1090 | } |
| 1091 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1092 | bool NeonLayerSupport::IsFloorSupported(const TensorInfo& input, |
| 1093 | const TensorInfo& output, |
| 1094 | Optional<std::string&> reasonIfUnsupported) const |
| 1095 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 1096 | armnn::IgnoreUnused(output); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1097 | return IsNeonBackendSupported(reasonIfUnsupported) && |
| 1098 | IsSupportedForDataTypeGeneric(reasonIfUnsupported, |
| 1099 | input.GetDataType(), |
| 1100 | &FalseFuncF16<>, |
| 1101 | &TrueFunc<>, |
narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 1102 | &FalseFuncU8<>, |
kevmay01 | 2b4d88e | 2019-01-24 14:05:09 +0000 | [diff] [blame] | 1103 | &FalseFuncI32<>, |
| 1104 | &FalseFuncU8<>); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1105 | } |
| 1106 | |
| 1107 | bool NeonLayerSupport::IsFullyConnectedSupported(const TensorInfo& input, |
| 1108 | const TensorInfo& output, |
| 1109 | const TensorInfo& weights, |
| 1110 | const TensorInfo& biases, |
| 1111 | const FullyConnectedDescriptor& descriptor, |
| 1112 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1113 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1114 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonFullyConnectedWorkloadValidate, |
| 1115 | reasonIfUnsupported, |
| 1116 | input, |
| 1117 | output, |
| 1118 | weights, |
| 1119 | biases, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1120 | descriptor, |
| 1121 | nullptr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1122 | } |
| 1123 | |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 1124 | bool NeonLayerSupport::IsGatherSupported(const TensorInfo& input0, |
| 1125 | const TensorInfo& input1, |
| 1126 | const TensorInfo& output, |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 1127 | const GatherDescriptor& descriptor, |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 1128 | Optional<std::string&> reasonIfUnsupported) const |
| 1129 | { |
| 1130 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonGatherWorkloadValidate, |
| 1131 | reasonIfUnsupported, |
| 1132 | input0, |
| 1133 | input1, |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 1134 | output, |
| 1135 | descriptor); |
Teresa Charlin | f540eb8 | 2020-04-10 19:24:55 +0100 | [diff] [blame] | 1136 | } |
| 1137 | |
Teresa Charlin | bd22c7d | 2022-04-26 18:14:12 +0100 | [diff] [blame] | 1138 | bool NeonLayerSupport::IsGatherNdSupported(const TensorInfo& input0, |
| 1139 | const TensorInfo& input1, |
| 1140 | const TensorInfo& output, |
| 1141 | Optional<std::string&> reasonIfUnsupported) const |
| 1142 | { |
| 1143 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonGatherNdWorkloadValidate, |
| 1144 | reasonIfUnsupported, |
| 1145 | input0, |
| 1146 | input1, |
| 1147 | output); |
| 1148 | } |
| 1149 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1150 | bool NeonLayerSupport::IsInputSupported(const TensorInfo& input, |
| 1151 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1152 | { |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1153 | return IsNeonBackendSupported(reasonIfUnsupported, input); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1154 | } |
| 1155 | |
Sadik Armagan | 0d4863d | 2019-10-09 14:26:32 +0100 | [diff] [blame] | 1156 | bool NeonLayerSupport::IsInstanceNormalizationSupported(const TensorInfo& input, |
| 1157 | const TensorInfo& output, |
| 1158 | const InstanceNormalizationDescriptor& descriptor, |
| 1159 | Optional<std::string&> reasonIfUnsupported) const |
| 1160 | { |
| 1161 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonInstanceNormalizationWorkloadValidate, |
| 1162 | reasonIfUnsupported, |
| 1163 | input, |
| 1164 | output, |
| 1165 | descriptor); |
| 1166 | } |
| 1167 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1168 | bool NeonLayerSupport::IsL2NormalizationSupported(const TensorInfo& input, |
| 1169 | const TensorInfo& output, |
| 1170 | const L2NormalizationDescriptor& descriptor, |
| 1171 | Optional<std::string&> reasonIfUnsupported) const |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1172 | { |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 1173 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonL2NormalizationWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1174 | } |
| 1175 | |
James Conroy | 177df1e | 2020-11-13 10:18:51 +0000 | [diff] [blame] | 1176 | bool NeonLayerSupport::IsLogicalBinarySupported(const TensorInfo& input0, |
| 1177 | const TensorInfo& input1, |
| 1178 | const TensorInfo& output, |
| 1179 | const LogicalBinaryDescriptor& descriptor, |
| 1180 | Optional<std::string&> reasonIfUnsupported) const |
| 1181 | { |
| 1182 | switch(descriptor.m_Operation) |
| 1183 | { |
| 1184 | case LogicalBinaryOperation::LogicalAnd: |
| 1185 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogicalAndWorkloadValidate, |
| 1186 | reasonIfUnsupported, |
| 1187 | input0, |
| 1188 | input1, |
| 1189 | output); |
| 1190 | case LogicalBinaryOperation::LogicalOr: |
| 1191 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogicalOrWorkloadValidate, |
| 1192 | reasonIfUnsupported, |
| 1193 | input0, |
| 1194 | input1, |
| 1195 | output); |
| 1196 | default: |
| 1197 | return false; |
| 1198 | } |
| 1199 | } |
| 1200 | |
Keith Davis | 69e653f | 2020-07-02 11:49:26 +0100 | [diff] [blame] | 1201 | bool NeonLayerSupport::IsLogSoftmaxSupported(const TensorInfo& input, |
| 1202 | const TensorInfo& output, |
| 1203 | const LogSoftmaxDescriptor& descriptor, |
| 1204 | Optional<std::string&> reasonIfUnsupported) const |
| 1205 | { |
| 1206 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLogSoftmaxWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 1207 | } |
| 1208 | |
Jan Eilers | ad5293a | 2019-07-08 09:57:55 +0100 | [diff] [blame] | 1209 | bool NeonLayerSupport::IsLstmSupported(const TensorInfo& input, |
| 1210 | const TensorInfo& outputStateIn, |
| 1211 | const TensorInfo& cellStateIn, |
| 1212 | const TensorInfo& scratchBuffer, |
| 1213 | const TensorInfo& outputStateOut, |
| 1214 | const TensorInfo& cellStateOut, |
| 1215 | const TensorInfo& output, |
| 1216 | const LstmDescriptor& descriptor, |
| 1217 | const LstmInputParamsInfo& paramsInfo, |
| 1218 | Optional<std::string&> reasonIfUnsupported) const |
| 1219 | { |
| 1220 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonLstmFloatWorkloadValidate, |
| 1221 | reasonIfUnsupported, |
| 1222 | input, |
| 1223 | outputStateIn, |
| 1224 | cellStateIn, |
| 1225 | scratchBuffer, |
| 1226 | outputStateOut, |
| 1227 | cellStateOut, |
| 1228 | output, |
| 1229 | descriptor, |
| 1230 | paramsInfo); |
| 1231 | } |
| 1232 | |
Nattapat Chaimanowong | 4e6597a | 2018-12-20 14:14:06 +0000 | [diff] [blame] | 1233 | bool NeonLayerSupport::IsMaximumSupported(const TensorInfo& input0, |
| 1234 | const TensorInfo& input1, |
| 1235 | const TensorInfo& output, |
| 1236 | Optional<std::string&> reasonIfUnsupported) const |
| 1237 | { |
| 1238 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMaximumWorkloadValidate, |
| 1239 | reasonIfUnsupported, |
| 1240 | input0, |
| 1241 | input1, |
| 1242 | output); |
| 1243 | } |
| 1244 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1245 | bool NeonLayerSupport::IsMeanSupported(const TensorInfo& input, |
| 1246 | const TensorInfo& output, |
| 1247 | const MeanDescriptor& descriptor, |
| 1248 | Optional<std::string&> reasonIfUnsupported) const |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1249 | { |
Matthew Bentham | fd89996 | 2018-12-31 15:49:42 +0000 | [diff] [blame] | 1250 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMeanWorkloadValidate, |
| 1251 | reasonIfUnsupported, |
| 1252 | input, |
| 1253 | output, |
| 1254 | descriptor); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1255 | } |
| 1256 | |
Conor Kennedy | 54b2169 | 2019-01-09 07:57:38 +0000 | [diff] [blame] | 1257 | bool NeonLayerSupport::IsMinimumSupported(const TensorInfo& input0, |
| 1258 | const TensorInfo& input1, |
| 1259 | const TensorInfo& output, |
| 1260 | Optional<std::string&> reasonIfUnsupported) const |
| 1261 | { |
| 1262 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMinimumWorkloadValidate, |
| 1263 | reasonIfUnsupported, |
| 1264 | input0, |
| 1265 | input1, |
| 1266 | output); |
| 1267 | } |
| 1268 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1269 | bool NeonLayerSupport::IsMultiplicationSupported(const TensorInfo& input0, |
| 1270 | const TensorInfo& input1, |
| 1271 | const TensorInfo& output, |
| 1272 | Optional<std::string&> reasonIfUnsupported) const |
| 1273 | { |
| 1274 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonMultiplicationWorkloadValidate, |
| 1275 | reasonIfUnsupported, |
| 1276 | input0, |
| 1277 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1278 | output, |
| 1279 | nullptr); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1280 | } |
| 1281 | |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 1282 | bool NeonLayerSupport::IsDivisionSupported(const TensorInfo& input0, |
| 1283 | const TensorInfo& input1, |
| 1284 | const TensorInfo& output, |
| 1285 | Optional<std::string&> reasonIfUnsupported) const |
| 1286 | { |
| 1287 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDivisionWorkloadValidate, |
| 1288 | reasonIfUnsupported, |
| 1289 | input0, |
| 1290 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1291 | output, |
| 1292 | nullptr); |
Pablo Tello | e61f071 | 2020-01-23 10:37:17 +0000 | [diff] [blame] | 1293 | } |
| 1294 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1295 | bool NeonLayerSupport::IsNormalizationSupported(const TensorInfo& input, |
| 1296 | const TensorInfo& output, |
| 1297 | const NormalizationDescriptor& descriptor, |
| 1298 | Optional<std::string&> reasonIfUnsupported) const |
| 1299 | { |
| 1300 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonNormalizationWorkloadValidate, |
| 1301 | reasonIfUnsupported, |
| 1302 | input, |
| 1303 | output, |
| 1304 | descriptor); |
| 1305 | } |
| 1306 | |
| 1307 | bool NeonLayerSupport::IsOutputSupported(const TensorInfo& output, |
| 1308 | Optional<std::string&> reasonIfUnsupported) const |
| 1309 | { |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1310 | return IsNeonBackendSupported(reasonIfUnsupported, output); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1311 | } |
| 1312 | |
Éanna Ó Catháin | 1205574 | 2019-01-25 10:01:40 +0000 | [diff] [blame] | 1313 | bool NeonLayerSupport::IsPadSupported(const TensorInfo& input, |
| 1314 | const TensorInfo& output, |
| 1315 | const PadDescriptor& descriptor, |
| 1316 | Optional<std::string&> reasonIfUnsupported) const |
| 1317 | { |
| 1318 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPadWorkloadValidate, |
| 1319 | reasonIfUnsupported, |
| 1320 | input, |
| 1321 | output, |
| 1322 | descriptor); |
| 1323 | } |
| 1324 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1325 | bool NeonLayerSupport::IsPermuteSupported(const TensorInfo& input, |
| 1326 | const TensorInfo& output, |
| 1327 | const PermuteDescriptor& descriptor, |
| 1328 | Optional<std::string&> reasonIfUnsupported) const |
| 1329 | { |
| 1330 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPermuteWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1331 | } |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1332 | |
| 1333 | bool NeonLayerSupport::IsPooling2dSupported(const TensorInfo& input, |
| 1334 | const TensorInfo& output, |
| 1335 | const Pooling2dDescriptor& descriptor, |
| 1336 | Optional<std::string&> reasonIfUnsupported) const |
| 1337 | { |
| 1338 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPooling2dWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 1339 | } |
| 1340 | |
Ryan OShea | 19e7942 | 2022-05-04 00:38:03 +0100 | [diff] [blame] | 1341 | bool NeonLayerSupport::IsPooling3dSupported(const TensorInfo& input, |
| 1342 | const TensorInfo& output, |
| 1343 | const Pooling3dDescriptor& descriptor, |
| 1344 | Optional<std::string&> reasonIfUnsupported) const |
| 1345 | { |
| 1346 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPooling3dWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 1347 | } |
| 1348 | |
Nikhil Raj | 9b46148 | 2019-07-03 15:58:31 +0100 | [diff] [blame] | 1349 | bool NeonLayerSupport::IsPreluSupported(const armnn::TensorInfo &input, |
| 1350 | const armnn::TensorInfo &alpha, |
| 1351 | const armnn::TensorInfo &output, |
| 1352 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 1353 | { |
| 1354 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPreluWorkloadValidate, reasonIfUnsupported, input, alpha, output); |
| 1355 | } |
| 1356 | |
James Conroy | cc34093 | 2020-05-12 18:08:52 +0100 | [diff] [blame] | 1357 | bool NeonLayerSupport::IsQLstmSupported(const TensorInfo& input, |
| 1358 | const TensorInfo& previousOutputIn, |
| 1359 | const TensorInfo& previousCellStateIn, |
| 1360 | const TensorInfo& outputStateOut, |
| 1361 | const TensorInfo& cellStateOut, |
| 1362 | const TensorInfo& output, |
| 1363 | const QLstmDescriptor& descriptor, |
| 1364 | const LstmInputParamsInfo& paramsInfo, |
| 1365 | Optional<std::string&> reasonIfUnsupported) const |
| 1366 | { |
| 1367 | // Check required here in order to pass IsLayerSupported for datatypes tests |
| 1368 | if (input.GetDataType() == armnn::DataType::QAsymmS8 && |
| 1369 | previousOutputIn.GetDataType() == armnn::DataType::QAsymmS8 && |
| 1370 | previousCellStateIn.GetDataType() == armnn::DataType::QSymmS16 && |
| 1371 | outputStateOut.GetDataType() == armnn::DataType::QAsymmS8 && |
| 1372 | cellStateOut.GetDataType() == armnn::DataType::QSymmS16 && |
| 1373 | output.GetDataType() == armnn::DataType::QAsymmS8) |
| 1374 | { |
| 1375 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQLstmWorkloadValidate, |
| 1376 | reasonIfUnsupported, |
| 1377 | input, |
| 1378 | previousCellStateIn, |
| 1379 | previousOutputIn, |
| 1380 | cellStateOut, |
| 1381 | outputStateOut, |
| 1382 | output, |
| 1383 | descriptor, |
| 1384 | paramsInfo); |
| 1385 | } |
| 1386 | else |
| 1387 | { |
| 1388 | return false; |
| 1389 | } |
| 1390 | } |
| 1391 | |
Sadik Armagan | fabc289 | 2019-05-31 09:05:11 +0100 | [diff] [blame] | 1392 | bool NeonLayerSupport::IsQuantizeSupported(const TensorInfo& input, |
| 1393 | const TensorInfo& output, |
| 1394 | Optional<std::string&> reasonIfUnsupported) const |
| 1395 | { |
| 1396 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQuantizeWorkloadValidate, |
| 1397 | reasonIfUnsupported, |
| 1398 | input, |
| 1399 | output); |
| 1400 | } |
| 1401 | |
Francis Murtagh | 4fc3c48 | 2019-08-02 13:20:54 +0100 | [diff] [blame] | 1402 | bool NeonLayerSupport::IsQuantizedLstmSupported(const TensorInfo& input, |
| 1403 | const TensorInfo& cellStateIn, |
| 1404 | const TensorInfo& outputStateIn, |
| 1405 | const TensorInfo& cellStateOut, |
| 1406 | const TensorInfo& outputStateOut, |
| 1407 | const QuantizedLstmInputParamsInfo& paramsInfo, |
| 1408 | Optional<std::string&> reasonIfUnsupported) const |
| 1409 | { |
| 1410 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonQuantizedLstmWorkloadValidate, |
| 1411 | reasonIfUnsupported, |
| 1412 | input, |
| 1413 | cellStateIn, |
| 1414 | outputStateIn, |
| 1415 | cellStateOut, |
| 1416 | outputStateOut, |
| 1417 | paramsInfo); |
| 1418 | } |
| 1419 | |
Sadik Armagan | a274748 | 2021-02-09 10:28:54 +0000 | [diff] [blame] | 1420 | bool NeonLayerSupport::IsReduceSupported(const TensorInfo& input, |
| 1421 | const TensorInfo& output, |
| 1422 | const ReduceDescriptor& descriptor, |
| 1423 | Optional<std::string&> reasonIfUnsupported) const |
| 1424 | { |
| 1425 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonReduceWorkloadValidate, |
| 1426 | reasonIfUnsupported, |
| 1427 | input, |
| 1428 | output, |
| 1429 | descriptor); |
| 1430 | } |
| 1431 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1432 | bool NeonLayerSupport::IsReshapeSupported(const TensorInfo& input, |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 1433 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 1434 | const ReshapeDescriptor& descriptor, |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1435 | Optional<std::string&> reasonIfUnsupported) const |
| 1436 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 1437 | armnn::IgnoreUnused(descriptor); |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 1438 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonReshapeWorkloadValidate, |
| 1439 | reasonIfUnsupported, |
| 1440 | input, |
| 1441 | output); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1442 | } |
| 1443 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 1444 | bool NeonLayerSupport::IsResizeSupported(const TensorInfo& input, |
| 1445 | const TensorInfo& output, |
| 1446 | const ResizeDescriptor& descriptor, |
| 1447 | Optional<std::string&> reasonIfUnsupported) const |
| 1448 | { |
Ellen Norris-Thompson | 37e6868 | 2019-07-15 14:23:30 +0100 | [diff] [blame] | 1449 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonResizeWorkloadValidate, |
| 1450 | reasonIfUnsupported, |
| 1451 | input, |
| 1452 | output, |
| 1453 | descriptor); |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 1454 | } |
| 1455 | |
josh minor | 036f02d | 2019-11-15 14:53:22 -0600 | [diff] [blame] | 1456 | bool NeonLayerSupport::IsSliceSupported(const TensorInfo& input, |
| 1457 | const TensorInfo& output, |
| 1458 | const SliceDescriptor& descriptor, |
| 1459 | Optional<std::string&> reasonIfUnsupported) const |
| 1460 | { |
| 1461 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSliceWorkloadValidate, |
| 1462 | reasonIfUnsupported, |
| 1463 | input, |
| 1464 | output, |
| 1465 | descriptor); |
| 1466 | } |
| 1467 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1468 | bool NeonLayerSupport::IsSoftmaxSupported(const TensorInfo& input, |
| 1469 | const TensorInfo& output, |
| 1470 | const SoftmaxDescriptor& descriptor, |
| 1471 | Optional<std::string&> reasonIfUnsupported) const |
| 1472 | { |
| 1473 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSoftmaxWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 1474 | } |
| 1475 | |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 1476 | bool NeonLayerSupport::IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 1477 | const TensorInfo& output, |
| 1478 | const SpaceToBatchNdDescriptor& descriptor, |
| 1479 | Optional<std::string&> reasonIfUnsupported) const |
| 1480 | { |
| 1481 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSpaceToBatchNdWorkloadValidate, |
| 1482 | reasonIfUnsupported, |
| 1483 | input, |
| 1484 | output, |
| 1485 | descriptor); |
| 1486 | } |
| 1487 | |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 1488 | bool NeonLayerSupport::IsSpaceToDepthSupported(const TensorInfo& input, |
Mike Kelly | 0be3a88 | 2020-01-24 11:27:50 +0000 | [diff] [blame] | 1489 | const TensorInfo& output, |
| 1490 | const SpaceToDepthDescriptor& descriptor, |
| 1491 | Optional<std::string&> reasonIfUnsupported) const |
Ellen Norris-Thompson | 2979457 | 2019-06-26 16:40:36 +0100 | [diff] [blame] | 1492 | { |
| 1493 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSpaceToDepthWorkloadValidate, |
| 1494 | reasonIfUnsupported, |
| 1495 | input, |
| 1496 | output, |
| 1497 | descriptor); |
| 1498 | } |
| 1499 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1500 | bool NeonLayerSupport::IsSplitterSupported(const TensorInfo& input, |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1501 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 1502 | const ViewsDescriptor& descriptor, |
| 1503 | Optional<std::string&> reasonIfUnsupported) const |
| 1504 | { |
| 1505 | #if defined(ARMCOMPUTENEON_ENABLED) |
| 1506 | // Split along the last dimension, cannot use sub-tensors |
| 1507 | // as width and height of the sub-tensors do not match |
| 1508 | // the width and height of the parent tensor |
| 1509 | // in case of input with more than 2D. |
| 1510 | std::set<unsigned int> splitAxis = ComputeSplitAxis(descriptor, input.GetShape()); |
| 1511 | if (descriptor.GetNumDimensions() > 2 && splitAxis.size() == 1 && |
| 1512 | *splitAxis.begin() == descriptor.GetNumDimensions() - 1 ) |
| 1513 | { |
| 1514 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSplitterWorkloadValidate, |
| 1515 | reasonIfUnsupported, |
| 1516 | input, |
| 1517 | outputs, |
| 1518 | *splitAxis.begin()); |
| 1519 | } |
| 1520 | #endif |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 1521 | IgnoreUnused(descriptor); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1522 | for (auto output : outputs) |
| 1523 | { |
| 1524 | if (!input.IsTypeSpaceMatch(output)) // Cannot use sub-tensors if the types are not same space |
| 1525 | { |
| 1526 | SetValueChecked(reasonIfUnsupported, "Neon Splitter: Types and quantization parameters must match."); |
| 1527 | return false; |
| 1528 | } |
| 1529 | } |
| 1530 | return true; |
| 1531 | } |
| 1532 | |
Matthew Jackson | 87f65ea | 2019-08-01 10:01:34 +0100 | [diff] [blame] | 1533 | bool NeonLayerSupport::IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
| 1534 | const TensorInfo& output, |
| 1535 | const StackDescriptor& descriptor, |
| 1536 | Optional<std::string&> reasonIfUnsupported) const |
| 1537 | { |
| 1538 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonStackWorkloadValidate, |
| 1539 | reasonIfUnsupported, |
| 1540 | inputs, |
| 1541 | output, |
| 1542 | descriptor); |
| 1543 | } |
| 1544 | |
FinnWilliamsArm | 1fa1919 | 2019-08-02 17:26:31 +0100 | [diff] [blame] | 1545 | bool NeonLayerSupport::IsStridedSliceSupported(const TensorInfo& input, |
| 1546 | const TensorInfo& output, |
| 1547 | const StridedSliceDescriptor& descriptor, |
| 1548 | Optional<std::string&> reasonIfUnsupported) const |
| 1549 | { |
| 1550 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonStridedSliceWorkloadValidate, |
| 1551 | reasonIfUnsupported, |
| 1552 | input, |
| 1553 | output, |
| 1554 | descriptor); |
| 1555 | } |
| 1556 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1557 | bool NeonLayerSupport::IsSubtractionSupported(const TensorInfo& input0, |
| 1558 | const TensorInfo& input1, |
| 1559 | const TensorInfo& output, |
| 1560 | Optional<std::string&> reasonIfUnsupported) const |
| 1561 | { |
| 1562 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSubtractionWorkloadValidate, |
| 1563 | reasonIfUnsupported, |
| 1564 | input0, |
| 1565 | input1, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1566 | output, |
| 1567 | nullptr); |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1568 | } |
| 1569 | |
Sadik Armagan | 581742d | 2019-08-12 14:11:37 +0100 | [diff] [blame] | 1570 | bool NeonLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input, |
| 1571 | const TensorInfo& output, |
| 1572 | const TransposeConvolution2dDescriptor& descriptor, |
| 1573 | const TensorInfo& weights, |
| 1574 | const Optional<TensorInfo>& biases, |
| 1575 | Optional<std::string&> reasonIfUnsupported) const |
| 1576 | { |
| 1577 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeConvolution2dWorkloadValidate, |
| 1578 | reasonIfUnsupported, |
| 1579 | input, |
| 1580 | output, |
| 1581 | descriptor, |
| 1582 | weights, |
| 1583 | biases); |
| 1584 | } |
| 1585 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1586 | bool NeonLayerSupport::IsTransposeSupported(const TensorInfo& input, |
| 1587 | const TensorInfo& output, |
| 1588 | const TransposeDescriptor& descriptor, |
| 1589 | Optional<std::string&> reasonIfUnsupported) const |
| 1590 | { |
| 1591 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeWorkloadValidate, reasonIfUnsupported, input, output, descriptor); |
| 1592 | } |
| 1593 | |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 1594 | bool NeonLayerSupport::IsUnidirectionalSequenceLstmSupported(const TensorInfo& input, |
| 1595 | const TensorInfo& outputStateIn, |
| 1596 | const TensorInfo& cellStateIn, |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 1597 | const TensorInfo& outputStateOut, |
| 1598 | const TensorInfo& cellStateOut, |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 1599 | const TensorInfo& output, |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 1600 | const UnidirectionalSequenceLstmDescriptor& descriptor, |
| 1601 | const LstmInputParamsInfo& paramsInfo, |
| 1602 | Optional<std::string&> reasonIfUnsupported) const |
| 1603 | { |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 1604 | if (input.GetDataType() == armnn::DataType::QAsymmS8 && |
| 1605 | outputStateIn.GetDataType() == armnn::DataType::QAsymmS8 && |
| 1606 | cellStateIn.GetDataType() == armnn::DataType::QSymmS16 && |
| 1607 | outputStateOut.GetDataType() == armnn::DataType::QAsymmS8 && |
| 1608 | cellStateOut.GetDataType() == armnn::DataType::QSymmS16 && |
| 1609 | output.GetDataType() == armnn::DataType::QAsymmS8) |
| 1610 | { |
| 1611 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonUnidirectionalSequenceLstmWorkloadValidate, |
| 1612 | reasonIfUnsupported, |
| 1613 | input, |
| 1614 | outputStateIn, |
| 1615 | cellStateIn, |
| 1616 | outputStateOut, |
| 1617 | cellStateOut, |
| 1618 | output, |
| 1619 | descriptor, |
| 1620 | paramsInfo); |
| 1621 | } |
| 1622 | else |
| 1623 | { |
| 1624 | FORWARD_WORKLOAD_VALIDATE_FUNC(NeonUnidirectionalSequenceLstmFloatWorkloadValidate, |
| 1625 | reasonIfUnsupported, |
| 1626 | input, |
| 1627 | outputStateIn, |
| 1628 | cellStateIn, |
| 1629 | outputStateOut, |
| 1630 | cellStateOut, |
| 1631 | output, |
| 1632 | descriptor, |
| 1633 | paramsInfo); |
| 1634 | } |
Cathal Corbett | fd5bec4 | 2022-03-03 15:13:23 +0000 | [diff] [blame] | 1635 | } |
| 1636 | |
Aron Virginas-Tar | fc82431 | 2018-10-15 15:00:13 +0100 | [diff] [blame] | 1637 | } // namespace armnn |