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