Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [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 | // |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 5 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 6 | #include <Layer.hpp> |
| 7 | #include <LayersFwd.hpp> |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 8 | |
David Beck | b4540be | 2018-09-24 13:18:27 +0100 | [diff] [blame] | 9 | #include <armnn/Types.hpp> |
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 10 | #include <armnn/backends/IBackendInternal.hpp> |
Francis Murtagh | cae4568 | 2021-04-26 10:07:49 +0100 | [diff] [blame] | 11 | #include <armnn/backends/ILayerSupport.hpp> |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 12 | #include <armnn/BackendHelper.hpp> |
Matteo Martincigh | c601aa6 | 2019-10-29 15:03:22 +0000 | [diff] [blame] | 13 | #include <armnn/BackendRegistry.hpp> |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 14 | #include <armnn/utility/PolymorphicDowncast.hpp> |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 15 | #include <armnn/utility/TransformIterator.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 16 | |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 17 | #include <armnn/backends/WorkloadFactory.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 18 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 19 | #include <sstream> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 20 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 21 | namespace armnn |
| 22 | { |
| 23 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 24 | namespace |
| 25 | { |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 26 | using LayerList = std::list<Layer*>; |
| 27 | using Iterator = LayerList::const_iterator; // Const so pointers in the list can't be modified externally. |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 28 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 29 | const TensorInfo OverrideDataType(const TensorInfo& info, Optional<DataType> type) |
| 30 | { |
| 31 | if (!type) |
| 32 | { |
| 33 | return info; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 34 | } |
| 35 | |
Matthew Sloyan | 81beae3 | 2021-07-13 19:46:11 +0100 | [diff] [blame] | 36 | return TensorInfo(info.GetShape(), |
| 37 | type.value(), |
| 38 | info.GetQuantizationScale(), |
| 39 | info.GetQuantizationOffset(), |
| 40 | info.IsConstant()); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 41 | } |
| 42 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 43 | } // anonymous namespace |
| 44 | |
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 45 | inline armnn::Optional<armnn::DataType> GetBiasTypeFromWeightsType(armnn::Optional<armnn::DataType> weightsType) |
| 46 | { |
| 47 | if (!weightsType) |
| 48 | { |
| 49 | return weightsType; |
| 50 | } |
| 51 | |
| 52 | switch(weightsType.value()) |
| 53 | { |
| 54 | case armnn::DataType::BFloat16: |
| 55 | case armnn::DataType::Float16: |
| 56 | case armnn::DataType::Float32: |
| 57 | return weightsType; |
| 58 | case armnn::DataType::QAsymmS8: |
| 59 | case armnn::DataType::QAsymmU8: |
| 60 | case armnn::DataType::QSymmS8: |
| 61 | case armnn::DataType::QSymmS16: |
| 62 | return armnn::DataType::Signed32; |
| 63 | default: |
| 64 | ARMNN_ASSERT_MSG(false, "GetBiasTypeFromWeightsType(): Unsupported data type."); |
| 65 | } |
| 66 | return armnn::EmptyOptional(); |
| 67 | } |
| 68 | |
| 69 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 70 | bool IWorkloadFactory::IsLayerConfigurationSupported(const BackendId& backendId, |
| 71 | const IConnectableLayer& connectableLayer, |
| 72 | Optional<DataType> dataType, |
| 73 | std::string& outReasonIfUnsupported, |
| 74 | const ModelOptions& modelOptions) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 75 | { |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 76 | Optional<std::string&> reason = outReasonIfUnsupported; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 77 | bool result; |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 78 | const Layer& layer = *(PolymorphicDowncast<const Layer*>(&connectableLayer)); |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 79 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 80 | auto const& backendRegistry = BackendRegistryInstance(); |
| 81 | if (!backendRegistry.IsBackendRegistered(backendId)) |
| 82 | { |
| 83 | std::stringstream ss; |
| 84 | ss << connectableLayer.GetName() << " is not supported on " << backendId |
| 85 | << " because this backend is not registered."; |
| 86 | |
| 87 | outReasonIfUnsupported = ss.str(); |
| 88 | return false; |
| 89 | } |
| 90 | |
| 91 | auto backendFactory = backendRegistry.GetFactory(backendId); |
| 92 | auto backendObject = backendFactory(); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 93 | auto layerSupport = backendObject->GetLayerSupport(modelOptions); |
| 94 | auto layerSupportObject = LayerSupportHandle(layerSupport, backendId); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 95 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 96 | switch(layer.GetType()) |
| 97 | { |
| 98 | case LayerType::Activation: |
| 99 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 100 | auto cLayer = PolymorphicDowncast<const ActivationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 101 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 102 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 103 | result = layerSupportObject.IsActivationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 104 | OverrideDataType(input, dataType), |
| 105 | OverrideDataType(output, dataType), |
| 106 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 107 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 108 | break; |
| 109 | } |
| 110 | case LayerType::Addition: |
| 111 | { |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 112 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 113 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 114 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 115 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 116 | result = layerSupportObject.IsAdditionSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 117 | OverrideDataType(input0, dataType), |
| 118 | OverrideDataType(input1, dataType), |
| 119 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 120 | reason); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 121 | ARMNN_NO_DEPRECATE_WARN_END |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 122 | break; |
| 123 | } |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 124 | case LayerType::ArgMinMax: |
| 125 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 126 | auto cLayer = PolymorphicDowncast<const ArgMinMaxLayer*>(&layer); |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 127 | const ArgMinMaxDescriptor& descriptor = cLayer->GetParameters(); |
| 128 | |
| 129 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 130 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 131 | result = layerSupportObject.IsArgMinMaxSupported( |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 132 | OverrideDataType(input, dataType), |
Narumol Prangnawarat | d1f5773 | 2019-10-31 14:24:02 +0000 | [diff] [blame] | 133 | OverrideDataType(output, DataType::Signed32), |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 134 | descriptor, |
| 135 | reason); |
| 136 | break; |
| 137 | } |
Samuel Yap | 6b47809 | 2022-07-06 15:36:03 +0100 | [diff] [blame] | 138 | case LayerType::BatchMatMul: |
| 139 | { |
| 140 | auto cLayer = PolymorphicDowncast<const BatchMatMulLayer*>(&layer); |
| 141 | const BatchMatMulDescriptor& descriptor = cLayer->GetParameters(); |
| 142 | |
| 143 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 144 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 145 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 146 | result = layerSupportObject.IsBatchMatMulSupported( |
| 147 | OverrideDataType(input0, dataType), |
| 148 | OverrideDataType(input1, dataType), |
| 149 | OverrideDataType(output, dataType), |
| 150 | descriptor, |
| 151 | reason); |
| 152 | break; |
| 153 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 154 | case LayerType::BatchNormalization: |
| 155 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 156 | auto cLayer = PolymorphicDowncast<const BatchNormalizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 157 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 158 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 159 | const TensorInfo& mean = cLayer->m_Mean->GetTensorInfo(); |
| 160 | const TensorInfo& var = cLayer->m_Variance->GetTensorInfo(); |
| 161 | const TensorInfo& beta = cLayer->m_Beta->GetTensorInfo(); |
| 162 | const TensorInfo& gamma = cLayer->m_Gamma->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 163 | result = layerSupportObject.IsBatchNormalizationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 164 | OverrideDataType(input, dataType), |
| 165 | OverrideDataType(output, dataType), |
| 166 | OverrideDataType(mean, dataType), |
| 167 | OverrideDataType(var, dataType), |
| 168 | OverrideDataType(beta, dataType), |
| 169 | OverrideDataType(gamma, dataType), |
| 170 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 171 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 172 | break; |
| 173 | } |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 174 | case LayerType::BatchToSpaceNd: |
| 175 | { |
| 176 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 177 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 178 | auto cLayer = PolymorphicDowncast<const BatchToSpaceNdLayer*>(&layer); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 179 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 180 | result = layerSupportObject.IsBatchToSpaceNdSupported(OverrideDataType(input, dataType), |
| 181 | OverrideDataType(output, dataType), |
| 182 | cLayer->GetParameters(), |
| 183 | reason); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 184 | break; |
| 185 | } |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 186 | case LayerType::Cast: |
| 187 | { |
| 188 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 189 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 190 | |
| 191 | result = layerSupportObject.IsCastSupported(OverrideDataType(input, dataType), |
| 192 | OverrideDataType(output, dataType), |
| 193 | reason); |
| 194 | break; |
| 195 | } |
Simon Obute | 51f6777 | 2021-09-03 15:50:13 +0100 | [diff] [blame] | 196 | case LayerType::ChannelShuffle: |
| 197 | { |
| 198 | auto cLayer = PolymorphicDowncast<const ChannelShuffleLayer*>(&layer); |
| 199 | |
| 200 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 201 | const TensorInfo& output = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 202 | |
| 203 | const ChannelShuffleDescriptor descriptor = cLayer->GetParameters(); |
| 204 | |
| 205 | result = layerSupportObject.IsChannelShuffleSupported(OverrideDataType(input, dataType), |
| 206 | OverrideDataType(output, dataType), |
| 207 | descriptor, |
| 208 | reason); |
| 209 | break; |
| 210 | } |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 211 | case LayerType::Comparison: |
| 212 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 213 | auto cLayer = PolymorphicDowncast<const ComparisonLayer*>(&layer); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 214 | |
| 215 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 216 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 217 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 218 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 219 | result = layerSupportObject.IsComparisonSupported(OverrideDataType(input0, dataType), |
| 220 | OverrideDataType(input1, dataType), |
| 221 | OverrideDataType(output, DataType::Boolean), |
| 222 | cLayer->GetParameters(), |
| 223 | reason); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 224 | break; |
| 225 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 226 | case LayerType::Constant: |
| 227 | { |
| 228 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 229 | result = layerSupportObject.IsConstantSupported(OverrideDataType(output, dataType), reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 230 | break; |
| 231 | } |
| 232 | case LayerType::ConvertFp16ToFp32: |
| 233 | { |
| 234 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 235 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 236 | result = layerSupportObject.IsConvertFp16ToFp32Supported(input, output, reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 237 | break; |
| 238 | } |
| 239 | case LayerType::ConvertFp32ToFp16: |
| 240 | { |
| 241 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 242 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 243 | result = layerSupportObject.IsConvertFp32ToFp16Supported(input, output, reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 244 | break; |
| 245 | } |
| 246 | case LayerType::Convolution2d: |
| 247 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 248 | auto cLayer = PolymorphicDowncast<const Convolution2dLayer*>(&layer); |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 249 | |
| 250 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 251 | dataType); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 252 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
Keith Davis | b4dd5cc | 2022-04-07 11:32:00 +0100 | [diff] [blame] | 253 | ARMNN_ASSERT_MSG(layer.GetInputSlot(1).GetConnection(), |
| 254 | "Convolution2dLayer: Weights should be connected as a Constant Layer."); |
| 255 | const TensorInfo weights = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 256 | dataType); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 257 | |
Matthew Sloyan | b63a311 | 2021-09-08 13:05:51 +0100 | [diff] [blame] | 258 | const Convolution2dDescriptor& descriptor = cLayer->GetParameters(); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 259 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 260 | // Construct optional biases object based on the value of m_BiasEnabled |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 261 | Optional<TensorInfo> biases; |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 262 | if (descriptor.m_BiasEnabled) |
| 263 | { |
Keith Davis | b4dd5cc | 2022-04-07 11:32:00 +0100 | [diff] [blame] | 264 | ARMNN_ASSERT_MSG(layer.GetInputSlot(2).GetConnection(), |
| 265 | "Convolution2dLayer: Bias should be connected as a Constant Layer."); |
| 266 | biases = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 267 | GetBiasTypeFromWeightsType(dataType)); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 268 | } |
| 269 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 270 | result = layerSupportObject.IsConvolution2dSupported( |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 271 | input, |
| 272 | output, |
| 273 | descriptor, |
Keith Davis | b4dd5cc | 2022-04-07 11:32:00 +0100 | [diff] [blame] | 274 | weights, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 275 | biases, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 276 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 277 | break; |
| 278 | } |
Matthew Sloyan | b63a311 | 2021-09-08 13:05:51 +0100 | [diff] [blame] | 279 | case LayerType::Convolution3d: |
| 280 | { |
| 281 | auto cLayer = PolymorphicDowncast<const Convolution3dLayer*>(&layer); |
| 282 | |
| 283 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 284 | dataType); |
| 285 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
Matthew Sloyan | 5d7b0a3 | 2021-10-18 13:07:49 +0100 | [diff] [blame] | 286 | |
| 287 | ARMNN_ASSERT_MSG(layer.GetInputSlot(1).GetConnection(), |
| 288 | "Convolution3dLayer: Weights should be connected as a Constant Layer."); |
| 289 | const TensorInfo weights = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 290 | dataType); |
Matthew Sloyan | b63a311 | 2021-09-08 13:05:51 +0100 | [diff] [blame] | 291 | |
| 292 | const Convolution3dDescriptor& descriptor = cLayer->GetParameters(); |
| 293 | |
| 294 | // Construct optional biases object based on the value of m_BiasEnabled |
| 295 | Optional<TensorInfo> biases; |
| 296 | if (descriptor.m_BiasEnabled) |
| 297 | { |
Matthew Sloyan | 5d7b0a3 | 2021-10-18 13:07:49 +0100 | [diff] [blame] | 298 | biases = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 299 | GetBiasTypeFromWeightsType(dataType)); |
Matthew Sloyan | b63a311 | 2021-09-08 13:05:51 +0100 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | result = layerSupportObject.IsConvolution3dSupported( |
| 303 | input, |
| 304 | output, |
| 305 | descriptor, |
Matthew Sloyan | 5d7b0a3 | 2021-10-18 13:07:49 +0100 | [diff] [blame] | 306 | weights, |
Matthew Sloyan | b63a311 | 2021-09-08 13:05:51 +0100 | [diff] [blame] | 307 | biases, |
| 308 | reason); |
| 309 | break; |
| 310 | } |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 311 | case LayerType::Debug: |
| 312 | { |
| 313 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 314 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 315 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 316 | result = layerSupportObject.IsDebugSupported(OverrideDataType(input, dataType), |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 317 | OverrideDataType(output, dataType), |
| 318 | reason); |
| 319 | break; |
| 320 | } |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 321 | case LayerType::DepthToSpace: |
| 322 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 323 | auto cLayer = PolymorphicDowncast<const DepthToSpaceLayer*>(&layer); |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 324 | |
| 325 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 326 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 327 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 328 | result = layerSupportObject.IsDepthToSpaceSupported(OverrideDataType(input, dataType), |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 329 | OverrideDataType(output, dataType), |
| 330 | cLayer->GetParameters(), |
| 331 | reason); |
| 332 | break; |
| 333 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 334 | case LayerType::DepthwiseConvolution2d: |
| 335 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 336 | auto cLayer = PolymorphicDowncast<const DepthwiseConvolution2dLayer*>(&layer); |
Cathal Corbett | 0690265 | 2022-04-14 17:55:11 +0100 | [diff] [blame] | 337 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 338 | dataType); |
| 339 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 340 | const TensorInfo& weights = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 341 | dataType); |
| 342 | |
| 343 | ARMNN_ASSERT(cLayer->GetInputSlot(1).GetConnection() != nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 344 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 345 | const DepthwiseConvolution2dDescriptor& descriptor = cLayer->GetParameters(); |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 346 | |
| 347 | // Construct optional biases object based on the value of m_BiasEnabled |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 348 | Optional<TensorInfo> biases; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 349 | if (descriptor.m_BiasEnabled) |
| 350 | { |
Cathal Corbett | 0690265 | 2022-04-14 17:55:11 +0100 | [diff] [blame] | 351 | biases = OverrideDataType(cLayer->GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 352 | GetBiasTypeFromWeightsType(dataType)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 353 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 354 | |
Cathal Corbett | 0690265 | 2022-04-14 17:55:11 +0100 | [diff] [blame] | 355 | result = layerSupportObject.IsDepthwiseConvolutionSupported(input, |
| 356 | output, |
| 357 | descriptor, |
| 358 | weights, |
| 359 | biases, |
| 360 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 361 | break; |
| 362 | } |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 363 | case LayerType::Dequantize: |
| 364 | { |
| 365 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 366 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 367 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 368 | result = layerSupportObject.IsDequantizeSupported(input, |
| 369 | OverrideDataType(output, dataType), |
| 370 | reason); |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 371 | break; |
| 372 | } |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 373 | case LayerType::DetectionPostProcess: |
| 374 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 375 | auto cLayer = PolymorphicDowncast<const DetectionPostProcessLayer*>(&layer); |
Derek Lamberti | 6a5e5e8 | 2019-12-05 14:41:20 +0000 | [diff] [blame] | 376 | const TensorInfo& boxEncodings = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 377 | const TensorInfo& scores = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 378 | const TensorInfo& anchors = cLayer->m_Anchors->GetTensorInfo(); |
| 379 | |
| 380 | const TensorInfo& detectionBoxes = layer.GetOutputSlot(0).GetTensorInfo(); |
| 381 | const TensorInfo& detectionClasses = layer.GetOutputSlot(1).GetTensorInfo(); |
| 382 | const TensorInfo& detectionScores = layer.GetOutputSlot(2).GetTensorInfo(); |
| 383 | const TensorInfo& numDetections = layer.GetOutputSlot(3).GetTensorInfo(); |
| 384 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 385 | const DetectionPostProcessDescriptor& descriptor = cLayer->GetParameters(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 386 | result = layerSupportObject.IsDetectionPostProcessSupported(boxEncodings, |
| 387 | scores, |
| 388 | anchors, |
| 389 | detectionBoxes, |
| 390 | detectionClasses, |
| 391 | detectionScores, |
| 392 | numDetections, |
| 393 | descriptor, |
| 394 | reason); |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 395 | break; |
| 396 | } |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 397 | case LayerType::ElementwiseBinary: |
| 398 | { |
| 399 | auto cLayer = PolymorphicDowncast<const ElementwiseBinaryLayer*>(&layer); |
| 400 | |
| 401 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 402 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 403 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 404 | std::vector<TensorInfo> infos = { OverrideDataType(input0, dataType), |
| 405 | OverrideDataType(input1, dataType), |
| 406 | OverrideDataType(output, dataType) }; |
| 407 | result = layerSupport->IsLayerSupported(LayerType::ElementwiseBinary, |
| 408 | infos, |
| 409 | cLayer->GetParameters(), |
| 410 | EmptyOptional(), |
| 411 | EmptyOptional(), |
| 412 | reason); |
| 413 | break; |
| 414 | } |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 415 | case LayerType::ElementwiseUnary: |
| 416 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 417 | auto cLayer = PolymorphicDowncast<const ElementwiseUnaryLayer*>(&layer); |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 418 | |
| 419 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 420 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 421 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 422 | result = layerSupportObject.IsElementwiseUnarySupported(OverrideDataType(input, dataType), |
| 423 | OverrideDataType(output, dataType), |
| 424 | cLayer->GetParameters(), |
| 425 | reason); |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 426 | break; |
| 427 | } |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 428 | case LayerType::Fill: |
| 429 | { |
| 430 | auto cLayer = PolymorphicDowncast<const FillLayer*>(&layer); |
| 431 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 432 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 433 | const FillDescriptor& descriptor = cLayer->GetParameters(); |
| 434 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 435 | result = layerSupportObject.IsFillSupported( |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 436 | OverrideDataType(input, dataType), |
| 437 | OverrideDataType(output, dataType), |
| 438 | descriptor, |
| 439 | reason); |
| 440 | break; |
| 441 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 442 | case LayerType::FakeQuantization: |
| 443 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 444 | auto cLayer = PolymorphicDowncast<const FakeQuantizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 445 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 446 | result = layerSupportObject.IsFakeQuantizationSupported(OverrideDataType(input, dataType), |
| 447 | cLayer->GetParameters(), |
| 448 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 449 | break; |
| 450 | } |
| 451 | case LayerType::Floor: |
| 452 | { |
| 453 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 454 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 455 | result = layerSupportObject.IsFloorSupported(OverrideDataType(input, dataType), |
| 456 | OverrideDataType(output, dataType), |
| 457 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 458 | break; |
| 459 | } |
| 460 | case LayerType::FullyConnected: |
| 461 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 462 | auto cLayer = PolymorphicDowncast<const FullyConnectedLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 463 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 464 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 465 | |
| 466 | const FullyConnectedDescriptor& descriptor = cLayer->GetParameters(); |
| 467 | TensorInfo weightsInfo; |
| 468 | const TensorInfo* weightsInfoPtr = nullptr; |
| 469 | |
Matthew Sloyan | 81beae3 | 2021-07-13 19:46:11 +0100 | [diff] [blame] | 470 | weightsInfo = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), dataType); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 471 | weightsInfoPtr = &weightsInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 472 | |
| 473 | TensorInfo biasInfo; |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 474 | const TensorInfo* biasInfoPtr = nullptr; |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 475 | static const TensorInfo dummyBFloat16Bias(TensorShape({1,1,1,1}), DataType::BFloat16); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 476 | static const TensorInfo dummyFloat16Bias(TensorShape({1,1,1,1}), DataType::Float16); |
| 477 | static const TensorInfo dummyFloat32Bias(TensorShape({1,1,1,1}), DataType::Float32); |
| 478 | static const TensorInfo dummyQA8Bias(TensorShape({1,1,1,1}), DataType::Signed32); |
| 479 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 480 | if (descriptor.m_BiasEnabled) |
| 481 | { |
Matthew Sloyan | 81beae3 | 2021-07-13 19:46:11 +0100 | [diff] [blame] | 482 | biasInfo = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), dataType); |
| 483 | biasInfoPtr = &biasInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 484 | } |
| 485 | else |
| 486 | { |
| 487 | // If biases are not enabled pass a dummy tensorinfo for the validation |
| 488 | switch(input.GetDataType()) |
| 489 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 490 | case DataType::BFloat16: |
| 491 | { |
| 492 | biasInfoPtr = &dummyBFloat16Bias; |
| 493 | break; |
| 494 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 495 | case DataType::Float16: |
| 496 | { |
| 497 | biasInfoPtr = &dummyFloat16Bias; |
| 498 | break; |
| 499 | } |
| 500 | case DataType::Float32: |
| 501 | { |
| 502 | biasInfoPtr = &dummyFloat32Bias; |
| 503 | break; |
| 504 | } |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 505 | case DataType::QAsymmU8: |
Keith Davis | a856501 | 2020-02-14 12:22:40 +0000 | [diff] [blame] | 506 | case DataType::QAsymmS8: |
Keith Davis | 9d0ff74 | 2020-02-03 14:47:54 +0000 | [diff] [blame] | 507 | case DataType::QSymmS8: |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 508 | case DataType::QSymmS16: |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 509 | { |
| 510 | biasInfoPtr = &dummyQA8Bias; |
| 511 | break; |
| 512 | } |
| 513 | default: |
| 514 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 515 | ARMNN_ASSERT_MSG(false, "Unexpected bias type"); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 516 | } |
| 517 | } |
| 518 | } |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 519 | result = layerSupportObject.IsFullyConnectedSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 520 | OverrideDataType(input, dataType), |
| 521 | OverrideDataType(output, dataType), |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 522 | *weightsInfoPtr, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 523 | *biasInfoPtr, |
| 524 | descriptor, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 525 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 526 | break; |
| 527 | } |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 528 | case LayerType::Gather: |
| 529 | { |
| 530 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 531 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 532 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 533 | auto cLayer = PolymorphicDowncast<const GatherLayer*>(&layer); |
| 534 | const GatherDescriptor& descriptor = cLayer->GetParameters(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 535 | result = layerSupportObject.IsGatherSupported(OverrideDataType(input0, dataType), |
| 536 | input1, |
| 537 | OverrideDataType(output, dataType), |
| 538 | descriptor, |
| 539 | reason); |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 540 | break; |
| 541 | } |
Teresa Charlin | b2d3ec5 | 2022-04-12 22:07:09 +0100 | [diff] [blame] | 542 | case LayerType::GatherNd: |
| 543 | { |
| 544 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 545 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 546 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 547 | result = layerSupportObject.IsGatherNdSupported(OverrideDataType(input0, dataType), |
| 548 | input1, |
| 549 | OverrideDataType(output, dataType), |
| 550 | reason); |
| 551 | break; |
| 552 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 553 | case LayerType::Input: |
| 554 | { |
| 555 | const TensorInfo& input = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 556 | result = layerSupportObject.IsInputSupported(OverrideDataType(input, dataType), reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 557 | break; |
| 558 | } |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 559 | case LayerType::InstanceNormalization: |
| 560 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 561 | auto cLayer = PolymorphicDowncast<const InstanceNormalizationLayer*>(&layer); |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 562 | const InstanceNormalizationDescriptor& descriptor = cLayer->GetParameters(); |
| 563 | |
| 564 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 565 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 566 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 567 | result = layerSupportObject.IsInstanceNormalizationSupported( |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 568 | OverrideDataType(input, dataType), |
| 569 | OverrideDataType(output, dataType), |
| 570 | descriptor, |
| 571 | reason); |
| 572 | break; |
| 573 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 574 | case LayerType::L2Normalization: |
| 575 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 576 | auto cLayer = PolymorphicDowncast<const L2NormalizationLayer*>(&layer); |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 577 | const L2NormalizationDescriptor& descriptor = cLayer->GetParameters(); |
| 578 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 579 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 580 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 581 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 582 | result = layerSupportObject.IsL2NormalizationSupported( |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 583 | OverrideDataType(input, dataType), |
| 584 | OverrideDataType(output, dataType), |
| 585 | descriptor, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 586 | reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 587 | break; |
| 588 | } |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 589 | case LayerType::LogicalBinary: |
| 590 | { |
| 591 | auto cLayer = PolymorphicDowncast<const LogicalBinaryLayer*>(&layer); |
| 592 | |
| 593 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 594 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 595 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 596 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 597 | result = layerSupportObject.IsLogicalBinarySupported(input0, |
| 598 | input1, |
| 599 | output, |
| 600 | cLayer->GetParameters(), |
| 601 | reason); |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 602 | break; |
| 603 | } |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 604 | case LayerType::LogSoftmax: |
| 605 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 606 | auto cLayer = PolymorphicDowncast<const LogSoftmaxLayer*>(&layer); |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 607 | |
| 608 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 609 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 610 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 611 | result = layerSupportObject.IsLogSoftmaxSupported(OverrideDataType(input, dataType), |
| 612 | OverrideDataType(output, dataType), |
| 613 | cLayer->GetParameters(), |
| 614 | reason); |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 615 | break; |
| 616 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 617 | case LayerType::Lstm: |
| 618 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 619 | auto cLayer = PolymorphicDowncast<const LstmLayer*>(&layer); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 620 | const LstmDescriptor& descriptor = cLayer->GetParameters(); |
| 621 | |
| 622 | // All inputs. |
| 623 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 624 | dataType); |
| 625 | const TensorInfo& outputStateIn = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 626 | dataType); |
| 627 | const TensorInfo& cellStateIn = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 628 | dataType); |
| 629 | // All outputs |
| 630 | const TensorInfo& scratchBuffer = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 631 | const TensorInfo& outputStateOut = OverrideDataType(layer.GetOutputSlot(1).GetTensorInfo(), dataType); |
| 632 | const TensorInfo& cellStateOut = OverrideDataType(layer.GetOutputSlot(2).GetTensorInfo(), dataType); |
| 633 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(3).GetTensorInfo(), dataType); |
| 634 | |
| 635 | // Basic parameters |
| 636 | const TensorInfo& inputToForgetWeights |
| 637 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(), dataType); |
| 638 | const TensorInfo& inputToCellWeights |
| 639 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(), dataType); |
| 640 | const TensorInfo& inputToOutputWeights |
| 641 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(), dataType); |
| 642 | const TensorInfo& recurrentToForgetWeights |
| 643 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(), dataType); |
| 644 | const TensorInfo& recurrentToCellWeights |
| 645 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(), dataType); |
| 646 | const TensorInfo& recurrentToOutputWeights |
| 647 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(), dataType); |
| 648 | const TensorInfo& forgetGateBias |
| 649 | = OverrideDataType(cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(), dataType); |
| 650 | const TensorInfo& cellBias |
| 651 | = OverrideDataType(cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(), dataType); |
| 652 | const TensorInfo& outputGateBias |
| 653 | = OverrideDataType(cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(), dataType); |
| 654 | |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 655 | LstmInputParamsInfo paramsInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 656 | |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 657 | paramsInfo.m_InputToForgetWeights = &inputToForgetWeights; |
| 658 | paramsInfo.m_InputToCellWeights = &inputToCellWeights; |
| 659 | paramsInfo.m_InputToOutputWeights = &inputToOutputWeights; |
| 660 | paramsInfo.m_RecurrentToForgetWeights = &recurrentToForgetWeights; |
| 661 | paramsInfo.m_RecurrentToCellWeights = &recurrentToCellWeights; |
| 662 | paramsInfo.m_RecurrentToOutputWeights = &recurrentToOutputWeights; |
| 663 | paramsInfo.m_ForgetGateBias = &forgetGateBias; |
| 664 | paramsInfo.m_CellBias = &cellBias; |
| 665 | paramsInfo.m_OutputGateBias = &outputGateBias; |
| 666 | |
| 667 | |
| 668 | // Optional parameters |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 669 | TensorInfo optInputToInputWeights; |
| 670 | TensorInfo optRecurrentToInputWeights; |
| 671 | TensorInfo optCellToInputWeights; |
| 672 | TensorInfo optInputGateBias; |
| 673 | TensorInfo optProjectionWeights; |
| 674 | TensorInfo optProjectionBias; |
| 675 | TensorInfo optCellToForgetWeights; |
| 676 | TensorInfo optCellToOutputWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 677 | TensorInfo optInputLayerNormWeights; |
| 678 | TensorInfo optForgetLayerNormWeights; |
| 679 | TensorInfo optCellLayerNormWeights; |
| 680 | TensorInfo optOutputLayerNormWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 681 | |
| 682 | if(!descriptor.m_CifgEnabled) |
| 683 | { |
| 684 | optInputToInputWeights = |
| 685 | OverrideDataType(cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 686 | paramsInfo.m_InputToInputWeights = &optInputToInputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 687 | |
| 688 | optRecurrentToInputWeights = |
| 689 | OverrideDataType(cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 690 | paramsInfo.m_RecurrentToInputWeights = &optRecurrentToInputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 691 | optInputGateBias = |
| 692 | OverrideDataType(cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 693 | paramsInfo.m_InputGateBias = &optInputGateBias; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | if(descriptor.m_ProjectionEnabled) |
| 697 | { |
| 698 | optProjectionWeights = |
| 699 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 700 | paramsInfo.m_ProjectionWeights = &optProjectionWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 701 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 702 | { |
| 703 | optProjectionBias = |
| 704 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 705 | paramsInfo.m_ProjectionBias = &optProjectionBias; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 706 | } |
| 707 | } |
| 708 | |
| 709 | if(descriptor.m_PeepholeEnabled) |
| 710 | { |
Jan Eilers | e2062cd | 2020-03-30 15:07:45 +0100 | [diff] [blame] | 711 | if(!descriptor.m_CifgEnabled) |
| 712 | { |
| 713 | optCellToInputWeights = |
| 714 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(), |
| 715 | dataType); |
| 716 | paramsInfo.m_CellToInputWeights = &optCellToInputWeights; |
| 717 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 718 | optCellToForgetWeights = |
| 719 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 720 | paramsInfo.m_CellToForgetWeights = &optCellToForgetWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 721 | optCellToOutputWeights = |
| 722 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 723 | paramsInfo.m_CellToOutputWeights = &optCellToOutputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 724 | } |
| 725 | |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 726 | if(descriptor.m_LayerNormEnabled) |
| 727 | { |
Ferran Balaguer | e30c16e | 2019-07-24 17:03:45 +0100 | [diff] [blame] | 728 | if (!descriptor.m_CifgEnabled) |
| 729 | { |
| 730 | optInputLayerNormWeights = OverrideDataType( |
| 731 | cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(), dataType); |
| 732 | paramsInfo.m_InputLayerNormWeights = &optInputLayerNormWeights; |
| 733 | } |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 734 | |
| 735 | optForgetLayerNormWeights = OverrideDataType( |
| 736 | cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 737 | paramsInfo.m_ForgetLayerNormWeights = &optForgetLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 738 | |
| 739 | optCellLayerNormWeights = OverrideDataType( |
| 740 | cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 741 | paramsInfo.m_CellLayerNormWeights = &optCellLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 742 | |
| 743 | optOutputLayerNormWeights = OverrideDataType( |
| 744 | cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 745 | paramsInfo.m_OutputLayerNormWeights = &optOutputLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 746 | } |
| 747 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 748 | result = layerSupportObject.IsLstmSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 749 | input, |
| 750 | outputStateIn, |
| 751 | cellStateIn, |
| 752 | scratchBuffer, |
| 753 | outputStateOut, |
| 754 | cellStateOut, |
| 755 | output, |
| 756 | descriptor, |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 757 | paramsInfo, |
| 758 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 759 | break; |
| 760 | } |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 761 | case LayerType::Maximum: |
| 762 | { |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 763 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 764 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 765 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 766 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 767 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 768 | result = layerSupportObject.IsMaximumSupported(OverrideDataType(input0, dataType), |
| 769 | OverrideDataType(input1, dataType), |
| 770 | OverrideDataType(output, dataType), |
| 771 | reason); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 772 | ARMNN_NO_DEPRECATE_WARN_END |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 773 | break; |
| 774 | } |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 775 | case LayerType::MemCopy: |
| 776 | { |
| 777 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 778 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 779 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 780 | result = layerSupportObject.IsMemCopySupported(OverrideDataType(input, dataType), |
| 781 | OverrideDataType(output, dataType), |
| 782 | reason); |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 783 | break; |
| 784 | } |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 785 | case LayerType::MemImport: |
| 786 | { |
| 787 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 788 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 789 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 790 | result = layerSupportObject.IsMemImportSupported(OverrideDataType(input, dataType), |
| 791 | OverrideDataType(output, dataType), |
| 792 | reason); |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 793 | break; |
| 794 | } |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 795 | case LayerType::Merge: |
| 796 | { |
| 797 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 798 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 799 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 800 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 801 | result = layerSupportObject.IsMergeSupported(OverrideDataType(input0, dataType), |
| 802 | OverrideDataType(input1, dataType), |
| 803 | OverrideDataType(output, dataType), |
| 804 | reason); |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 805 | break; |
| 806 | } |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 807 | case LayerType::Concat: |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 808 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 809 | auto cLayer = PolymorphicDowncast<const ConcatLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 810 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 811 | // Get vector of all inputs. |
| 812 | auto getTensorInfo = [&dataType](const InputSlot& slot) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 813 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 814 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 815 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 816 | |
| 817 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfo); |
| 818 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfo); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 819 | std::vector<TensorInfo> inputs(beginI, endI); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 820 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 821 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 822 | { |
| 823 | return &info; |
| 824 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 825 | |
| 826 | auto beginPtr = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 827 | auto endPtr = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 828 | std::vector<const TensorInfo*> inputPtrs(beginPtr, endPtr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 829 | |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 830 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 831 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 832 | result = layerSupportObject.IsConcatSupported(inputPtrs, output, cLayer->GetParameters(), reason); |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 833 | |
| 834 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 835 | break; |
| 836 | } |
| 837 | case LayerType::Multiplication: |
| 838 | { |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 839 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 840 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 841 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 842 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 843 | result = layerSupportObject.IsMultiplicationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 844 | OverrideDataType(input0, dataType), |
| 845 | OverrideDataType(input1, dataType), |
| 846 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 847 | reason); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 848 | ARMNN_NO_DEPRECATE_WARN_END |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 849 | break; |
| 850 | } |
| 851 | case LayerType::Normalization: |
| 852 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 853 | auto cLayer = PolymorphicDowncast<const NormalizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 854 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 855 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 856 | result = layerSupportObject.IsNormalizationSupported(OverrideDataType(input, dataType), |
| 857 | OverrideDataType(output, dataType), |
| 858 | cLayer->GetParameters(), |
| 859 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 860 | break; |
| 861 | } |
| 862 | case LayerType::Output: |
| 863 | { |
| 864 | const TensorInfo& output = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 865 | result = layerSupportObject.IsOutputSupported(OverrideDataType(output, dataType), reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 866 | break; |
| 867 | } |
| 868 | case LayerType::Permute: |
| 869 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 870 | auto cLayer = PolymorphicDowncast<const PermuteLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 871 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 872 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 873 | result = layerSupportObject.IsPermuteSupported(OverrideDataType(input, dataType), |
| 874 | OverrideDataType(output, dataType), |
| 875 | cLayer->GetParameters(), |
| 876 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 877 | break; |
| 878 | } |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 879 | case LayerType::Pad: |
| 880 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 881 | auto cLayer = PolymorphicDowncast<const PadLayer*>(&layer); |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 882 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 883 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 884 | result = layerSupportObject.IsPadSupported( |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 885 | OverrideDataType(input, dataType), |
| 886 | OverrideDataType(output, dataType), |
| 887 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 888 | reason); |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 889 | break; |
| 890 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 891 | case LayerType::Pooling2d: |
| 892 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 893 | auto cLayer = PolymorphicDowncast<const Pooling2dLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 894 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 895 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 896 | result = layerSupportObject.IsPooling2dSupported(OverrideDataType(input, dataType), |
| 897 | OverrideDataType(output, dataType), |
| 898 | cLayer->GetParameters(), |
| 899 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 900 | break; |
| 901 | } |
Tamás Nyíri | 7b885b3 | 2021-10-26 14:47:57 +0100 | [diff] [blame] | 902 | case LayerType::Pooling3d: |
| 903 | { |
| 904 | auto cLayer = PolymorphicDowncast<const Pooling3dLayer*>(&layer); |
| 905 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 906 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 907 | result = layerSupportObject.IsPooling3dSupported(OverrideDataType(input, dataType), |
| 908 | OverrideDataType(output, dataType), |
| 909 | cLayer->GetParameters(), |
| 910 | reason); |
| 911 | break; |
| 912 | } |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 913 | case LayerType::PreCompiled: |
| 914 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 915 | auto cLayer = PolymorphicDowncast<const PreCompiledLayer*>(&layer); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 916 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 917 | result = layerSupportObject.IsPreCompiledSupported(OverrideDataType(input, dataType), |
| 918 | cLayer->GetParameters(), |
| 919 | reason); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 920 | break; |
| 921 | } |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 922 | case LayerType::Quantize: |
| 923 | { |
| 924 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 925 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 926 | result = layerSupportObject.IsQuantizeSupported(input, output, reason); |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 927 | break; |
| 928 | } |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 929 | case LayerType::QLstm: |
| 930 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 931 | auto cLayer = PolymorphicDowncast<const QLstmLayer*>(&layer); |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 932 | const QLstmDescriptor& descriptor = cLayer->GetParameters(); |
| 933 | |
| 934 | // Inputs |
| 935 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 936 | const TensorInfo& previousOutputIn = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 937 | const TensorInfo& previousCellStateIn = layer.GetInputSlot(2).GetConnection()->GetTensorInfo(); |
| 938 | |
| 939 | // Outputs |
| 940 | const TensorInfo& outputStateOut = layer.GetOutputSlot(0).GetTensorInfo(); |
| 941 | const TensorInfo& cellStateOut = layer.GetOutputSlot(1).GetTensorInfo(); |
| 942 | const TensorInfo& output = layer.GetOutputSlot(2).GetTensorInfo(); |
| 943 | |
| 944 | // Lstm parameters |
| 945 | LstmInputParamsInfo paramsInfo; |
| 946 | |
| 947 | // Basic parameters |
Matthew Bentham | 6f24b1a | 2021-06-29 15:18:32 +0100 | [diff] [blame] | 948 | ARMNN_ASSERT(cLayer->m_BasicParameters.m_InputToForgetWeights.get() != nullptr); |
| 949 | ARMNN_ASSERT(cLayer->m_BasicParameters.m_InputToCellWeights.get() != nullptr); |
| 950 | ARMNN_ASSERT(cLayer->m_BasicParameters.m_InputToOutputWeights.get() != nullptr); |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 951 | paramsInfo.m_InputToForgetWeights = &cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(); |
| 952 | paramsInfo.m_InputToCellWeights = &cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(); |
| 953 | paramsInfo.m_InputToOutputWeights = &cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(); |
| 954 | |
| 955 | paramsInfo.m_RecurrentToForgetWeights = |
| 956 | &cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(); |
| 957 | paramsInfo.m_RecurrentToCellWeights = |
| 958 | &cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(); |
| 959 | paramsInfo.m_RecurrentToOutputWeights = |
| 960 | &cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(); |
| 961 | |
| 962 | paramsInfo.m_ForgetGateBias = &cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(); |
| 963 | paramsInfo.m_CellBias = &cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(); |
| 964 | paramsInfo.m_OutputGateBias = &cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(); |
| 965 | |
| 966 | if(!descriptor.m_CifgEnabled) |
| 967 | { |
| 968 | paramsInfo.m_InputToInputWeights = &cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(); |
| 969 | paramsInfo.m_RecurrentToInputWeights = |
| 970 | &cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(); |
| 971 | paramsInfo.m_InputGateBias = &cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(); |
| 972 | } |
| 973 | |
| 974 | if(descriptor.m_ProjectionEnabled) |
| 975 | { |
| 976 | paramsInfo.m_ProjectionWeights = &cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(); |
James Conroy | ed32405 | 2020-05-18 15:16:42 +0100 | [diff] [blame] | 977 | |
| 978 | // Projection bias is optional even if projection is enabled |
| 979 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 980 | { |
| 981 | paramsInfo.m_ProjectionBias = &cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(); |
| 982 | } |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 983 | } |
| 984 | |
| 985 | if(descriptor.m_PeepholeEnabled) |
| 986 | { |
| 987 | if (!descriptor.m_CifgEnabled) |
| 988 | { |
| 989 | paramsInfo.m_CellToInputWeights = |
| 990 | &cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(); |
| 991 | } |
| 992 | |
| 993 | paramsInfo.m_CellToForgetWeights = |
| 994 | &cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(); |
| 995 | paramsInfo.m_CellToOutputWeights = &cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(); |
| 996 | } |
| 997 | |
| 998 | if(descriptor.m_LayerNormEnabled) |
| 999 | { |
| 1000 | if (!descriptor.m_CifgEnabled) |
| 1001 | { |
| 1002 | paramsInfo.m_InputLayerNormWeights = |
| 1003 | &cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(); |
| 1004 | } |
| 1005 | |
| 1006 | paramsInfo.m_ForgetLayerNormWeights = |
| 1007 | &cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(); |
| 1008 | paramsInfo.m_CellLayerNormWeights = |
| 1009 | &cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(); |
| 1010 | paramsInfo.m_OutputLayerNormWeights = |
| 1011 | &cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(); |
| 1012 | } |
| 1013 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1014 | result = layerSupportObject.IsQLstmSupported(input, |
| 1015 | previousOutputIn, |
| 1016 | previousCellStateIn, |
| 1017 | outputStateOut, |
| 1018 | cellStateOut, |
| 1019 | output, |
| 1020 | descriptor, |
| 1021 | paramsInfo, |
| 1022 | reason); |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 1023 | break; |
| 1024 | } |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1025 | case LayerType::QuantizedLstm: |
| 1026 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1027 | auto cLayer = PolymorphicDowncast<const QuantizedLstmLayer*>(&layer); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1028 | |
| 1029 | // Inputs |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 1030 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1031 | const TensorInfo& previousCellStateIn = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1032 | const TensorInfo& previousOutputIn = layer.GetInputSlot(2).GetConnection()->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1033 | |
| 1034 | // Outputs |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 1035 | const TensorInfo& cellStateOut = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1036 | const TensorInfo& output = layer.GetOutputSlot(1).GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1037 | |
| 1038 | // QuantizedLstm parameters |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1039 | QuantizedLstmInputParamsInfo paramsInfo; |
| 1040 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 1041 | paramsInfo.m_InputToInputWeights = |
| 1042 | &cLayer->m_QuantizedLstmParameters.m_InputToInputWeights->GetTensorInfo(); |
| 1043 | paramsInfo.m_InputToForgetWeights = |
| 1044 | &cLayer->m_QuantizedLstmParameters.m_InputToForgetWeights->GetTensorInfo(); |
| 1045 | paramsInfo.m_InputToCellWeights = |
| 1046 | &cLayer->m_QuantizedLstmParameters.m_InputToCellWeights->GetTensorInfo(); |
| 1047 | paramsInfo.m_InputToOutputWeights = |
| 1048 | &cLayer->m_QuantizedLstmParameters.m_InputToOutputWeights->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1049 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 1050 | paramsInfo.m_RecurrentToInputWeights = |
| 1051 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToInputWeights->GetTensorInfo(); |
| 1052 | paramsInfo.m_RecurrentToForgetWeights = |
| 1053 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToForgetWeights->GetTensorInfo(); |
| 1054 | paramsInfo.m_RecurrentToCellWeights = |
| 1055 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToCellWeights->GetTensorInfo(); |
| 1056 | paramsInfo.m_RecurrentToOutputWeights = |
| 1057 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToOutputWeights->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1058 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 1059 | paramsInfo.m_InputGateBias = |
| 1060 | &cLayer->m_QuantizedLstmParameters.m_InputGateBias->GetTensorInfo(); |
| 1061 | paramsInfo.m_ForgetGateBias = |
| 1062 | &cLayer->m_QuantizedLstmParameters.m_ForgetGateBias->GetTensorInfo(); |
| 1063 | paramsInfo.m_CellBias = |
| 1064 | &cLayer->m_QuantizedLstmParameters.m_CellBias->GetTensorInfo(); |
| 1065 | paramsInfo.m_OutputGateBias = |
| 1066 | &cLayer->m_QuantizedLstmParameters.m_OutputGateBias->GetTensorInfo();; |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1067 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1068 | result = layerSupportObject.IsQuantizedLstmSupported(input, |
| 1069 | previousCellStateIn, |
| 1070 | previousOutputIn, |
| 1071 | cellStateOut, |
| 1072 | output, |
| 1073 | paramsInfo, |
| 1074 | reason); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1075 | break; |
| 1076 | } |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 1077 | case LayerType::Division: |
| 1078 | { |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1079 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 1080 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1081 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1082 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1083 | result = layerSupportObject.IsDivisionSupported( |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 1084 | OverrideDataType(input0, dataType), |
| 1085 | OverrideDataType(input1, dataType), |
| 1086 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1087 | reason); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1088 | ARMNN_NO_DEPRECATE_WARN_END |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 1089 | break; |
| 1090 | } |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 1091 | case LayerType::Rank: |
| 1092 | { |
| 1093 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1094 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1095 | result = layerSupportObject.IsRankSupported(OverrideDataType(input, dataType), |
| 1096 | OverrideDataType(output, dataType), |
| 1097 | reason); |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 1098 | break; |
| 1099 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1100 | case LayerType::Reshape: |
| 1101 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1102 | auto cLayer = PolymorphicDowncast<const ReshapeLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1103 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 1104 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1105 | result = layerSupportObject.IsReshapeSupported(OverrideDataType(input, dataType), |
| 1106 | OverrideDataType(output, dataType), |
| 1107 | cLayer->GetParameters(), |
| 1108 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1109 | break; |
| 1110 | } |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 1111 | case LayerType::Resize: |
| 1112 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1113 | auto cLayer = PolymorphicDowncast<const ResizeLayer*>(&layer); |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 1114 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 1115 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1116 | result = layerSupportObject.IsResizeSupported(OverrideDataType(input, dataType), |
| 1117 | OverrideDataType(output, dataType), |
| 1118 | cLayer->GetParameters(), |
| 1119 | reason); |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 1120 | break; |
| 1121 | } |
Keith Davis | 3ae3f97 | 2021-05-21 16:33:48 +0100 | [diff] [blame] | 1122 | case LayerType::Shape: |
| 1123 | { |
| 1124 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1125 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1126 | |
| 1127 | result = layerSupportObject.IsShapeSupported(OverrideDataType(input, dataType), |
| 1128 | OverrideDataType(output, dataType), |
| 1129 | reason); |
| 1130 | break; |
| 1131 | } |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1132 | case LayerType::Slice: |
| 1133 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1134 | auto cLayer = PolymorphicDowncast<const SliceLayer*>(&layer); |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1135 | |
| 1136 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1137 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1138 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1139 | result = layerSupportObject.IsSliceSupported(OverrideDataType(input, dataType), |
| 1140 | OverrideDataType(output, dataType), |
| 1141 | cLayer->GetParameters(), |
| 1142 | reason); |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1143 | break; |
| 1144 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1145 | case LayerType::Softmax: |
| 1146 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1147 | auto cLayer = PolymorphicDowncast<const SoftmaxLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1148 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1149 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1150 | result = layerSupportObject.IsSoftmaxSupported(OverrideDataType(input, dataType), |
| 1151 | OverrideDataType(output, dataType), |
| 1152 | cLayer->GetParameters(), |
| 1153 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1154 | break; |
| 1155 | } |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 1156 | case LayerType::SpaceToBatchNd: |
| 1157 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1158 | auto cLayer = PolymorphicDowncast<const SpaceToBatchNdLayer*>(&layer); |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 1159 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1160 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1161 | result = layerSupportObject.IsSpaceToBatchNdSupported(OverrideDataType(input, dataType), |
| 1162 | OverrideDataType(output, dataType), |
| 1163 | cLayer->GetParameters(), |
| 1164 | reason); |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 1165 | break; |
| 1166 | } |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1167 | case LayerType::SpaceToDepth: |
| 1168 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1169 | auto cLayer = PolymorphicDowncast<const SpaceToDepthLayer*>(&layer); |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1170 | |
| 1171 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1172 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1173 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1174 | result = layerSupportObject.IsSpaceToDepthSupported(OverrideDataType(input, dataType), |
| 1175 | OverrideDataType(output, dataType), |
| 1176 | cLayer->GetParameters(), |
| 1177 | reason); |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1178 | break; |
| 1179 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1180 | case LayerType::Splitter: |
| 1181 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1182 | auto cLayer = PolymorphicDowncast<const SplitterLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1183 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1184 | |
| 1185 | // Get vector of all outputs. |
| 1186 | auto getTensorInfo = [&dataType](const OutputSlot& slot) |
| 1187 | { |
| 1188 | return OverrideDataType(slot.GetTensorInfo(), dataType); |
| 1189 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1190 | auto beginI = MakeTransformIterator(layer.GetOutputSlots().begin(), getTensorInfo); |
| 1191 | auto endI = MakeTransformIterator(layer.GetOutputSlots().end(), getTensorInfo); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1192 | std::vector<TensorInfo> outputs(beginI, endI); |
| 1193 | |
| 1194 | const std::vector<std::reference_wrapper<TensorInfo>> outputPtrs(outputs.begin(), outputs.end()); |
| 1195 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1196 | result = layerSupportObject.IsSplitterSupported(OverrideDataType(input, dataType), |
| 1197 | outputPtrs, |
| 1198 | cLayer->GetParameters(), |
| 1199 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1200 | break; |
| 1201 | } |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1202 | case LayerType::Stack: |
| 1203 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1204 | auto cLayer = PolymorphicDowncast<const StackLayer*>(&layer); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1205 | |
| 1206 | // Get vector of all inputs. |
| 1207 | auto getTensorInfo = [&dataType](const InputSlot& slot) |
| 1208 | { |
| 1209 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
| 1210 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1211 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfo); |
| 1212 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfo); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1213 | std::vector<TensorInfo> inputs(beginI, endI); |
| 1214 | |
| 1215 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 1216 | { |
| 1217 | return &info; |
| 1218 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1219 | auto beginPtr = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 1220 | auto endPtr = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1221 | std::vector<const TensorInfo*> inputPtrs(beginPtr, endPtr); |
| 1222 | |
| 1223 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1224 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1225 | result = layerSupportObject.IsStackSupported(inputPtrs, output, cLayer->GetParameters(), reason); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1226 | |
| 1227 | break; |
| 1228 | } |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1229 | case LayerType::StandIn: |
| 1230 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1231 | auto cLayer = PolymorphicDowncast<const StandInLayer*>(&layer); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1232 | |
| 1233 | // Get vector of all inputs. |
| 1234 | auto getTensorInfoIn = [&dataType](const InputSlot& slot) |
| 1235 | { |
| 1236 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
| 1237 | }; |
| 1238 | auto getTensorInfoOut = [&dataType](const OutputSlot& slot) |
| 1239 | { |
| 1240 | return OverrideDataType(slot.GetTensorInfo(), dataType); |
| 1241 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1242 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfoIn); |
| 1243 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfoIn); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1244 | std::vector<TensorInfo> inputs(beginI, endI); |
| 1245 | |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1246 | auto beginO = MakeTransformIterator(layer.GetOutputSlots().begin(), getTensorInfoOut); |
| 1247 | auto endO = MakeTransformIterator(layer.GetOutputSlots().end(), getTensorInfoOut); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1248 | std::vector<TensorInfo> outputs(beginO, endO); |
| 1249 | |
| 1250 | |
| 1251 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 1252 | { |
| 1253 | return &info; |
| 1254 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1255 | auto beginPtrI = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 1256 | auto endPtrI = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1257 | std::vector<const TensorInfo*> inputPtrs(beginPtrI, endPtrI); |
| 1258 | |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1259 | auto beginPtrO = MakeTransformIterator(outputs.begin(), getTensorInfoPtr); |
| 1260 | auto endPtrO = MakeTransformIterator(outputs.end(), getTensorInfoPtr); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1261 | std::vector<const TensorInfo*> outputPtrs(beginPtrO, endPtrO); |
| 1262 | |
| 1263 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1264 | result = layerSupportObject.IsStandInSupported(inputPtrs, |
| 1265 | outputPtrs, |
| 1266 | cLayer->GetParameters(), |
| 1267 | reason); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1268 | break; |
| 1269 | } |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1270 | case LayerType::StridedSlice: |
| 1271 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1272 | auto cLayer = PolymorphicDowncast<const StridedSliceLayer*>(&layer); |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1273 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1274 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1275 | result = layerSupportObject.IsStridedSliceSupported(OverrideDataType(input, dataType), |
| 1276 | OverrideDataType(output, dataType), |
| 1277 | cLayer->GetParameters(), |
| 1278 | reason); |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1279 | break; |
| 1280 | } |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1281 | case LayerType::Subtraction: |
| 1282 | { |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1283 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1284 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1285 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1286 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1287 | result = layerSupportObject.IsSubtractionSupported( |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1288 | OverrideDataType(input0, dataType), |
| 1289 | OverrideDataType(input1, dataType), |
| 1290 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1291 | reason); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1292 | ARMNN_NO_DEPRECATE_WARN_END |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1293 | break; |
| 1294 | } |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1295 | case LayerType::Switch: |
| 1296 | { |
| 1297 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1298 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1299 | const TensorInfo& output0 = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1300 | const TensorInfo& output1 = layer.GetOutputSlot(1).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1301 | result = layerSupportObject.IsSwitchSupported(OverrideDataType(input0, dataType), |
| 1302 | OverrideDataType(input1, dataType), |
| 1303 | OverrideDataType(output0, dataType), |
| 1304 | OverrideDataType(output1, dataType), |
| 1305 | reason); |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1306 | break; |
| 1307 | } |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1308 | case LayerType::Mean: |
| 1309 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1310 | auto cLayer = PolymorphicDowncast<const MeanLayer*>(&layer); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1311 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1312 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1313 | result = layerSupportObject.IsMeanSupported( |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1314 | OverrideDataType(input, dataType), |
| 1315 | OverrideDataType(output, dataType), |
| 1316 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1317 | reason); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1318 | break; |
| 1319 | } |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 1320 | case LayerType::Minimum: |
| 1321 | { |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1322 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 1323 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1324 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1325 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1326 | result = layerSupportObject.IsMinimumSupported(OverrideDataType(input0, dataType), |
| 1327 | OverrideDataType(input1, dataType), |
| 1328 | OverrideDataType(output, dataType), |
| 1329 | reason); |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1330 | ARMNN_NO_DEPRECATE_WARN_END |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 1331 | break; |
| 1332 | } |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1333 | case LayerType::Prelu: |
| 1334 | { |
| 1335 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1336 | const TensorInfo& alpha = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1337 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1338 | result = layerSupportObject.IsPreluSupported(OverrideDataType(input, dataType), |
| 1339 | OverrideDataType(alpha, dataType), |
| 1340 | OverrideDataType(output, dataType), |
| 1341 | reason); |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1342 | break; |
| 1343 | } |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1344 | case LayerType::Transpose: |
| 1345 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1346 | auto cLayer = PolymorphicDowncast<const TransposeLayer*>(&layer); |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1347 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1348 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1349 | result = layerSupportObject.IsTransposeSupported(OverrideDataType(input, dataType), |
| 1350 | OverrideDataType(output, dataType), |
| 1351 | cLayer->GetParameters(), |
| 1352 | reason); |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1353 | break; |
| 1354 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1355 | case LayerType::TransposeConvolution2d: |
| 1356 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1357 | auto cLayer = PolymorphicDowncast<const TransposeConvolution2dLayer*>(&layer); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1358 | |
| 1359 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 1360 | dataType); |
| 1361 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 1362 | |
| 1363 | const TransposeConvolution2dDescriptor& descriptor = cLayer->GetParameters(); |
| 1364 | |
| 1365 | Optional<TensorInfo> biases; |
| 1366 | if (descriptor.m_BiasEnabled) |
| 1367 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1368 | ARMNN_ASSERT(cLayer->m_Bias.get() != nullptr); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1369 | biases = OverrideDataType(cLayer->m_Bias->GetTensorInfo(), |
| 1370 | GetBiasTypeFromWeightsType(dataType)); |
| 1371 | } |
| 1372 | |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1373 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1374 | const TensorInfo weights = OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType); |
| 1375 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1376 | result = layerSupportObject.IsTransposeConvolution2dSupported(input, |
| 1377 | output, |
| 1378 | descriptor, |
| 1379 | weights, |
| 1380 | biases, |
| 1381 | reason); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1382 | |
| 1383 | break; |
| 1384 | } |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 1385 | case LayerType::Reduce: |
| 1386 | { |
| 1387 | auto cLayer = PolymorphicDowncast<const ReduceLayer*>(&layer); |
| 1388 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1389 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1390 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1391 | result = layerSupportObject.IsReduceSupported(OverrideDataType(input, dataType), |
| 1392 | OverrideDataType(output, dataType), |
| 1393 | cLayer->GetParameters(), |
| 1394 | reason); |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 1395 | break; |
| 1396 | } |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 1397 | case LayerType::UnidirectionalSequenceLstm: |
| 1398 | { |
| 1399 | auto cLayer = PolymorphicDowncast<const UnidirectionalSequenceLstmLayer*>(&layer); |
| 1400 | const UnidirectionalSequenceLstmDescriptor& descriptor = cLayer->GetParameters(); |
| 1401 | |
| 1402 | // All inputs. |
| 1403 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 1404 | dataType); |
| 1405 | const TensorInfo& outputStateIn = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 1406 | dataType); |
| 1407 | const TensorInfo& cellStateIn = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 1408 | dataType); |
| 1409 | // Outputs |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 1410 | const TensorInfo& outputStateOut = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 1411 | const TensorInfo& cellStateOut = OverrideDataType(layer.GetOutputSlot(1).GetTensorInfo(), dataType); |
| 1412 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(2).GetTensorInfo(), dataType); |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 1413 | |
| 1414 | // Basic parameters |
| 1415 | const TensorInfo& inputToForgetWeights |
| 1416 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(), dataType); |
| 1417 | const TensorInfo& inputToCellWeights |
| 1418 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(), dataType); |
| 1419 | const TensorInfo& inputToOutputWeights |
| 1420 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(), dataType); |
| 1421 | const TensorInfo& recurrentToForgetWeights |
| 1422 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(), dataType); |
| 1423 | const TensorInfo& recurrentToCellWeights |
| 1424 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(), dataType); |
| 1425 | const TensorInfo& recurrentToOutputWeights |
| 1426 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(), dataType); |
| 1427 | const TensorInfo& forgetGateBias |
| 1428 | = OverrideDataType(cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(), dataType); |
| 1429 | const TensorInfo& cellBias |
| 1430 | = OverrideDataType(cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(), dataType); |
| 1431 | const TensorInfo& outputGateBias |
| 1432 | = OverrideDataType(cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(), dataType); |
| 1433 | |
| 1434 | LstmInputParamsInfo paramsInfo; |
| 1435 | |
| 1436 | paramsInfo.m_InputToForgetWeights = &inputToForgetWeights; |
| 1437 | paramsInfo.m_InputToCellWeights = &inputToCellWeights; |
| 1438 | paramsInfo.m_InputToOutputWeights = &inputToOutputWeights; |
| 1439 | paramsInfo.m_RecurrentToForgetWeights = &recurrentToForgetWeights; |
| 1440 | paramsInfo.m_RecurrentToCellWeights = &recurrentToCellWeights; |
| 1441 | paramsInfo.m_RecurrentToOutputWeights = &recurrentToOutputWeights; |
| 1442 | paramsInfo.m_ForgetGateBias = &forgetGateBias; |
| 1443 | paramsInfo.m_CellBias = &cellBias; |
| 1444 | paramsInfo.m_OutputGateBias = &outputGateBias; |
| 1445 | |
| 1446 | // Optional parameters |
| 1447 | TensorInfo optInputToInputWeights; |
| 1448 | TensorInfo optRecurrentToInputWeights; |
| 1449 | TensorInfo optCellToInputWeights; |
| 1450 | TensorInfo optInputGateBias; |
| 1451 | TensorInfo optProjectionWeights; |
| 1452 | TensorInfo optProjectionBias; |
| 1453 | TensorInfo optCellToForgetWeights; |
| 1454 | TensorInfo optCellToOutputWeights; |
| 1455 | TensorInfo optInputLayerNormWeights; |
| 1456 | TensorInfo optForgetLayerNormWeights; |
| 1457 | TensorInfo optCellLayerNormWeights; |
| 1458 | TensorInfo optOutputLayerNormWeights; |
| 1459 | |
| 1460 | if(!descriptor.m_CifgEnabled) |
| 1461 | { |
| 1462 | optInputToInputWeights = |
| 1463 | OverrideDataType(cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(), dataType); |
| 1464 | paramsInfo.m_InputToInputWeights = &optInputToInputWeights; |
| 1465 | |
| 1466 | optRecurrentToInputWeights = |
| 1467 | OverrideDataType(cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(), dataType); |
| 1468 | paramsInfo.m_RecurrentToInputWeights = &optRecurrentToInputWeights; |
| 1469 | optInputGateBias = |
| 1470 | OverrideDataType(cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(), dataType); |
| 1471 | paramsInfo.m_InputGateBias = &optInputGateBias; |
| 1472 | } |
| 1473 | |
| 1474 | if(descriptor.m_ProjectionEnabled) |
| 1475 | { |
| 1476 | optProjectionWeights = |
| 1477 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(), dataType); |
| 1478 | paramsInfo.m_ProjectionWeights = &optProjectionWeights; |
| 1479 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 1480 | { |
| 1481 | optProjectionBias = |
| 1482 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(), dataType); |
| 1483 | paramsInfo.m_ProjectionBias = &optProjectionBias; |
| 1484 | } |
| 1485 | } |
| 1486 | |
| 1487 | if(descriptor.m_PeepholeEnabled) |
| 1488 | { |
| 1489 | if(!descriptor.m_CifgEnabled) |
| 1490 | { |
| 1491 | optCellToInputWeights = |
| 1492 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(), |
| 1493 | dataType); |
| 1494 | paramsInfo.m_CellToInputWeights = &optCellToInputWeights; |
| 1495 | } |
| 1496 | optCellToForgetWeights = |
| 1497 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(), dataType); |
| 1498 | paramsInfo.m_CellToForgetWeights = &optCellToForgetWeights; |
| 1499 | optCellToOutputWeights = |
| 1500 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(), dataType); |
| 1501 | paramsInfo.m_CellToOutputWeights = &optCellToOutputWeights; |
| 1502 | } |
| 1503 | |
| 1504 | if(descriptor.m_LayerNormEnabled) |
| 1505 | { |
| 1506 | if (!descriptor.m_CifgEnabled) |
| 1507 | { |
| 1508 | optInputLayerNormWeights = OverrideDataType( |
| 1509 | cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(), dataType); |
| 1510 | paramsInfo.m_InputLayerNormWeights = &optInputLayerNormWeights; |
| 1511 | } |
| 1512 | |
| 1513 | optForgetLayerNormWeights = OverrideDataType( |
| 1514 | cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(), dataType); |
| 1515 | paramsInfo.m_ForgetLayerNormWeights = &optForgetLayerNormWeights; |
| 1516 | |
| 1517 | optCellLayerNormWeights = OverrideDataType( |
| 1518 | cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(), dataType); |
| 1519 | paramsInfo.m_CellLayerNormWeights = &optCellLayerNormWeights; |
| 1520 | |
| 1521 | optOutputLayerNormWeights = OverrideDataType( |
| 1522 | cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(), dataType); |
| 1523 | paramsInfo.m_OutputLayerNormWeights = &optOutputLayerNormWeights; |
| 1524 | } |
| 1525 | |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 1526 | result = layerSupportObject.IsUnidirectionalSequenceLstmSupported(input, |
| 1527 | outputStateIn, |
| 1528 | cellStateIn, |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 1529 | outputStateOut, |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 1530 | cellStateOut, |
Mike Kelly | 1299496 | 2022-04-21 11:57:09 +0100 | [diff] [blame] | 1531 | output, |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 1532 | descriptor, |
| 1533 | paramsInfo, |
| 1534 | reason); |
| 1535 | break; |
| 1536 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1537 | default: |
| 1538 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1539 | ARMNN_ASSERT_MSG(false, "WorkloadFactory did not recognise type of layer."); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1540 | reason.value() = "Unrecognised layer type"; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1541 | result = false; |
| 1542 | break; |
| 1543 | } |
| 1544 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1545 | return result; |
| 1546 | } |
| 1547 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1548 | bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId, |
| 1549 | const IConnectableLayer& connectableLayer, |
| 1550 | Optional<DataType> dataType, |
| 1551 | std::string& outReasonIfUnsupported) |
| 1552 | { |
| 1553 | return IsLayerConfigurationSupported(backendId, connectableLayer, dataType, outReasonIfUnsupported); |
| 1554 | } |
| 1555 | |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 1556 | bool IWorkloadFactory::IsLayerSupported(const IConnectableLayer& connectableLayer, |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 1557 | Optional<DataType> dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1558 | std::string& outReasonIfUnsupported) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1559 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1560 | auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer); |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1561 | return IsLayerConfigurationSupported(layer->GetBackendId(), connectableLayer, dataType, outReasonIfUnsupported); |
| 1562 | } |
| 1563 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1564 | bool IWorkloadFactory::IsLayerSupported(const IConnectableLayer& connectableLayer, |
| 1565 | Optional<DataType> dataType, |
| 1566 | std::string& outReasonIfUnsupported, |
| 1567 | const ModelOptions& modelOptions) |
| 1568 | { |
| 1569 | auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer); |
| 1570 | return IsLayerConfigurationSupported(layer->GetBackendId(), |
| 1571 | connectableLayer, |
| 1572 | dataType, |
| 1573 | outReasonIfUnsupported, |
| 1574 | modelOptions); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1575 | } |
| 1576 | |
Sadik Armagan | 04a7297 | 2020-09-14 15:44:18 +0100 | [diff] [blame] | 1577 | bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId, |
| 1578 | const IConnectableLayer& connectableLayer, |
| 1579 | Optional<DataType> dataType, |
| 1580 | std::string& outReasonIfUnsupported, |
| 1581 | const ModelOptions& modelOptions) |
| 1582 | { |
| 1583 | return IsLayerConfigurationSupported(backendId, |
| 1584 | connectableLayer, |
| 1585 | dataType, |
| 1586 | outReasonIfUnsupported, |
| 1587 | modelOptions); |
| 1588 | } |
Teresa Charlin | 611c7fb | 2022-01-07 09:47:29 +0000 | [diff] [blame] | 1589 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
| 1590 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateWorkload(LayerType type, |
| 1591 | const QueueDescriptor& descriptor, |
| 1592 | const WorkloadInfo& info) const |
| 1593 | { |
| 1594 | switch(type) |
| 1595 | { |
| 1596 | case LayerType::Activation : |
| 1597 | { |
| 1598 | auto activationQueueDescriptor = PolymorphicDowncast<const ActivationQueueDescriptor*>(&descriptor); |
| 1599 | return CreateActivation(*activationQueueDescriptor, info); |
| 1600 | } |
| 1601 | case LayerType::Addition : |
| 1602 | { |
| 1603 | auto additionQueueDescriptor = PolymorphicDowncast<const AdditionQueueDescriptor*>(&descriptor); |
| 1604 | return CreateAddition(*additionQueueDescriptor, info); |
| 1605 | } |
| 1606 | case LayerType::ArgMinMax : |
| 1607 | { |
| 1608 | auto argMinMaxQueueDescriptor = PolymorphicDowncast<const ArgMinMaxQueueDescriptor*>(&descriptor); |
| 1609 | return CreateArgMinMax(*argMinMaxQueueDescriptor, info); |
| 1610 | } |
| 1611 | case LayerType::BatchNormalization : |
| 1612 | { |
| 1613 | auto batchNormQueueDescriptor = PolymorphicDowncast<const BatchNormalizationQueueDescriptor*>(&descriptor); |
| 1614 | return CreateBatchNormalization(*batchNormQueueDescriptor, info); |
| 1615 | } |
| 1616 | case LayerType::BatchToSpaceNd : |
| 1617 | { |
| 1618 | auto batchToSpaceNdQueueDescriptor |
| 1619 | = PolymorphicDowncast<const BatchToSpaceNdQueueDescriptor*>(&descriptor); |
| 1620 | return CreateBatchToSpaceNd(*batchToSpaceNdQueueDescriptor, info); |
| 1621 | } |
| 1622 | case LayerType::Cast : |
| 1623 | { |
| 1624 | auto castQueueDescriptor = PolymorphicDowncast<const CastQueueDescriptor*>(&descriptor); |
| 1625 | return CreateCast(*castQueueDescriptor, info); |
| 1626 | } |
| 1627 | case LayerType::ChannelShuffle : |
| 1628 | { |
| 1629 | auto channelShuffleQueueDescriptor |
| 1630 | = PolymorphicDowncast<const ChannelShuffleQueueDescriptor*>(&descriptor); |
| 1631 | return CreateChannelShuffle(*channelShuffleQueueDescriptor, info); |
| 1632 | } |
| 1633 | case LayerType::Comparison : |
| 1634 | { |
| 1635 | auto comparisonQueueDescriptor = PolymorphicDowncast<const ComparisonQueueDescriptor*>(&descriptor); |
| 1636 | return CreateComparison(*comparisonQueueDescriptor, info); |
| 1637 | } |
| 1638 | case LayerType::Concat : |
| 1639 | { |
| 1640 | auto concatQueueDescriptor = PolymorphicDowncast<const ConcatQueueDescriptor*>(&descriptor); |
| 1641 | return CreateConcat(*concatQueueDescriptor, info); |
| 1642 | } |
| 1643 | case LayerType::Constant : |
| 1644 | { |
| 1645 | auto constantQueueDescriptor = PolymorphicDowncast<const ConstantQueueDescriptor*>(&descriptor); |
| 1646 | return CreateConstant(*constantQueueDescriptor, info); |
| 1647 | } |
Teresa Charlin | 611c7fb | 2022-01-07 09:47:29 +0000 | [diff] [blame] | 1648 | case LayerType::ConvertFp16ToFp32: |
| 1649 | { |
| 1650 | auto convertFp16ToFp32QueueDescriptor |
| 1651 | = PolymorphicDowncast<const ConvertFp16ToFp32QueueDescriptor*>(&descriptor); |
| 1652 | return CreateConvertFp16ToFp32(*convertFp16ToFp32QueueDescriptor, info); |
| 1653 | } |
Teresa Charlin | 611c7fb | 2022-01-07 09:47:29 +0000 | [diff] [blame] | 1654 | case LayerType::ConvertFp32ToFp16: |
| 1655 | { |
| 1656 | auto convertFp32ToFp16QueueDescriptor |
| 1657 | = PolymorphicDowncast<const ConvertFp32ToFp16QueueDescriptor*>(&descriptor); |
| 1658 | return CreateConvertFp32ToFp16(*convertFp32ToFp16QueueDescriptor, info); |
| 1659 | } |
| 1660 | case LayerType::Convolution2d: |
| 1661 | { |
| 1662 | auto convolution2dQueueDescriptor = PolymorphicDowncast<const Convolution2dQueueDescriptor*>(&descriptor); |
| 1663 | return CreateConvolution2d(*convolution2dQueueDescriptor, info); |
| 1664 | } |
| 1665 | case LayerType::Convolution3d: |
| 1666 | { |
| 1667 | auto convolution3dQueueDescriptor = PolymorphicDowncast<const Convolution3dQueueDescriptor*>(&descriptor); |
| 1668 | return CreateConvolution3d(*convolution3dQueueDescriptor, info); |
| 1669 | } |
| 1670 | case LayerType::Debug: |
| 1671 | { |
| 1672 | auto debugQueueDescriptor = PolymorphicDowncast<const DebugQueueDescriptor*>(&descriptor); |
| 1673 | return CreateDebug(*debugQueueDescriptor, info); |
| 1674 | } |
| 1675 | case LayerType::DepthToSpace: |
| 1676 | { |
| 1677 | auto depthToSpaceQueueDescriptor = PolymorphicDowncast<const DepthToSpaceQueueDescriptor*>(&descriptor); |
| 1678 | return CreateDepthToSpace(*depthToSpaceQueueDescriptor, info); |
| 1679 | } |
| 1680 | case LayerType::DepthwiseConvolution2d: |
| 1681 | { |
| 1682 | auto depthwiseConvolution2DQueueDescriptor |
| 1683 | = PolymorphicDowncast<const DepthwiseConvolution2dQueueDescriptor*>(&descriptor); |
| 1684 | return CreateDepthwiseConvolution2d(*depthwiseConvolution2DQueueDescriptor, info); |
| 1685 | } |
| 1686 | case LayerType::Dequantize: |
| 1687 | { |
| 1688 | auto dequantizeQueueDescriptor = PolymorphicDowncast<const DequantizeQueueDescriptor*>(&descriptor); |
| 1689 | return CreateDequantize(*dequantizeQueueDescriptor, info); |
| 1690 | } |
| 1691 | case LayerType::DetectionPostProcess: |
| 1692 | { |
| 1693 | auto detectionPostProcessQueueDescriptor |
| 1694 | = PolymorphicDowncast<const DetectionPostProcessQueueDescriptor*>(&descriptor); |
| 1695 | return CreateDetectionPostProcess(*detectionPostProcessQueueDescriptor, info); |
| 1696 | } |
| 1697 | case LayerType::Division: |
| 1698 | { |
| 1699 | auto divisionQueueDescriptor = PolymorphicDowncast<const DivisionQueueDescriptor*>(&descriptor); |
| 1700 | return CreateDivision(*divisionQueueDescriptor, info); |
| 1701 | } |
Mike Kelly | 3ec3077 | 2023-03-08 13:47:17 +0000 | [diff] [blame] | 1702 | case LayerType::ElementwiseBinary: |
| 1703 | { |
| 1704 | auto queueDescriptor = PolymorphicDowncast<const ElementwiseBinaryQueueDescriptor*>(&descriptor); |
| 1705 | return CreateWorkload(LayerType::ElementwiseBinary, *queueDescriptor, info); |
| 1706 | } |
Teresa Charlin | 611c7fb | 2022-01-07 09:47:29 +0000 | [diff] [blame] | 1707 | case LayerType::ElementwiseUnary: |
| 1708 | { |
| 1709 | auto elementwiseUnaryQueueDescriptor |
| 1710 | = PolymorphicDowncast<const ElementwiseUnaryQueueDescriptor*>(&descriptor); |
| 1711 | return CreateElementwiseUnary(*elementwiseUnaryQueueDescriptor, info); |
| 1712 | |
| 1713 | } |
| 1714 | case LayerType::FakeQuantization: |
| 1715 | { |
| 1716 | auto fakeQuantizationQueueDescriptor |
| 1717 | = PolymorphicDowncast<const FakeQuantizationQueueDescriptor*>(&descriptor); |
| 1718 | return CreateFakeQuantization(*fakeQuantizationQueueDescriptor, info); |
| 1719 | } |
| 1720 | case LayerType::Fill: |
| 1721 | { |
| 1722 | auto fillQueueDescriptor = PolymorphicDowncast<const FillQueueDescriptor*>(&descriptor); |
| 1723 | return CreateFill(*fillQueueDescriptor, info); |
| 1724 | } |
| 1725 | case LayerType::Floor: |
| 1726 | { |
| 1727 | auto floorQueueDescriptor = PolymorphicDowncast<const FloorQueueDescriptor*>(&descriptor); |
| 1728 | return CreateFloor(*floorQueueDescriptor, info); |
| 1729 | } |
| 1730 | case LayerType::FullyConnected: |
| 1731 | { |
| 1732 | auto fullyConnectedQueueDescriptor |
| 1733 | = PolymorphicDowncast<const FullyConnectedQueueDescriptor*>(&descriptor); |
| 1734 | return CreateFullyConnected(*fullyConnectedQueueDescriptor, info); |
| 1735 | } |
| 1736 | case LayerType::Gather: |
| 1737 | { |
| 1738 | auto gatherQueueDescriptor = PolymorphicDowncast<const GatherQueueDescriptor*>(&descriptor); |
| 1739 | return CreateGather(*gatherQueueDescriptor, info); |
| 1740 | } |
| 1741 | case LayerType::Input: |
| 1742 | { |
| 1743 | auto inputQueueDescriptor = PolymorphicDowncast<const InputQueueDescriptor*>(&descriptor); |
| 1744 | return CreateInput(*inputQueueDescriptor, info); |
| 1745 | } |
| 1746 | case LayerType::InstanceNormalization: |
| 1747 | { |
| 1748 | auto instanceNormalizationQueueDescriptor |
| 1749 | = PolymorphicDowncast<const InstanceNormalizationQueueDescriptor*>(&descriptor); |
| 1750 | return CreateInstanceNormalization(*instanceNormalizationQueueDescriptor, info); |
| 1751 | } |
| 1752 | case LayerType::L2Normalization: |
| 1753 | { |
| 1754 | auto l2NormalizationQueueDescriptor |
| 1755 | = PolymorphicDowncast<const L2NormalizationQueueDescriptor*>(&descriptor); |
| 1756 | return CreateL2Normalization(*l2NormalizationQueueDescriptor, info); |
| 1757 | } |
| 1758 | case LayerType::LogicalBinary: |
| 1759 | { |
| 1760 | auto logicalBinaryQueueDescriptor = PolymorphicDowncast<const LogicalBinaryQueueDescriptor*>(&descriptor); |
| 1761 | return CreateLogicalBinary(*logicalBinaryQueueDescriptor, info); |
| 1762 | } |
| 1763 | case LayerType::LogSoftmax: |
| 1764 | { |
| 1765 | auto logSoftmaxQueueDescriptor = PolymorphicDowncast<const LogSoftmaxQueueDescriptor*>(&descriptor); |
| 1766 | return CreateLogSoftmax(*logSoftmaxQueueDescriptor, info); |
| 1767 | } |
| 1768 | case LayerType::Lstm: |
| 1769 | { |
| 1770 | auto lstmQueueDescriptor = PolymorphicDowncast<const LstmQueueDescriptor*>(&descriptor); |
| 1771 | return CreateLstm(*lstmQueueDescriptor, info); |
| 1772 | } |
| 1773 | case LayerType::Maximum: |
| 1774 | { |
| 1775 | auto maximumQueueDescriptor = PolymorphicDowncast<const MaximumQueueDescriptor*>(&descriptor); |
| 1776 | return CreateMaximum(*maximumQueueDescriptor, info); |
| 1777 | } |
| 1778 | case LayerType::Mean: |
| 1779 | { |
| 1780 | auto meanQueueDescriptor = PolymorphicDowncast<const MeanQueueDescriptor*>(&descriptor); |
| 1781 | return CreateMean(*meanQueueDescriptor, info); |
| 1782 | } |
| 1783 | case LayerType::MemCopy: |
| 1784 | { |
| 1785 | auto memCopyQueueDescriptor = PolymorphicDowncast<const MemCopyQueueDescriptor*>(&descriptor); |
| 1786 | return CreateMemCopy(*memCopyQueueDescriptor, info); |
| 1787 | } |
| 1788 | case LayerType::MemImport: |
| 1789 | { |
| 1790 | auto memImportQueueDescriptor = PolymorphicDowncast<const MemImportQueueDescriptor*>(&descriptor); |
| 1791 | return CreateMemImport(*memImportQueueDescriptor, info); |
| 1792 | } |
| 1793 | case LayerType::Minimum: |
| 1794 | { |
| 1795 | auto minimumQueueDescriptor = PolymorphicDowncast<const MinimumQueueDescriptor*>(&descriptor); |
| 1796 | return CreateMinimum(*minimumQueueDescriptor, info); |
| 1797 | } |
| 1798 | case LayerType::Multiplication: |
| 1799 | { |
| 1800 | auto multiplicationQueueDescriptor |
| 1801 | = PolymorphicDowncast<const MultiplicationQueueDescriptor*>(&descriptor); |
| 1802 | return CreateMultiplication(*multiplicationQueueDescriptor, info); |
| 1803 | } |
| 1804 | case LayerType::Normalization: |
| 1805 | { |
| 1806 | auto normalizationQueueDescriptor = PolymorphicDowncast<const NormalizationQueueDescriptor*>(&descriptor); |
| 1807 | return CreateNormalization(*normalizationQueueDescriptor, info); |
| 1808 | } |
| 1809 | case LayerType::Output: |
| 1810 | { |
| 1811 | auto outputQueueDescriptor = PolymorphicDowncast<const OutputQueueDescriptor*>(&descriptor); |
| 1812 | return CreateOutput(*outputQueueDescriptor, info); |
| 1813 | } |
| 1814 | case LayerType::Pad: |
| 1815 | { |
| 1816 | auto padQueueDescriptor = PolymorphicDowncast<const PadQueueDescriptor*>(&descriptor); |
| 1817 | return CreatePad(*padQueueDescriptor, info); |
| 1818 | } |
| 1819 | case LayerType::Permute: |
| 1820 | { |
| 1821 | auto permuteQueueDescriptor = PolymorphicDowncast<const PermuteQueueDescriptor*>(&descriptor); |
| 1822 | return CreatePermute(*permuteQueueDescriptor, info); |
| 1823 | } |
| 1824 | case LayerType::Pooling2d: |
| 1825 | { |
| 1826 | auto pooling2dQueueDescriptor = PolymorphicDowncast<const Pooling2dQueueDescriptor*>(&descriptor); |
| 1827 | return CreatePooling2d(*pooling2dQueueDescriptor, info); |
| 1828 | } |
| 1829 | case LayerType::Pooling3d: |
| 1830 | { |
| 1831 | auto pooling3dQueueDescriptor = PolymorphicDowncast<const Pooling3dQueueDescriptor*>(&descriptor); |
| 1832 | return CreatePooling3d(*pooling3dQueueDescriptor, info); |
| 1833 | } |
| 1834 | case LayerType::PreCompiled: |
| 1835 | { |
| 1836 | auto preCompiledQueueDescriptor = PolymorphicDowncast<const PreCompiledQueueDescriptor*>(&descriptor); |
| 1837 | return CreatePreCompiled(*preCompiledQueueDescriptor, info); |
| 1838 | } |
| 1839 | case LayerType::Prelu: |
| 1840 | { |
| 1841 | auto preluQueueDescriptor = PolymorphicDowncast<const PreluQueueDescriptor*>(&descriptor); |
| 1842 | return CreatePrelu(*preluQueueDescriptor, info); |
| 1843 | } |
| 1844 | case LayerType::QLstm: |
| 1845 | { |
| 1846 | auto qlstmQueueDescriptor = PolymorphicDowncast<const QLstmQueueDescriptor*>(&descriptor); |
| 1847 | return CreateQLstm(*qlstmQueueDescriptor, info); |
| 1848 | } |
| 1849 | case LayerType::Quantize: |
| 1850 | { |
| 1851 | auto quantizeQueueDescriptor = PolymorphicDowncast<const QuantizeQueueDescriptor*>(&descriptor); |
| 1852 | return CreateQuantize(*quantizeQueueDescriptor, info); |
| 1853 | } |
| 1854 | case LayerType::Rank: |
| 1855 | { |
| 1856 | auto rankQueueDescriptor = PolymorphicDowncast<const RankQueueDescriptor*>(&descriptor); |
| 1857 | return CreateRank(*rankQueueDescriptor, info); |
| 1858 | } |
| 1859 | case LayerType::Reduce: |
| 1860 | { |
| 1861 | auto reduceQueueDescriptor = PolymorphicDowncast<const ReduceQueueDescriptor*>(&descriptor); |
| 1862 | return CreateReduce(*reduceQueueDescriptor, info); |
| 1863 | } |
| 1864 | case LayerType::Reshape: |
| 1865 | { |
| 1866 | auto reshapeQueueDescriptor = PolymorphicDowncast<const ReshapeQueueDescriptor*>(&descriptor); |
| 1867 | return CreateReshape(*reshapeQueueDescriptor, info); |
| 1868 | } |
| 1869 | case LayerType::Resize: |
| 1870 | { |
| 1871 | auto resizeQueueDescriptor = PolymorphicDowncast<const ResizeQueueDescriptor*>(&descriptor); |
| 1872 | return CreateResize(*resizeQueueDescriptor, info); |
| 1873 | } |
| 1874 | case LayerType::Shape: |
| 1875 | { |
| 1876 | auto shapeQueueDescriptor = PolymorphicDowncast<const ShapeQueueDescriptor*>(&descriptor); |
| 1877 | return CreateShape(*shapeQueueDescriptor, info); |
| 1878 | } |
| 1879 | case LayerType::Slice: |
| 1880 | { |
| 1881 | auto sliceQueueDescriptor = PolymorphicDowncast<const SliceQueueDescriptor*>(&descriptor); |
| 1882 | return CreateSlice(*sliceQueueDescriptor, info); |
| 1883 | } |
| 1884 | case LayerType::Softmax: |
| 1885 | { |
| 1886 | auto softmaxQueueDescriptor = PolymorphicDowncast<const SoftmaxQueueDescriptor*>(&descriptor); |
| 1887 | return CreateSoftmax(*softmaxQueueDescriptor, info); |
| 1888 | } |
| 1889 | case LayerType::SpaceToBatchNd: |
| 1890 | { |
| 1891 | auto spaceToBatchNdQueueDescriptor |
| 1892 | = PolymorphicDowncast<const SpaceToBatchNdQueueDescriptor*>(&descriptor); |
| 1893 | return CreateSpaceToBatchNd(*spaceToBatchNdQueueDescriptor, info); |
| 1894 | } |
| 1895 | case LayerType::SpaceToDepth: |
| 1896 | { |
| 1897 | auto spaceToDepthQueueDescriptor = PolymorphicDowncast<const SpaceToDepthQueueDescriptor*>(&descriptor); |
| 1898 | return CreateSpaceToDepth(*spaceToDepthQueueDescriptor, info); |
| 1899 | } |
| 1900 | case LayerType::Splitter: |
| 1901 | { |
| 1902 | auto splitterQueueDescriptor = PolymorphicDowncast<const SplitterQueueDescriptor*>(&descriptor); |
| 1903 | return CreateSplitter(*splitterQueueDescriptor, info); |
| 1904 | } |
| 1905 | case LayerType::Stack: |
| 1906 | { |
| 1907 | auto stackQueueDescriptor = PolymorphicDowncast<const StackQueueDescriptor*>(&descriptor); |
| 1908 | return CreateStack(*stackQueueDescriptor, info); |
| 1909 | } |
| 1910 | case LayerType::StridedSlice: |
| 1911 | { |
| 1912 | auto stridedSliceQueueDescriptor = PolymorphicDowncast<const StridedSliceQueueDescriptor*>(&descriptor); |
| 1913 | return CreateStridedSlice(*stridedSliceQueueDescriptor, info); |
| 1914 | } |
| 1915 | case LayerType::Subtraction: |
| 1916 | { |
| 1917 | auto subtractionQueueDescriptor = PolymorphicDowncast<const SubtractionQueueDescriptor*>(&descriptor); |
| 1918 | return CreateSubtraction(*subtractionQueueDescriptor, info); |
| 1919 | } |
| 1920 | case LayerType::Transpose: |
| 1921 | { |
| 1922 | auto transposeQueueDescriptor = PolymorphicDowncast<const TransposeQueueDescriptor*>(&descriptor); |
| 1923 | return CreateTranspose(*transposeQueueDescriptor, info); |
| 1924 | } |
| 1925 | case LayerType::TransposeConvolution2d: |
| 1926 | { |
| 1927 | auto transposeConvolution2dQueueDescriptor |
| 1928 | = PolymorphicDowncast<const TransposeConvolution2dQueueDescriptor*>(&descriptor); |
| 1929 | return CreateTransposeConvolution2d(*transposeConvolution2dQueueDescriptor, info); |
| 1930 | } |
| 1931 | case LayerType::UnidirectionalSequenceLstm: |
| 1932 | { |
| 1933 | auto unidirectionalSequenceLstmQueueDescriptor |
| 1934 | = PolymorphicDowncast<const UnidirectionalSequenceLstmQueueDescriptor*>(&descriptor); |
| 1935 | return CreateUnidirectionalSequenceLstm(*unidirectionalSequenceLstmQueueDescriptor, info); |
| 1936 | } |
| 1937 | default: |
| 1938 | return nullptr; |
| 1939 | } |
| 1940 | } |
| 1941 | ARMNN_NO_DEPRECATE_WARN_END |
Sadik Armagan | 04a7297 | 2020-09-14 15:44:18 +0100 | [diff] [blame] | 1942 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1943 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateActivation(const ActivationQueueDescriptor& /*descriptor*/, |
| 1944 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1945 | { |
| 1946 | return std::unique_ptr<IWorkload>(); |
| 1947 | } |
| 1948 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1949 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateAddition(const AdditionQueueDescriptor& /*descriptor*/, |
| 1950 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1951 | { |
| 1952 | return std::unique_ptr<IWorkload>(); |
| 1953 | } |
| 1954 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1955 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateArgMinMax(const ArgMinMaxQueueDescriptor& /*descriptor*/, |
| 1956 | const WorkloadInfo& /*info*/) const |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 1957 | { |
| 1958 | return std::unique_ptr<IWorkload>(); |
| 1959 | } |
| 1960 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1961 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchNormalization( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1962 | const BatchNormalizationQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1963 | { |
| 1964 | return std::unique_ptr<IWorkload>(); |
| 1965 | } |
| 1966 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1967 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchToSpaceNd(const BatchToSpaceNdQueueDescriptor& /*desc*/, |
| 1968 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1969 | { |
| 1970 | return std::unique_ptr<IWorkload>(); |
| 1971 | } |
| 1972 | |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 1973 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateCast(const CastQueueDescriptor& /*descriptor*/, |
| 1974 | const WorkloadInfo& /*info*/) const |
| 1975 | { |
| 1976 | return std::unique_ptr<IWorkload>(); |
| 1977 | } |
| 1978 | |
Simon Obute | 51f6777 | 2021-09-03 15:50:13 +0100 | [diff] [blame] | 1979 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateChannelShuffle(const ChannelShuffleQueueDescriptor& /*descriptor*/, |
| 1980 | const WorkloadInfo& /*info*/) const |
| 1981 | { |
| 1982 | return std::unique_ptr<IWorkload>(); |
| 1983 | } |
| 1984 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1985 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateComparison(const ComparisonQueueDescriptor& /*descriptor*/, |
| 1986 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 1987 | { |
| 1988 | return std::unique_ptr<IWorkload>(); |
| 1989 | } |
| 1990 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1991 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConcat(const ConcatQueueDescriptor& /*descriptor*/, |
| 1992 | const WorkloadInfo& /*info*/) const |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 1993 | { |
| 1994 | return std::unique_ptr<IWorkload>(); |
| 1995 | } |
| 1996 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1997 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& /*descriptor*/, |
| 1998 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1999 | { |
| 2000 | return std::unique_ptr<IWorkload>(); |
| 2001 | } |
| 2002 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2003 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp16ToFp32(const ConvertFp16ToFp32QueueDescriptor& /*desc*/, |
| 2004 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2005 | { |
| 2006 | return std::unique_ptr<IWorkload>(); |
| 2007 | } |
| 2008 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2009 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp32ToFp16(const ConvertFp32ToFp16QueueDescriptor& /*desc*/, |
| 2010 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2011 | { |
| 2012 | return std::unique_ptr<IWorkload>(); |
| 2013 | } |
| 2014 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2015 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvolution2d(const Convolution2dQueueDescriptor& /*descriptor*/, |
| 2016 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2017 | { |
| 2018 | return std::unique_ptr<IWorkload>(); |
| 2019 | } |
| 2020 | |
Matthew Sloyan | b63a311 | 2021-09-08 13:05:51 +0100 | [diff] [blame] | 2021 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvolution3d(const Convolution3dQueueDescriptor& /*descriptor*/, |
| 2022 | const WorkloadInfo& /*info*/) const |
| 2023 | { |
| 2024 | return std::unique_ptr<IWorkload>(); |
| 2025 | } |
| 2026 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2027 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDebug(const DebugQueueDescriptor& /*descriptor*/, |
| 2028 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2029 | { |
| 2030 | return std::unique_ptr<IWorkload>(); |
| 2031 | } |
| 2032 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2033 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDepthToSpace(const DepthToSpaceQueueDescriptor& /*descriptor*/, |
| 2034 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 2035 | { |
| 2036 | return std::unique_ptr<IWorkload>(); |
| 2037 | } |
| 2038 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2039 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDepthwiseConvolution2d( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2040 | const DepthwiseConvolution2dQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2041 | { |
| 2042 | return std::unique_ptr<IWorkload>(); |
| 2043 | } |
| 2044 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 2045 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDequantize( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2046 | const DequantizeQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 2047 | { |
| 2048 | return std::unique_ptr<IWorkload>(); |
| 2049 | } |
| 2050 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2051 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDetectionPostProcess( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2052 | const DetectionPostProcessQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2053 | { |
| 2054 | return std::unique_ptr<IWorkload>(); |
| 2055 | } |
| 2056 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2057 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDivision(const DivisionQueueDescriptor& /*descriptor*/, |
| 2058 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2059 | { |
| 2060 | return std::unique_ptr<IWorkload>(); |
| 2061 | } |
| 2062 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 2063 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateElementwiseUnary(const ElementwiseUnaryQueueDescriptor& /*desc*/, |
| 2064 | const WorkloadInfo& /*info*/) const |
| 2065 | { |
| 2066 | return std::unique_ptr<IWorkload>(); |
| 2067 | } |
| 2068 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2069 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFakeQuantization(const FakeQuantizationQueueDescriptor& /*desc*/, |
| 2070 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2071 | { |
| 2072 | return std::unique_ptr<IWorkload>(); |
| 2073 | } |
| 2074 | |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 2075 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFill(const FillQueueDescriptor& /*descriptor*/, |
| 2076 | const WorkloadInfo& /*info*/) const |
| 2077 | { |
| 2078 | return std::unique_ptr<IWorkload>(); |
| 2079 | } |
| 2080 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2081 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFloor(const FloorQueueDescriptor& /*descriptor*/, |
| 2082 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2083 | { |
| 2084 | return std::unique_ptr<IWorkload>(); |
| 2085 | } |
| 2086 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2087 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFullyConnected(const FullyConnectedQueueDescriptor& /*descriptor*/, |
| 2088 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2089 | { |
| 2090 | return std::unique_ptr<IWorkload>(); |
| 2091 | } |
| 2092 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2093 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateGather(const GatherQueueDescriptor& /*descriptor*/, |
| 2094 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2095 | { |
| 2096 | return std::unique_ptr<IWorkload>(); |
| 2097 | } |
| 2098 | |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 2099 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateInstanceNormalization( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2100 | const InstanceNormalizationQueueDescriptor& /*descriptor*/, |
| 2101 | const WorkloadInfo& /*info*/) const |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 2102 | { |
| 2103 | return std::unique_ptr<IWorkload>(); |
| 2104 | } |
| 2105 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2106 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateL2Normalization(const L2NormalizationQueueDescriptor& /*desc*/, |
| 2107 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2108 | { |
| 2109 | return std::unique_ptr<IWorkload>(); |
| 2110 | } |
| 2111 | |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 2112 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogicalBinary(const LogicalBinaryQueueDescriptor& /*desc*/, |
| 2113 | const WorkloadInfo& /*info*/) const |
| 2114 | { |
| 2115 | return std::unique_ptr<IWorkload>(); |
| 2116 | } |
| 2117 | |
| 2118 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogicalUnary(const ElementwiseUnaryQueueDescriptor& /*desc*/, |
| 2119 | const WorkloadInfo& /*info*/) const |
| 2120 | { |
| 2121 | return std::unique_ptr<IWorkload>(); |
| 2122 | } |
| 2123 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2124 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogSoftmax(const LogSoftmaxQueueDescriptor& /*descriptor*/, |
| 2125 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 2126 | { |
| 2127 | return std::unique_ptr<IWorkload>(); |
| 2128 | } |
| 2129 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2130 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLstm(const LstmQueueDescriptor& /*descriptor*/, |
| 2131 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2132 | { |
| 2133 | return std::unique_ptr<IWorkload>(); |
| 2134 | } |
| 2135 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2136 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMaximum(const MaximumQueueDescriptor& /*descriptor*/, |
| 2137 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2138 | { |
| 2139 | return std::unique_ptr<IWorkload>(); |
| 2140 | } |
| 2141 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2142 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMean(const MeanQueueDescriptor& /*descriptor*/, |
| 2143 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2144 | { |
| 2145 | return std::unique_ptr<IWorkload>(); |
| 2146 | } |
| 2147 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2148 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMemCopy(const MemCopyQueueDescriptor& /*descriptor*/, |
| 2149 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2150 | { |
| 2151 | return std::unique_ptr<IWorkload>(); |
| 2152 | } |
| 2153 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2154 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMemImport(const MemImportQueueDescriptor& /*descriptor*/, |
| 2155 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 2156 | { |
| 2157 | return std::unique_ptr<IWorkload>(); |
| 2158 | } |
| 2159 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2160 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMerge(const MergeQueueDescriptor& /*descriptor*/, |
| 2161 | const WorkloadInfo& /*info*/) const |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 2162 | { |
| 2163 | return std::unique_ptr<IWorkload>(); |
| 2164 | } |
| 2165 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2166 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMinimum(const MinimumQueueDescriptor& /*descriptor*/, |
| 2167 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2168 | { |
| 2169 | return std::unique_ptr<IWorkload>(); |
| 2170 | } |
| 2171 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2172 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMultiplication(const MultiplicationQueueDescriptor& /*descriptor*/, |
| 2173 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2174 | { |
| 2175 | return std::unique_ptr<IWorkload>(); |
| 2176 | } |
| 2177 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2178 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateNormalization(const NormalizationQueueDescriptor& /*descriptor*/, |
| 2179 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2180 | { |
| 2181 | return std::unique_ptr<IWorkload>(); |
| 2182 | } |
| 2183 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2184 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateOutput(const OutputQueueDescriptor& /*descriptor*/, |
| 2185 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2186 | { |
| 2187 | return std::unique_ptr<IWorkload>(); |
| 2188 | } |
| 2189 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2190 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePad(const PadQueueDescriptor& /*descriptor*/, |
| 2191 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2192 | { |
| 2193 | return std::unique_ptr<IWorkload>(); |
| 2194 | } |
| 2195 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2196 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePermute(const PermuteQueueDescriptor& /*descriptor*/, |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 2197 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2198 | { |
| 2199 | return std::unique_ptr<IWorkload>(); |
| 2200 | } |
| 2201 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2202 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePooling2d(const Pooling2dQueueDescriptor& /*descriptor*/, |
| 2203 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2204 | { |
| 2205 | return std::unique_ptr<IWorkload>(); |
| 2206 | } |
| 2207 | |
Tamás Nyíri | 7b885b3 | 2021-10-26 14:47:57 +0100 | [diff] [blame] | 2208 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePooling3d(const Pooling3dQueueDescriptor& /*descriptor*/, |
| 2209 | const WorkloadInfo& /*info*/) const |
| 2210 | { |
| 2211 | return std::unique_ptr<IWorkload>(); |
| 2212 | } |
| 2213 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2214 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePreCompiled(const PreCompiledQueueDescriptor& /*descriptor*/, |
| 2215 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2216 | { |
| 2217 | return std::unique_ptr<IWorkload>(); |
| 2218 | } |
| 2219 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2220 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePrelu(const PreluQueueDescriptor &/*descriptor*/, |
| 2221 | const WorkloadInfo &/*info*/) const |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 2222 | { |
| 2223 | return std::unique_ptr<IWorkload>(); |
| 2224 | } |
| 2225 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2226 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQuantize(const QuantizeQueueDescriptor& /*descriptor*/, |
| 2227 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2228 | { |
| 2229 | return std::unique_ptr<IWorkload>(); |
| 2230 | } |
| 2231 | |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 2232 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQLstm(const QLstmQueueDescriptor& /*descriptor*/, |
| 2233 | const WorkloadInfo& /*info*/) const |
| 2234 | { |
| 2235 | return std::unique_ptr<IWorkload>(); |
| 2236 | } |
| 2237 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2238 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQuantizedLstm(const QuantizedLstmQueueDescriptor& /*descriptor*/, |
| 2239 | const WorkloadInfo& /*info*/) const |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 2240 | { |
| 2241 | return std::unique_ptr<IWorkload>(); |
| 2242 | } |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 2243 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateRank(const RankQueueDescriptor& /*descriptor*/, |
| 2244 | const WorkloadInfo& /*info*/) const |
| 2245 | { |
| 2246 | return std::unique_ptr<IWorkload>(); |
| 2247 | } |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 2248 | |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 2249 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateReduce(const ReduceQueueDescriptor& /*descriptor*/, |
| 2250 | const WorkloadInfo& /*info*/) const |
| 2251 | { |
| 2252 | return std::unique_ptr<IWorkload>(); |
| 2253 | } |
| 2254 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2255 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateReshape(const ReshapeQueueDescriptor& /*descriptor*/, |
| 2256 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2257 | { |
| 2258 | return std::unique_ptr<IWorkload>(); |
| 2259 | } |
| 2260 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2261 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateResize(const ResizeQueueDescriptor& /*descriptor*/, |
| 2262 | const WorkloadInfo& /*info*/) const |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 2263 | { |
| 2264 | return std::unique_ptr<IWorkload>(); |
| 2265 | } |
| 2266 | |
Keith Davis | 3ae3f97 | 2021-05-21 16:33:48 +0100 | [diff] [blame] | 2267 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateShape(const ShapeQueueDescriptor& /*descriptor*/, |
| 2268 | const WorkloadInfo& /*info*/) const |
| 2269 | { |
| 2270 | return std::unique_ptr<IWorkload>(); |
| 2271 | } |
| 2272 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2273 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSlice(const SliceQueueDescriptor& /*descriptor*/, |
| 2274 | const WorkloadInfo& /*info*/) const |
| 2275 | { |
| 2276 | return std::unique_ptr<IWorkload>(); |
| 2277 | } |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 2278 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2279 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSoftmax(const SoftmaxQueueDescriptor& /*descriptor*/, |
| 2280 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 2281 | { |
| 2282 | return std::unique_ptr<IWorkload>(); |
| 2283 | } |
| 2284 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2285 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSplitter(const SplitterQueueDescriptor& /*descriptor*/, |
| 2286 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2287 | { |
| 2288 | return std::unique_ptr<IWorkload>(); |
| 2289 | } |
| 2290 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2291 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSpaceToBatchNd(const SpaceToBatchNdQueueDescriptor& /*descriptor*/, |
| 2292 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2293 | { |
| 2294 | return std::unique_ptr<IWorkload>(); |
| 2295 | } |
| 2296 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2297 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSpaceToDepth(const SpaceToDepthQueueDescriptor& /*descriptor*/, |
| 2298 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2299 | { |
| 2300 | return std::unique_ptr<IWorkload>(); |
| 2301 | } |
| 2302 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2303 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateStack(const StackQueueDescriptor& /*descriptor*/, |
| 2304 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 2305 | { |
| 2306 | return std::unique_ptr<IWorkload>(); |
| 2307 | } |
| 2308 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2309 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateStridedSlice(const StridedSliceQueueDescriptor& /*descriptor*/, |
| 2310 | const WorkloadInfo& /*info*/) const |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 2311 | { |
| 2312 | return std::unique_ptr<IWorkload>(); |
| 2313 | } |
| 2314 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2315 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSubtraction(const SubtractionQueueDescriptor& /*descriptor*/, |
| 2316 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 2317 | { |
| 2318 | return std::unique_ptr<IWorkload>(); |
| 2319 | } |
| 2320 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2321 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSwitch(const SwitchQueueDescriptor& /*descriptor*/, |
| 2322 | const WorkloadInfo& /*info*/) const |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 2323 | { |
| 2324 | return std::unique_ptr<IWorkload>(); |
| 2325 | } |
| 2326 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 2327 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateTranspose(const TransposeQueueDescriptor& /*descriptor*/, |
| 2328 | const WorkloadInfo& /*info*/) const |
| 2329 | { |
| 2330 | return std::unique_ptr<IWorkload>(); |
| 2331 | } |
| 2332 | |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 2333 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateTransposeConvolution2d( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 2334 | const TransposeConvolution2dQueueDescriptor& /*descriptor*/, |
| 2335 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 2336 | { |
| 2337 | return std::unique_ptr<IWorkload>(); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 2338 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 2339 | |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 2340 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateUnidirectionalSequenceLstm( |
| 2341 | const UnidirectionalSequenceLstmQueueDescriptor& /*descriptor*/, |
| 2342 | const WorkloadInfo& /*info*/) const |
| 2343 | { |
| 2344 | return std::unique_ptr<IWorkload>(); |
| 2345 | } |
| 2346 | |
Francis Murtagh | 9270d9e | 2022-08-12 13:54:17 +0100 | [diff] [blame] | 2347 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateInput( |
| 2348 | const InputQueueDescriptor& /*descriptor*/, |
| 2349 | const WorkloadInfo& /*info*/) const |
| 2350 | { |
| 2351 | return std::unique_ptr<IWorkload>(); |
| 2352 | } |
| 2353 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 2354 | } // namepsace armnn |