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> |
| 10 | #include <armnn/LayerSupport.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 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 17 | #include <backendsCommon/WorkloadFactory.hpp> |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 18 | #include <backendsCommon/TensorHandle.hpp> |
Matteo Martincigh | e5b8eb9 | 2019-11-28 15:45:42 +0000 | [diff] [blame] | 19 | |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 20 | #include <backendsCommon/test/WorkloadTestUtils.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 21 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 22 | #include <sstream> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 23 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 24 | namespace armnn |
| 25 | { |
| 26 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 27 | namespace |
| 28 | { |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 29 | using LayerList = std::list<Layer*>; |
| 30 | 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] | 31 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 32 | const TensorInfo OverrideDataType(const TensorInfo& info, Optional<DataType> type) |
| 33 | { |
| 34 | if (!type) |
| 35 | { |
| 36 | return info; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 37 | } |
| 38 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 39 | return TensorInfo(info.GetShape(), type.value(), info.GetQuantizationScale(), info.GetQuantizationOffset()); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 40 | } |
| 41 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 42 | } // anonymous namespace |
| 43 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 44 | bool IWorkloadFactory::IsLayerConfigurationSupported(const BackendId& backendId, |
| 45 | const IConnectableLayer& connectableLayer, |
| 46 | Optional<DataType> dataType, |
| 47 | std::string& outReasonIfUnsupported, |
| 48 | const ModelOptions& modelOptions) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 49 | { |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 50 | Optional<std::string&> reason = outReasonIfUnsupported; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 51 | bool result; |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 52 | const Layer& layer = *(PolymorphicDowncast<const Layer*>(&connectableLayer)); |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 53 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 54 | auto const& backendRegistry = BackendRegistryInstance(); |
| 55 | if (!backendRegistry.IsBackendRegistered(backendId)) |
| 56 | { |
| 57 | std::stringstream ss; |
| 58 | ss << connectableLayer.GetName() << " is not supported on " << backendId |
| 59 | << " because this backend is not registered."; |
| 60 | |
| 61 | outReasonIfUnsupported = ss.str(); |
| 62 | return false; |
| 63 | } |
| 64 | |
| 65 | auto backendFactory = backendRegistry.GetFactory(backendId); |
| 66 | auto backendObject = backendFactory(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 67 | auto layerSupportObject = LayerSupportHandle(backendObject->GetLayerSupport(modelOptions), backendId); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 68 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 69 | switch(layer.GetType()) |
| 70 | { |
| 71 | case LayerType::Activation: |
| 72 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 73 | auto cLayer = PolymorphicDowncast<const ActivationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 74 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 75 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 76 | result = layerSupportObject.IsActivationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 77 | OverrideDataType(input, dataType), |
| 78 | OverrideDataType(output, dataType), |
| 79 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 80 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 81 | break; |
| 82 | } |
| 83 | case LayerType::Addition: |
| 84 | { |
| 85 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 86 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 87 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 88 | result = layerSupportObject.IsAdditionSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 89 | OverrideDataType(input0, dataType), |
| 90 | OverrideDataType(input1, dataType), |
| 91 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 92 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 93 | break; |
| 94 | } |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 95 | case LayerType::ArgMinMax: |
| 96 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 97 | auto cLayer = PolymorphicDowncast<const ArgMinMaxLayer*>(&layer); |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 98 | const ArgMinMaxDescriptor& descriptor = cLayer->GetParameters(); |
| 99 | |
| 100 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 101 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 102 | result = layerSupportObject.IsArgMinMaxSupported( |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 103 | OverrideDataType(input, dataType), |
Narumol Prangnawarat | d1f5773 | 2019-10-31 14:24:02 +0000 | [diff] [blame] | 104 | OverrideDataType(output, DataType::Signed32), |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 105 | descriptor, |
| 106 | reason); |
| 107 | break; |
| 108 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 109 | case LayerType::BatchNormalization: |
| 110 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 111 | auto cLayer = PolymorphicDowncast<const BatchNormalizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 112 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 113 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 114 | const TensorInfo& mean = cLayer->m_Mean->GetTensorInfo(); |
| 115 | const TensorInfo& var = cLayer->m_Variance->GetTensorInfo(); |
| 116 | const TensorInfo& beta = cLayer->m_Beta->GetTensorInfo(); |
| 117 | const TensorInfo& gamma = cLayer->m_Gamma->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 118 | result = layerSupportObject.IsBatchNormalizationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 119 | OverrideDataType(input, dataType), |
| 120 | OverrideDataType(output, dataType), |
| 121 | OverrideDataType(mean, dataType), |
| 122 | OverrideDataType(var, dataType), |
| 123 | OverrideDataType(beta, dataType), |
| 124 | OverrideDataType(gamma, dataType), |
| 125 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 126 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 127 | break; |
| 128 | } |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 129 | case LayerType::BatchToSpaceNd: |
| 130 | { |
| 131 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 132 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 133 | auto cLayer = PolymorphicDowncast<const BatchToSpaceNdLayer*>(&layer); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 134 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 135 | result = layerSupportObject.IsBatchToSpaceNdSupported(OverrideDataType(input, dataType), |
| 136 | OverrideDataType(output, dataType), |
| 137 | cLayer->GetParameters(), |
| 138 | reason); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 139 | break; |
| 140 | } |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 141 | case LayerType::Cast: |
| 142 | { |
| 143 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 144 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 145 | |
| 146 | result = layerSupportObject.IsCastSupported(OverrideDataType(input, dataType), |
| 147 | OverrideDataType(output, dataType), |
| 148 | reason); |
| 149 | break; |
| 150 | } |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 151 | case LayerType::Comparison: |
| 152 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 153 | auto cLayer = PolymorphicDowncast<const ComparisonLayer*>(&layer); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 154 | |
| 155 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 156 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 157 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 158 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 159 | result = layerSupportObject.IsComparisonSupported(OverrideDataType(input0, dataType), |
| 160 | OverrideDataType(input1, dataType), |
| 161 | OverrideDataType(output, DataType::Boolean), |
| 162 | cLayer->GetParameters(), |
| 163 | reason); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 164 | break; |
| 165 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 166 | case LayerType::Constant: |
| 167 | { |
| 168 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 169 | result = layerSupportObject.IsConstantSupported(OverrideDataType(output, dataType), reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 170 | break; |
| 171 | } |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 172 | case LayerType::ConvertBf16ToFp32: |
| 173 | { |
| 174 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 175 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 176 | result = layerSupportObject.IsConvertBf16ToFp32Supported(input, output, reason); |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 177 | break; |
| 178 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 179 | case LayerType::ConvertFp16ToFp32: |
| 180 | { |
| 181 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 182 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 183 | result = layerSupportObject.IsConvertFp16ToFp32Supported(input, output, reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 184 | break; |
| 185 | } |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 186 | case LayerType::ConvertFp32ToBf16: |
| 187 | { |
| 188 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 189 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 190 | result = layerSupportObject.IsConvertFp32ToBf16Supported(input, output, reason); |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 191 | break; |
| 192 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 193 | case LayerType::ConvertFp32ToFp16: |
| 194 | { |
| 195 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 196 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 197 | result = layerSupportObject.IsConvertFp32ToFp16Supported(input, output, reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 198 | break; |
| 199 | } |
| 200 | case LayerType::Convolution2d: |
| 201 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 202 | auto cLayer = PolymorphicDowncast<const Convolution2dLayer*>(&layer); |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 203 | |
| 204 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 205 | dataType); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 206 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 207 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 208 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 209 | const Convolution2dDescriptor& descriptor = cLayer->GetParameters(); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 210 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 211 | // Construct optional biases object based on the value of m_BiasEnabled |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 212 | Optional<TensorInfo> biases; |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 213 | if (descriptor.m_BiasEnabled) |
| 214 | { |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 215 | biases = |
| 216 | OverrideDataType(cLayer->m_Bias->GetTensorInfo(), GetBiasTypeFromWeightsType(dataType)); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 217 | } |
| 218 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 219 | result = layerSupportObject.IsConvolution2dSupported( |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 220 | input, |
| 221 | output, |
| 222 | descriptor, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 223 | OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType), |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 224 | biases, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 225 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 226 | break; |
| 227 | } |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 228 | case LayerType::Debug: |
| 229 | { |
| 230 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 231 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 232 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 233 | result = layerSupportObject.IsDebugSupported(OverrideDataType(input, dataType), |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 234 | OverrideDataType(output, dataType), |
| 235 | reason); |
| 236 | break; |
| 237 | } |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 238 | case LayerType::DepthToSpace: |
| 239 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 240 | auto cLayer = PolymorphicDowncast<const DepthToSpaceLayer*>(&layer); |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 241 | |
| 242 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 243 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 244 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 245 | result = layerSupportObject.IsDepthToSpaceSupported(OverrideDataType(input, dataType), |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 246 | OverrideDataType(output, dataType), |
| 247 | cLayer->GetParameters(), |
| 248 | reason); |
| 249 | break; |
| 250 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 251 | case LayerType::DepthwiseConvolution2d: |
| 252 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 253 | auto cLayer = PolymorphicDowncast<const DepthwiseConvolution2dLayer*>(&layer); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 254 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 255 | dataType); |
| 256 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 257 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 258 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 259 | const DepthwiseConvolution2dDescriptor& descriptor = cLayer->GetParameters(); |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 260 | |
| 261 | // Construct optional biases object based on the value of m_BiasEnabled |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 262 | Optional<TensorInfo> biases; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 263 | if (descriptor.m_BiasEnabled) |
| 264 | { |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 265 | biases = |
| 266 | OverrideDataType(cLayer->m_Bias->GetTensorInfo(), GetBiasTypeFromWeightsType(dataType)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 267 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 268 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 269 | result = layerSupportObject.IsDepthwiseConvolutionSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 270 | input, |
| 271 | output, |
| 272 | descriptor, |
| 273 | OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType), |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 274 | biases, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 275 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 276 | break; |
| 277 | } |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 278 | case LayerType::Dequantize: |
| 279 | { |
| 280 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 281 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 282 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 283 | result = layerSupportObject.IsDequantizeSupported(input, |
| 284 | OverrideDataType(output, dataType), |
| 285 | reason); |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 286 | break; |
| 287 | } |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 288 | case LayerType::DetectionPostProcess: |
| 289 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 290 | auto cLayer = PolymorphicDowncast<const DetectionPostProcessLayer*>(&layer); |
Derek Lamberti | 6a5e5e8 | 2019-12-05 14:41:20 +0000 | [diff] [blame] | 291 | const TensorInfo& boxEncodings = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 292 | const TensorInfo& scores = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 293 | const TensorInfo& anchors = cLayer->m_Anchors->GetTensorInfo(); |
| 294 | |
| 295 | const TensorInfo& detectionBoxes = layer.GetOutputSlot(0).GetTensorInfo(); |
| 296 | const TensorInfo& detectionClasses = layer.GetOutputSlot(1).GetTensorInfo(); |
| 297 | const TensorInfo& detectionScores = layer.GetOutputSlot(2).GetTensorInfo(); |
| 298 | const TensorInfo& numDetections = layer.GetOutputSlot(3).GetTensorInfo(); |
| 299 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 300 | const DetectionPostProcessDescriptor& descriptor = cLayer->GetParameters(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 301 | result = layerSupportObject.IsDetectionPostProcessSupported(boxEncodings, |
| 302 | scores, |
| 303 | anchors, |
| 304 | detectionBoxes, |
| 305 | detectionClasses, |
| 306 | detectionScores, |
| 307 | numDetections, |
| 308 | descriptor, |
| 309 | reason); |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 310 | break; |
| 311 | } |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 312 | case LayerType::ElementwiseUnary: |
| 313 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 314 | auto cLayer = PolymorphicDowncast<const ElementwiseUnaryLayer*>(&layer); |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 315 | |
| 316 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 317 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 318 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 319 | result = layerSupportObject.IsElementwiseUnarySupported(OverrideDataType(input, dataType), |
| 320 | OverrideDataType(output, dataType), |
| 321 | cLayer->GetParameters(), |
| 322 | reason); |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 323 | break; |
| 324 | } |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 325 | case LayerType::Fill: |
| 326 | { |
| 327 | auto cLayer = PolymorphicDowncast<const FillLayer*>(&layer); |
| 328 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 329 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 330 | const FillDescriptor& descriptor = cLayer->GetParameters(); |
| 331 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 332 | result = layerSupportObject.IsFillSupported( |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 333 | OverrideDataType(input, dataType), |
| 334 | OverrideDataType(output, dataType), |
| 335 | descriptor, |
| 336 | reason); |
| 337 | break; |
| 338 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 339 | case LayerType::FakeQuantization: |
| 340 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 341 | auto cLayer = PolymorphicDowncast<const FakeQuantizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 342 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 343 | result = layerSupportObject.IsFakeQuantizationSupported(OverrideDataType(input, dataType), |
| 344 | cLayer->GetParameters(), |
| 345 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 346 | break; |
| 347 | } |
| 348 | case LayerType::Floor: |
| 349 | { |
| 350 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 351 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 352 | result = layerSupportObject.IsFloorSupported(OverrideDataType(input, dataType), |
| 353 | OverrideDataType(output, dataType), |
| 354 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 355 | break; |
| 356 | } |
| 357 | case LayerType::FullyConnected: |
| 358 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 359 | auto cLayer = PolymorphicDowncast<const FullyConnectedLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 360 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 361 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 362 | |
| 363 | const FullyConnectedDescriptor& descriptor = cLayer->GetParameters(); |
| 364 | TensorInfo weightsInfo; |
| 365 | const TensorInfo* weightsInfoPtr = nullptr; |
| 366 | |
| 367 | if (descriptor.m_ConstantWeights) |
| 368 | { |
| 369 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
| 370 | weightsInfo = OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType); |
| 371 | } |
| 372 | else |
| 373 | { |
| 374 | weightsInfo = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), dataType); |
| 375 | |
| 376 | } |
| 377 | weightsInfoPtr = &weightsInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 378 | |
| 379 | TensorInfo biasInfo; |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 380 | const TensorInfo* biasInfoPtr = nullptr; |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 381 | static const TensorInfo dummyBFloat16Bias(TensorShape({1,1,1,1}), DataType::BFloat16); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 382 | static const TensorInfo dummyFloat16Bias(TensorShape({1,1,1,1}), DataType::Float16); |
| 383 | static const TensorInfo dummyFloat32Bias(TensorShape({1,1,1,1}), DataType::Float32); |
| 384 | static const TensorInfo dummyQA8Bias(TensorShape({1,1,1,1}), DataType::Signed32); |
| 385 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 386 | if (descriptor.m_BiasEnabled) |
| 387 | { |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 388 | if(descriptor.m_ConstantWeights) |
| 389 | { |
| 390 | ARMNN_ASSERT(cLayer->m_Bias.get() != nullptr); |
| 391 | biasInfo = OverrideDataType(cLayer->m_Bias->GetTensorInfo(), GetBiasTypeFromWeightsType(dataType)); |
| 392 | biasInfoPtr = &biasInfo; |
| 393 | } |
| 394 | else |
| 395 | { |
| 396 | biasInfo = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), dataType); |
| 397 | biasInfoPtr = &biasInfo; |
| 398 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 399 | } |
| 400 | else |
| 401 | { |
| 402 | // If biases are not enabled pass a dummy tensorinfo for the validation |
| 403 | switch(input.GetDataType()) |
| 404 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 405 | case DataType::BFloat16: |
| 406 | { |
| 407 | biasInfoPtr = &dummyBFloat16Bias; |
| 408 | break; |
| 409 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 410 | case DataType::Float16: |
| 411 | { |
| 412 | biasInfoPtr = &dummyFloat16Bias; |
| 413 | break; |
| 414 | } |
| 415 | case DataType::Float32: |
| 416 | { |
| 417 | biasInfoPtr = &dummyFloat32Bias; |
| 418 | break; |
| 419 | } |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 420 | case DataType::QAsymmU8: |
Keith Davis | a856501 | 2020-02-14 12:22:40 +0000 | [diff] [blame] | 421 | case DataType::QAsymmS8: |
Keith Davis | 9d0ff74 | 2020-02-03 14:47:54 +0000 | [diff] [blame] | 422 | case DataType::QSymmS8: |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 423 | case DataType::QSymmS16: |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 424 | { |
| 425 | biasInfoPtr = &dummyQA8Bias; |
| 426 | break; |
| 427 | } |
| 428 | default: |
| 429 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 430 | ARMNN_ASSERT_MSG(false, "Unexpected bias type"); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 431 | } |
| 432 | } |
| 433 | } |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 434 | result = layerSupportObject.IsFullyConnectedSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 435 | OverrideDataType(input, dataType), |
| 436 | OverrideDataType(output, dataType), |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 437 | *weightsInfoPtr, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 438 | *biasInfoPtr, |
| 439 | descriptor, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 440 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 441 | break; |
| 442 | } |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 443 | case LayerType::Gather: |
| 444 | { |
| 445 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 446 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 447 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 448 | auto cLayer = PolymorphicDowncast<const GatherLayer*>(&layer); |
| 449 | const GatherDescriptor& descriptor = cLayer->GetParameters(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 450 | result = layerSupportObject.IsGatherSupported(OverrideDataType(input0, dataType), |
| 451 | input1, |
| 452 | OverrideDataType(output, dataType), |
| 453 | descriptor, |
| 454 | reason); |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 455 | break; |
| 456 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 457 | case LayerType::Input: |
| 458 | { |
| 459 | const TensorInfo& input = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 460 | result = layerSupportObject.IsInputSupported(OverrideDataType(input, dataType), reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 461 | break; |
| 462 | } |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 463 | case LayerType::InstanceNormalization: |
| 464 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 465 | auto cLayer = PolymorphicDowncast<const InstanceNormalizationLayer*>(&layer); |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 466 | const InstanceNormalizationDescriptor& descriptor = cLayer->GetParameters(); |
| 467 | |
| 468 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 469 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 470 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 471 | result = layerSupportObject.IsInstanceNormalizationSupported( |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 472 | OverrideDataType(input, dataType), |
| 473 | OverrideDataType(output, dataType), |
| 474 | descriptor, |
| 475 | reason); |
| 476 | break; |
| 477 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 478 | case LayerType::L2Normalization: |
| 479 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 480 | auto cLayer = PolymorphicDowncast<const L2NormalizationLayer*>(&layer); |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 481 | const L2NormalizationDescriptor& descriptor = cLayer->GetParameters(); |
| 482 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 483 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 484 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 485 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 486 | result = layerSupportObject.IsL2NormalizationSupported( |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 487 | OverrideDataType(input, dataType), |
| 488 | OverrideDataType(output, dataType), |
| 489 | descriptor, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 490 | reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 491 | break; |
| 492 | } |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 493 | case LayerType::LogicalBinary: |
| 494 | { |
| 495 | auto cLayer = PolymorphicDowncast<const LogicalBinaryLayer*>(&layer); |
| 496 | |
| 497 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 498 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 499 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 500 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 501 | result = layerSupportObject.IsLogicalBinarySupported(input0, |
| 502 | input1, |
| 503 | output, |
| 504 | cLayer->GetParameters(), |
| 505 | reason); |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 506 | break; |
| 507 | } |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 508 | case LayerType::LogSoftmax: |
| 509 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 510 | auto cLayer = PolymorphicDowncast<const LogSoftmaxLayer*>(&layer); |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 511 | |
| 512 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 513 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 514 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 515 | result = layerSupportObject.IsLogSoftmaxSupported(OverrideDataType(input, dataType), |
| 516 | OverrideDataType(output, dataType), |
| 517 | cLayer->GetParameters(), |
| 518 | reason); |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 519 | break; |
| 520 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 521 | case LayerType::Lstm: |
| 522 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 523 | auto cLayer = PolymorphicDowncast<const LstmLayer*>(&layer); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 524 | const LstmDescriptor& descriptor = cLayer->GetParameters(); |
| 525 | |
| 526 | // All inputs. |
| 527 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 528 | dataType); |
| 529 | const TensorInfo& outputStateIn = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 530 | dataType); |
| 531 | const TensorInfo& cellStateIn = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 532 | dataType); |
| 533 | // All outputs |
| 534 | const TensorInfo& scratchBuffer = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 535 | const TensorInfo& outputStateOut = OverrideDataType(layer.GetOutputSlot(1).GetTensorInfo(), dataType); |
| 536 | const TensorInfo& cellStateOut = OverrideDataType(layer.GetOutputSlot(2).GetTensorInfo(), dataType); |
| 537 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(3).GetTensorInfo(), dataType); |
| 538 | |
| 539 | // Basic parameters |
| 540 | const TensorInfo& inputToForgetWeights |
| 541 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(), dataType); |
| 542 | const TensorInfo& inputToCellWeights |
| 543 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(), dataType); |
| 544 | const TensorInfo& inputToOutputWeights |
| 545 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(), dataType); |
| 546 | const TensorInfo& recurrentToForgetWeights |
| 547 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(), dataType); |
| 548 | const TensorInfo& recurrentToCellWeights |
| 549 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(), dataType); |
| 550 | const TensorInfo& recurrentToOutputWeights |
| 551 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(), dataType); |
| 552 | const TensorInfo& forgetGateBias |
| 553 | = OverrideDataType(cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(), dataType); |
| 554 | const TensorInfo& cellBias |
| 555 | = OverrideDataType(cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(), dataType); |
| 556 | const TensorInfo& outputGateBias |
| 557 | = OverrideDataType(cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(), dataType); |
| 558 | |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 559 | LstmInputParamsInfo paramsInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 560 | |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 561 | paramsInfo.m_InputToForgetWeights = &inputToForgetWeights; |
| 562 | paramsInfo.m_InputToCellWeights = &inputToCellWeights; |
| 563 | paramsInfo.m_InputToOutputWeights = &inputToOutputWeights; |
| 564 | paramsInfo.m_RecurrentToForgetWeights = &recurrentToForgetWeights; |
| 565 | paramsInfo.m_RecurrentToCellWeights = &recurrentToCellWeights; |
| 566 | paramsInfo.m_RecurrentToOutputWeights = &recurrentToOutputWeights; |
| 567 | paramsInfo.m_ForgetGateBias = &forgetGateBias; |
| 568 | paramsInfo.m_CellBias = &cellBias; |
| 569 | paramsInfo.m_OutputGateBias = &outputGateBias; |
| 570 | |
| 571 | |
| 572 | // Optional parameters |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 573 | TensorInfo optInputToInputWeights; |
| 574 | TensorInfo optRecurrentToInputWeights; |
| 575 | TensorInfo optCellToInputWeights; |
| 576 | TensorInfo optInputGateBias; |
| 577 | TensorInfo optProjectionWeights; |
| 578 | TensorInfo optProjectionBias; |
| 579 | TensorInfo optCellToForgetWeights; |
| 580 | TensorInfo optCellToOutputWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 581 | TensorInfo optInputLayerNormWeights; |
| 582 | TensorInfo optForgetLayerNormWeights; |
| 583 | TensorInfo optCellLayerNormWeights; |
| 584 | TensorInfo optOutputLayerNormWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 585 | |
| 586 | if(!descriptor.m_CifgEnabled) |
| 587 | { |
| 588 | optInputToInputWeights = |
| 589 | OverrideDataType(cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 590 | paramsInfo.m_InputToInputWeights = &optInputToInputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 591 | |
| 592 | optRecurrentToInputWeights = |
| 593 | OverrideDataType(cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 594 | paramsInfo.m_RecurrentToInputWeights = &optRecurrentToInputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 595 | optInputGateBias = |
| 596 | OverrideDataType(cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 597 | paramsInfo.m_InputGateBias = &optInputGateBias; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | if(descriptor.m_ProjectionEnabled) |
| 601 | { |
| 602 | optProjectionWeights = |
| 603 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 604 | paramsInfo.m_ProjectionWeights = &optProjectionWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 605 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 606 | { |
| 607 | optProjectionBias = |
| 608 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 609 | paramsInfo.m_ProjectionBias = &optProjectionBias; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 610 | } |
| 611 | } |
| 612 | |
| 613 | if(descriptor.m_PeepholeEnabled) |
| 614 | { |
Jan Eilers | e2062cd | 2020-03-30 15:07:45 +0100 | [diff] [blame] | 615 | if(!descriptor.m_CifgEnabled) |
| 616 | { |
| 617 | optCellToInputWeights = |
| 618 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(), |
| 619 | dataType); |
| 620 | paramsInfo.m_CellToInputWeights = &optCellToInputWeights; |
| 621 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 622 | optCellToForgetWeights = |
| 623 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 624 | paramsInfo.m_CellToForgetWeights = &optCellToForgetWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 625 | optCellToOutputWeights = |
| 626 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 627 | paramsInfo.m_CellToOutputWeights = &optCellToOutputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 628 | } |
| 629 | |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 630 | if(descriptor.m_LayerNormEnabled) |
| 631 | { |
Ferran Balaguer | e30c16e | 2019-07-24 17:03:45 +0100 | [diff] [blame] | 632 | if (!descriptor.m_CifgEnabled) |
| 633 | { |
| 634 | optInputLayerNormWeights = OverrideDataType( |
| 635 | cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(), dataType); |
| 636 | paramsInfo.m_InputLayerNormWeights = &optInputLayerNormWeights; |
| 637 | } |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 638 | |
| 639 | optForgetLayerNormWeights = OverrideDataType( |
| 640 | cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 641 | paramsInfo.m_ForgetLayerNormWeights = &optForgetLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 642 | |
| 643 | optCellLayerNormWeights = OverrideDataType( |
| 644 | cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 645 | paramsInfo.m_CellLayerNormWeights = &optCellLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 646 | |
| 647 | optOutputLayerNormWeights = OverrideDataType( |
| 648 | cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 649 | paramsInfo.m_OutputLayerNormWeights = &optOutputLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 650 | } |
| 651 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 652 | result = layerSupportObject.IsLstmSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 653 | input, |
| 654 | outputStateIn, |
| 655 | cellStateIn, |
| 656 | scratchBuffer, |
| 657 | outputStateOut, |
| 658 | cellStateOut, |
| 659 | output, |
| 660 | descriptor, |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 661 | paramsInfo, |
| 662 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 663 | break; |
| 664 | } |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 665 | case LayerType::Maximum: |
| 666 | { |
| 667 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 668 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 669 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 670 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 671 | result = layerSupportObject.IsMaximumSupported(OverrideDataType(input0, dataType), |
| 672 | OverrideDataType(input1, dataType), |
| 673 | OverrideDataType(output, dataType), |
| 674 | reason); |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 675 | break; |
| 676 | } |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 677 | case LayerType::MemCopy: |
| 678 | { |
| 679 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 680 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 681 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 682 | result = layerSupportObject.IsMemCopySupported(OverrideDataType(input, dataType), |
| 683 | OverrideDataType(output, dataType), |
| 684 | reason); |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 685 | break; |
| 686 | } |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 687 | case LayerType::MemImport: |
| 688 | { |
| 689 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 690 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 691 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 692 | result = layerSupportObject.IsMemImportSupported(OverrideDataType(input, dataType), |
| 693 | OverrideDataType(output, dataType), |
| 694 | reason); |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 695 | break; |
| 696 | } |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 697 | case LayerType::Merge: |
| 698 | { |
| 699 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 700 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 701 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 702 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 703 | result = layerSupportObject.IsMergeSupported(OverrideDataType(input0, dataType), |
| 704 | OverrideDataType(input1, dataType), |
| 705 | OverrideDataType(output, dataType), |
| 706 | reason); |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 707 | break; |
| 708 | } |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 709 | case LayerType::Concat: |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 710 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 711 | auto cLayer = PolymorphicDowncast<const ConcatLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 712 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 713 | // Get vector of all inputs. |
| 714 | auto getTensorInfo = [&dataType](const InputSlot& slot) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 715 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 716 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 717 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 718 | |
| 719 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfo); |
| 720 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfo); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 721 | std::vector<TensorInfo> inputs(beginI, endI); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 722 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 723 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 724 | { |
| 725 | return &info; |
| 726 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 727 | |
| 728 | auto beginPtr = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 729 | auto endPtr = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 730 | std::vector<const TensorInfo*> inputPtrs(beginPtr, endPtr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 731 | |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 732 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 733 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 734 | result = layerSupportObject.IsConcatSupported(inputPtrs, output, cLayer->GetParameters(), reason); |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 735 | |
| 736 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 737 | break; |
| 738 | } |
| 739 | case LayerType::Multiplication: |
| 740 | { |
| 741 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 742 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 743 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 744 | result = layerSupportObject.IsMultiplicationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 745 | OverrideDataType(input0, dataType), |
| 746 | OverrideDataType(input1, dataType), |
| 747 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 748 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 749 | break; |
| 750 | } |
| 751 | case LayerType::Normalization: |
| 752 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 753 | auto cLayer = PolymorphicDowncast<const NormalizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 754 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 755 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 756 | result = layerSupportObject.IsNormalizationSupported(OverrideDataType(input, dataType), |
| 757 | OverrideDataType(output, dataType), |
| 758 | cLayer->GetParameters(), |
| 759 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 760 | break; |
| 761 | } |
| 762 | case LayerType::Output: |
| 763 | { |
| 764 | const TensorInfo& output = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 765 | result = layerSupportObject.IsOutputSupported(OverrideDataType(output, dataType), reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 766 | break; |
| 767 | } |
| 768 | case LayerType::Permute: |
| 769 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 770 | auto cLayer = PolymorphicDowncast<const PermuteLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 771 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 772 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 773 | result = layerSupportObject.IsPermuteSupported(OverrideDataType(input, dataType), |
| 774 | OverrideDataType(output, dataType), |
| 775 | cLayer->GetParameters(), |
| 776 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 777 | break; |
| 778 | } |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 779 | case LayerType::Pad: |
| 780 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 781 | auto cLayer = PolymorphicDowncast<const PadLayer*>(&layer); |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 782 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 783 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 784 | result = layerSupportObject.IsPadSupported( |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 785 | OverrideDataType(input, dataType), |
| 786 | OverrideDataType(output, dataType), |
| 787 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 788 | reason); |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 789 | break; |
| 790 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 791 | case LayerType::Pooling2d: |
| 792 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 793 | auto cLayer = PolymorphicDowncast<const Pooling2dLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 794 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 795 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 796 | result = layerSupportObject.IsPooling2dSupported(OverrideDataType(input, dataType), |
| 797 | OverrideDataType(output, dataType), |
| 798 | cLayer->GetParameters(), |
| 799 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 800 | break; |
| 801 | } |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 802 | case LayerType::PreCompiled: |
| 803 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 804 | auto cLayer = PolymorphicDowncast<const PreCompiledLayer*>(&layer); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 805 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 806 | result = layerSupportObject.IsPreCompiledSupported(OverrideDataType(input, dataType), |
| 807 | cLayer->GetParameters(), |
| 808 | reason); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 809 | break; |
| 810 | } |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 811 | case LayerType::Quantize: |
| 812 | { |
| 813 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 814 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 815 | result = layerSupportObject.IsQuantizeSupported(input, output, reason); |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 816 | break; |
| 817 | } |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 818 | case LayerType::QLstm: |
| 819 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 820 | auto cLayer = PolymorphicDowncast<const QLstmLayer*>(&layer); |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 821 | const QLstmDescriptor& descriptor = cLayer->GetParameters(); |
| 822 | |
| 823 | // Inputs |
| 824 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 825 | const TensorInfo& previousOutputIn = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 826 | const TensorInfo& previousCellStateIn = layer.GetInputSlot(2).GetConnection()->GetTensorInfo(); |
| 827 | |
| 828 | // Outputs |
| 829 | const TensorInfo& outputStateOut = layer.GetOutputSlot(0).GetTensorInfo(); |
| 830 | const TensorInfo& cellStateOut = layer.GetOutputSlot(1).GetTensorInfo(); |
| 831 | const TensorInfo& output = layer.GetOutputSlot(2).GetTensorInfo(); |
| 832 | |
| 833 | // Lstm parameters |
| 834 | LstmInputParamsInfo paramsInfo; |
| 835 | |
| 836 | // Basic parameters |
| 837 | paramsInfo.m_InputToForgetWeights = &cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(); |
| 838 | paramsInfo.m_InputToCellWeights = &cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(); |
| 839 | paramsInfo.m_InputToOutputWeights = &cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(); |
| 840 | |
| 841 | paramsInfo.m_RecurrentToForgetWeights = |
| 842 | &cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(); |
| 843 | paramsInfo.m_RecurrentToCellWeights = |
| 844 | &cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(); |
| 845 | paramsInfo.m_RecurrentToOutputWeights = |
| 846 | &cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(); |
| 847 | |
| 848 | paramsInfo.m_ForgetGateBias = &cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(); |
| 849 | paramsInfo.m_CellBias = &cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(); |
| 850 | paramsInfo.m_OutputGateBias = &cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(); |
| 851 | |
| 852 | if(!descriptor.m_CifgEnabled) |
| 853 | { |
| 854 | paramsInfo.m_InputToInputWeights = &cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(); |
| 855 | paramsInfo.m_RecurrentToInputWeights = |
| 856 | &cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(); |
| 857 | paramsInfo.m_InputGateBias = &cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(); |
| 858 | } |
| 859 | |
| 860 | if(descriptor.m_ProjectionEnabled) |
| 861 | { |
| 862 | paramsInfo.m_ProjectionWeights = &cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(); |
James Conroy | ed32405 | 2020-05-18 15:16:42 +0100 | [diff] [blame] | 863 | |
| 864 | // Projection bias is optional even if projection is enabled |
| 865 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 866 | { |
| 867 | paramsInfo.m_ProjectionBias = &cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(); |
| 868 | } |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 869 | } |
| 870 | |
| 871 | if(descriptor.m_PeepholeEnabled) |
| 872 | { |
| 873 | if (!descriptor.m_CifgEnabled) |
| 874 | { |
| 875 | paramsInfo.m_CellToInputWeights = |
| 876 | &cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(); |
| 877 | } |
| 878 | |
| 879 | paramsInfo.m_CellToForgetWeights = |
| 880 | &cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(); |
| 881 | paramsInfo.m_CellToOutputWeights = &cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(); |
| 882 | } |
| 883 | |
| 884 | if(descriptor.m_LayerNormEnabled) |
| 885 | { |
| 886 | if (!descriptor.m_CifgEnabled) |
| 887 | { |
| 888 | paramsInfo.m_InputLayerNormWeights = |
| 889 | &cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(); |
| 890 | } |
| 891 | |
| 892 | paramsInfo.m_ForgetLayerNormWeights = |
| 893 | &cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(); |
| 894 | paramsInfo.m_CellLayerNormWeights = |
| 895 | &cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(); |
| 896 | paramsInfo.m_OutputLayerNormWeights = |
| 897 | &cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(); |
| 898 | } |
| 899 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 900 | result = layerSupportObject.IsQLstmSupported(input, |
| 901 | previousOutputIn, |
| 902 | previousCellStateIn, |
| 903 | outputStateOut, |
| 904 | cellStateOut, |
| 905 | output, |
| 906 | descriptor, |
| 907 | paramsInfo, |
| 908 | reason); |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 909 | break; |
| 910 | } |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 911 | case LayerType::QuantizedLstm: |
| 912 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 913 | auto cLayer = PolymorphicDowncast<const QuantizedLstmLayer*>(&layer); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 914 | |
| 915 | // Inputs |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 916 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 917 | const TensorInfo& previousCellStateIn = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 918 | const TensorInfo& previousOutputIn = layer.GetInputSlot(2).GetConnection()->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 919 | |
| 920 | // Outputs |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 921 | const TensorInfo& cellStateOut = layer.GetOutputSlot(0).GetTensorInfo(); |
| 922 | const TensorInfo& output = layer.GetOutputSlot(1).GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 923 | |
| 924 | // QuantizedLstm parameters |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 925 | QuantizedLstmInputParamsInfo paramsInfo; |
| 926 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 927 | paramsInfo.m_InputToInputWeights = |
| 928 | &cLayer->m_QuantizedLstmParameters.m_InputToInputWeights->GetTensorInfo(); |
| 929 | paramsInfo.m_InputToForgetWeights = |
| 930 | &cLayer->m_QuantizedLstmParameters.m_InputToForgetWeights->GetTensorInfo(); |
| 931 | paramsInfo.m_InputToCellWeights = |
| 932 | &cLayer->m_QuantizedLstmParameters.m_InputToCellWeights->GetTensorInfo(); |
| 933 | paramsInfo.m_InputToOutputWeights = |
| 934 | &cLayer->m_QuantizedLstmParameters.m_InputToOutputWeights->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 935 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 936 | paramsInfo.m_RecurrentToInputWeights = |
| 937 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToInputWeights->GetTensorInfo(); |
| 938 | paramsInfo.m_RecurrentToForgetWeights = |
| 939 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToForgetWeights->GetTensorInfo(); |
| 940 | paramsInfo.m_RecurrentToCellWeights = |
| 941 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToCellWeights->GetTensorInfo(); |
| 942 | paramsInfo.m_RecurrentToOutputWeights = |
| 943 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToOutputWeights->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 944 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 945 | paramsInfo.m_InputGateBias = |
| 946 | &cLayer->m_QuantizedLstmParameters.m_InputGateBias->GetTensorInfo(); |
| 947 | paramsInfo.m_ForgetGateBias = |
| 948 | &cLayer->m_QuantizedLstmParameters.m_ForgetGateBias->GetTensorInfo(); |
| 949 | paramsInfo.m_CellBias = |
| 950 | &cLayer->m_QuantizedLstmParameters.m_CellBias->GetTensorInfo(); |
| 951 | paramsInfo.m_OutputGateBias = |
| 952 | &cLayer->m_QuantizedLstmParameters.m_OutputGateBias->GetTensorInfo();; |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 953 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 954 | result = layerSupportObject.IsQuantizedLstmSupported(input, |
| 955 | previousCellStateIn, |
| 956 | previousOutputIn, |
| 957 | cellStateOut, |
| 958 | output, |
| 959 | paramsInfo, |
| 960 | reason); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 961 | break; |
| 962 | } |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 963 | case LayerType::Division: |
| 964 | { |
| 965 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 966 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 967 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 968 | result = layerSupportObject.IsDivisionSupported( |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 969 | OverrideDataType(input0, dataType), |
| 970 | OverrideDataType(input1, dataType), |
| 971 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 972 | reason); |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 973 | break; |
| 974 | } |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 975 | case LayerType::Rank: |
| 976 | { |
| 977 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 978 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 979 | result = layerSupportObject.IsRankSupported(OverrideDataType(input, dataType), |
| 980 | OverrideDataType(output, dataType), |
| 981 | reason); |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 982 | break; |
| 983 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 984 | case LayerType::Reshape: |
| 985 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 986 | auto cLayer = PolymorphicDowncast<const ReshapeLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 987 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 988 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 989 | result = layerSupportObject.IsReshapeSupported(OverrideDataType(input, dataType), |
| 990 | OverrideDataType(output, dataType), |
| 991 | cLayer->GetParameters(), |
| 992 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 993 | break; |
| 994 | } |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 995 | case LayerType::Resize: |
| 996 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 997 | auto cLayer = PolymorphicDowncast<const ResizeLayer*>(&layer); |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 998 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 999 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1000 | result = layerSupportObject.IsResizeSupported(OverrideDataType(input, dataType), |
| 1001 | OverrideDataType(output, dataType), |
| 1002 | cLayer->GetParameters(), |
| 1003 | reason); |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 1004 | break; |
| 1005 | } |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1006 | case LayerType::Slice: |
| 1007 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1008 | auto cLayer = PolymorphicDowncast<const SliceLayer*>(&layer); |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1009 | |
| 1010 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1011 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1012 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1013 | result = layerSupportObject.IsSliceSupported(OverrideDataType(input, dataType), |
| 1014 | OverrideDataType(output, dataType), |
| 1015 | cLayer->GetParameters(), |
| 1016 | reason); |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1017 | break; |
| 1018 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1019 | case LayerType::Softmax: |
| 1020 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1021 | auto cLayer = PolymorphicDowncast<const SoftmaxLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1022 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1023 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1024 | result = layerSupportObject.IsSoftmaxSupported(OverrideDataType(input, dataType), |
| 1025 | OverrideDataType(output, dataType), |
| 1026 | cLayer->GetParameters(), |
| 1027 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1028 | break; |
| 1029 | } |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 1030 | case LayerType::SpaceToBatchNd: |
| 1031 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1032 | auto cLayer = PolymorphicDowncast<const SpaceToBatchNdLayer*>(&layer); |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 1033 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1034 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1035 | result = layerSupportObject.IsSpaceToBatchNdSupported(OverrideDataType(input, dataType), |
| 1036 | OverrideDataType(output, dataType), |
| 1037 | cLayer->GetParameters(), |
| 1038 | reason); |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 1039 | break; |
| 1040 | } |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1041 | case LayerType::SpaceToDepth: |
| 1042 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1043 | auto cLayer = PolymorphicDowncast<const SpaceToDepthLayer*>(&layer); |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1044 | |
| 1045 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1046 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1047 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1048 | result = layerSupportObject.IsSpaceToDepthSupported(OverrideDataType(input, dataType), |
| 1049 | OverrideDataType(output, dataType), |
| 1050 | cLayer->GetParameters(), |
| 1051 | reason); |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1052 | break; |
| 1053 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1054 | case LayerType::Splitter: |
| 1055 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1056 | auto cLayer = PolymorphicDowncast<const SplitterLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1057 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1058 | |
| 1059 | // Get vector of all outputs. |
| 1060 | auto getTensorInfo = [&dataType](const OutputSlot& slot) |
| 1061 | { |
| 1062 | return OverrideDataType(slot.GetTensorInfo(), dataType); |
| 1063 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1064 | auto beginI = MakeTransformIterator(layer.GetOutputSlots().begin(), getTensorInfo); |
| 1065 | auto endI = MakeTransformIterator(layer.GetOutputSlots().end(), getTensorInfo); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1066 | std::vector<TensorInfo> outputs(beginI, endI); |
| 1067 | |
| 1068 | const std::vector<std::reference_wrapper<TensorInfo>> outputPtrs(outputs.begin(), outputs.end()); |
| 1069 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1070 | result = layerSupportObject.IsSplitterSupported(OverrideDataType(input, dataType), |
| 1071 | outputPtrs, |
| 1072 | cLayer->GetParameters(), |
| 1073 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1074 | break; |
| 1075 | } |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1076 | case LayerType::Stack: |
| 1077 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1078 | auto cLayer = PolymorphicDowncast<const StackLayer*>(&layer); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1079 | |
| 1080 | // Get vector of all inputs. |
| 1081 | auto getTensorInfo = [&dataType](const InputSlot& slot) |
| 1082 | { |
| 1083 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
| 1084 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1085 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfo); |
| 1086 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfo); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1087 | std::vector<TensorInfo> inputs(beginI, endI); |
| 1088 | |
| 1089 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 1090 | { |
| 1091 | return &info; |
| 1092 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1093 | auto beginPtr = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 1094 | auto endPtr = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1095 | std::vector<const TensorInfo*> inputPtrs(beginPtr, endPtr); |
| 1096 | |
| 1097 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1098 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1099 | result = layerSupportObject.IsStackSupported(inputPtrs, output, cLayer->GetParameters(), reason); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1100 | |
| 1101 | break; |
| 1102 | } |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1103 | case LayerType::StandIn: |
| 1104 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1105 | auto cLayer = PolymorphicDowncast<const StandInLayer*>(&layer); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1106 | |
| 1107 | // Get vector of all inputs. |
| 1108 | auto getTensorInfoIn = [&dataType](const InputSlot& slot) |
| 1109 | { |
| 1110 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
| 1111 | }; |
| 1112 | auto getTensorInfoOut = [&dataType](const OutputSlot& slot) |
| 1113 | { |
| 1114 | return OverrideDataType(slot.GetTensorInfo(), dataType); |
| 1115 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1116 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfoIn); |
| 1117 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfoIn); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1118 | std::vector<TensorInfo> inputs(beginI, endI); |
| 1119 | |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1120 | auto beginO = MakeTransformIterator(layer.GetOutputSlots().begin(), getTensorInfoOut); |
| 1121 | auto endO = MakeTransformIterator(layer.GetOutputSlots().end(), getTensorInfoOut); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1122 | std::vector<TensorInfo> outputs(beginO, endO); |
| 1123 | |
| 1124 | |
| 1125 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 1126 | { |
| 1127 | return &info; |
| 1128 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1129 | auto beginPtrI = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 1130 | auto endPtrI = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1131 | std::vector<const TensorInfo*> inputPtrs(beginPtrI, endPtrI); |
| 1132 | |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1133 | auto beginPtrO = MakeTransformIterator(outputs.begin(), getTensorInfoPtr); |
| 1134 | auto endPtrO = MakeTransformIterator(outputs.end(), getTensorInfoPtr); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1135 | std::vector<const TensorInfo*> outputPtrs(beginPtrO, endPtrO); |
| 1136 | |
| 1137 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1138 | result = layerSupportObject.IsStandInSupported(inputPtrs, |
| 1139 | outputPtrs, |
| 1140 | cLayer->GetParameters(), |
| 1141 | reason); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1142 | break; |
| 1143 | } |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1144 | case LayerType::StridedSlice: |
| 1145 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1146 | auto cLayer = PolymorphicDowncast<const StridedSliceLayer*>(&layer); |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1147 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1148 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1149 | result = layerSupportObject.IsStridedSliceSupported(OverrideDataType(input, dataType), |
| 1150 | OverrideDataType(output, dataType), |
| 1151 | cLayer->GetParameters(), |
| 1152 | reason); |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1153 | break; |
| 1154 | } |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1155 | case LayerType::Subtraction: |
| 1156 | { |
| 1157 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1158 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1159 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1160 | result = layerSupportObject.IsSubtractionSupported( |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1161 | OverrideDataType(input0, dataType), |
| 1162 | OverrideDataType(input1, dataType), |
| 1163 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1164 | reason); |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1165 | break; |
| 1166 | } |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1167 | case LayerType::Switch: |
| 1168 | { |
| 1169 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1170 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1171 | const TensorInfo& output0 = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1172 | const TensorInfo& output1 = layer.GetOutputSlot(1).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1173 | result = layerSupportObject.IsSwitchSupported(OverrideDataType(input0, dataType), |
| 1174 | OverrideDataType(input1, dataType), |
| 1175 | OverrideDataType(output0, dataType), |
| 1176 | OverrideDataType(output1, dataType), |
| 1177 | reason); |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1178 | break; |
| 1179 | } |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1180 | case LayerType::Mean: |
| 1181 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1182 | auto cLayer = PolymorphicDowncast<const MeanLayer*>(&layer); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1183 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1184 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1185 | result = layerSupportObject.IsMeanSupported( |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1186 | OverrideDataType(input, dataType), |
| 1187 | OverrideDataType(output, dataType), |
| 1188 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1189 | reason); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1190 | break; |
| 1191 | } |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 1192 | case LayerType::Minimum: |
| 1193 | { |
| 1194 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1195 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1196 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1197 | result = layerSupportObject.IsMinimumSupported(OverrideDataType(input0, dataType), |
| 1198 | OverrideDataType(input1, dataType), |
| 1199 | OverrideDataType(output, dataType), |
| 1200 | reason); |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 1201 | break; |
| 1202 | } |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1203 | case LayerType::Prelu: |
| 1204 | { |
| 1205 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1206 | const TensorInfo& alpha = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1207 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1208 | result = layerSupportObject.IsPreluSupported(OverrideDataType(input, dataType), |
| 1209 | OverrideDataType(alpha, dataType), |
| 1210 | OverrideDataType(output, dataType), |
| 1211 | reason); |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1212 | break; |
| 1213 | } |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1214 | case LayerType::Transpose: |
| 1215 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1216 | auto cLayer = PolymorphicDowncast<const TransposeLayer*>(&layer); |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1217 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1218 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1219 | result = layerSupportObject.IsTransposeSupported(OverrideDataType(input, dataType), |
| 1220 | OverrideDataType(output, dataType), |
| 1221 | cLayer->GetParameters(), |
| 1222 | reason); |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1223 | break; |
| 1224 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1225 | case LayerType::TransposeConvolution2d: |
| 1226 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1227 | auto cLayer = PolymorphicDowncast<const TransposeConvolution2dLayer*>(&layer); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1228 | |
| 1229 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 1230 | dataType); |
| 1231 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 1232 | |
| 1233 | const TransposeConvolution2dDescriptor& descriptor = cLayer->GetParameters(); |
| 1234 | |
| 1235 | Optional<TensorInfo> biases; |
| 1236 | if (descriptor.m_BiasEnabled) |
| 1237 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1238 | ARMNN_ASSERT(cLayer->m_Bias.get() != nullptr); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1239 | biases = OverrideDataType(cLayer->m_Bias->GetTensorInfo(), |
| 1240 | GetBiasTypeFromWeightsType(dataType)); |
| 1241 | } |
| 1242 | |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1243 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1244 | const TensorInfo weights = OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType); |
| 1245 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1246 | result = layerSupportObject.IsTransposeConvolution2dSupported(input, |
| 1247 | output, |
| 1248 | descriptor, |
| 1249 | weights, |
| 1250 | biases, |
| 1251 | reason); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1252 | |
| 1253 | break; |
| 1254 | } |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 1255 | case LayerType::Reduce: |
| 1256 | { |
| 1257 | auto cLayer = PolymorphicDowncast<const ReduceLayer*>(&layer); |
| 1258 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1259 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1260 | |
Sadik Armagan | f0a6dec | 2021-03-25 07:46:55 +0000 | [diff] [blame] | 1261 | result = layerSupportObject.IsReduceSupported(OverrideDataType(input, dataType), |
| 1262 | OverrideDataType(output, dataType), |
| 1263 | cLayer->GetParameters(), |
| 1264 | reason); |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 1265 | break; |
| 1266 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1267 | default: |
| 1268 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1269 | ARMNN_ASSERT_MSG(false, "WorkloadFactory did not recognise type of layer."); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1270 | reason.value() = "Unrecognised layer type"; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1271 | result = false; |
| 1272 | break; |
| 1273 | } |
| 1274 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1275 | return result; |
| 1276 | } |
| 1277 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1278 | bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId, |
| 1279 | const IConnectableLayer& connectableLayer, |
| 1280 | Optional<DataType> dataType, |
| 1281 | std::string& outReasonIfUnsupported) |
| 1282 | { |
| 1283 | return IsLayerConfigurationSupported(backendId, connectableLayer, dataType, outReasonIfUnsupported); |
| 1284 | } |
| 1285 | |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 1286 | bool IWorkloadFactory::IsLayerSupported(const IConnectableLayer& connectableLayer, |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 1287 | Optional<DataType> dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1288 | std::string& outReasonIfUnsupported) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1289 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1290 | auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer); |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1291 | return IsLayerConfigurationSupported(layer->GetBackendId(), connectableLayer, dataType, outReasonIfUnsupported); |
| 1292 | } |
| 1293 | |
| 1294 | // TODO merge with defaulted modelOptions above |
| 1295 | bool IWorkloadFactory::IsLayerSupported(const IConnectableLayer& connectableLayer, |
| 1296 | Optional<DataType> dataType, |
| 1297 | std::string& outReasonIfUnsupported, |
| 1298 | const ModelOptions& modelOptions) |
| 1299 | { |
| 1300 | auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer); |
| 1301 | return IsLayerConfigurationSupported(layer->GetBackendId(), |
| 1302 | connectableLayer, |
| 1303 | dataType, |
| 1304 | outReasonIfUnsupported, |
| 1305 | modelOptions); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1306 | } |
| 1307 | |
Sadik Armagan | 04a7297 | 2020-09-14 15:44:18 +0100 | [diff] [blame] | 1308 | bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId, |
| 1309 | const IConnectableLayer& connectableLayer, |
| 1310 | Optional<DataType> dataType, |
| 1311 | std::string& outReasonIfUnsupported, |
| 1312 | const ModelOptions& modelOptions) |
| 1313 | { |
| 1314 | return IsLayerConfigurationSupported(backendId, |
| 1315 | connectableLayer, |
| 1316 | dataType, |
| 1317 | outReasonIfUnsupported, |
| 1318 | modelOptions); |
| 1319 | } |
| 1320 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1321 | // Default Implementations |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1322 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateAbs(const AbsQueueDescriptor& /*descriptor*/, |
| 1323 | const WorkloadInfo& /*info*/) const |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame] | 1324 | { |
| 1325 | return std::unique_ptr<IWorkload>(); |
| 1326 | } |
| 1327 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1328 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateActivation(const ActivationQueueDescriptor& /*descriptor*/, |
| 1329 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1330 | { |
| 1331 | return std::unique_ptr<IWorkload>(); |
| 1332 | } |
| 1333 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1334 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateAddition(const AdditionQueueDescriptor& /*descriptor*/, |
| 1335 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1336 | { |
| 1337 | return std::unique_ptr<IWorkload>(); |
| 1338 | } |
| 1339 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1340 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateArgMinMax(const ArgMinMaxQueueDescriptor& /*descriptor*/, |
| 1341 | const WorkloadInfo& /*info*/) const |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 1342 | { |
| 1343 | return std::unique_ptr<IWorkload>(); |
| 1344 | } |
| 1345 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1346 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchNormalization( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1347 | const BatchNormalizationQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1348 | { |
| 1349 | return std::unique_ptr<IWorkload>(); |
| 1350 | } |
| 1351 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1352 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchToSpaceNd(const BatchToSpaceNdQueueDescriptor& /*desc*/, |
| 1353 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1354 | { |
| 1355 | return std::unique_ptr<IWorkload>(); |
| 1356 | } |
| 1357 | |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 1358 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateCast(const CastQueueDescriptor& /*descriptor*/, |
| 1359 | const WorkloadInfo& /*info*/) const |
| 1360 | { |
| 1361 | return std::unique_ptr<IWorkload>(); |
| 1362 | } |
| 1363 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1364 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateComparison(const ComparisonQueueDescriptor& /*descriptor*/, |
| 1365 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 1366 | { |
| 1367 | return std::unique_ptr<IWorkload>(); |
| 1368 | } |
| 1369 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1370 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConcat(const ConcatQueueDescriptor& /*descriptor*/, |
| 1371 | const WorkloadInfo& /*info*/) const |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 1372 | { |
| 1373 | return std::unique_ptr<IWorkload>(); |
| 1374 | } |
| 1375 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1376 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& /*descriptor*/, |
| 1377 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1378 | { |
| 1379 | return std::unique_ptr<IWorkload>(); |
| 1380 | } |
| 1381 | |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 1382 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertBf16ToFp32(const ConvertBf16ToFp32QueueDescriptor& /*desc*/, |
| 1383 | const WorkloadInfo& /*info*/) const |
| 1384 | { |
| 1385 | return std::unique_ptr<IWorkload>(); |
| 1386 | } |
| 1387 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1388 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp16ToFp32(const ConvertFp16ToFp32QueueDescriptor& /*desc*/, |
| 1389 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1390 | { |
| 1391 | return std::unique_ptr<IWorkload>(); |
| 1392 | } |
| 1393 | |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 1394 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp32ToBf16(const ConvertFp32ToBf16QueueDescriptor& /*desc*/, |
| 1395 | const WorkloadInfo& /*info*/) const |
| 1396 | { |
| 1397 | return std::unique_ptr<IWorkload>(); |
| 1398 | } |
| 1399 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1400 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp32ToFp16(const ConvertFp32ToFp16QueueDescriptor& /*desc*/, |
| 1401 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1402 | { |
| 1403 | return std::unique_ptr<IWorkload>(); |
| 1404 | } |
| 1405 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1406 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvolution2d(const Convolution2dQueueDescriptor& /*descriptor*/, |
| 1407 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1408 | { |
| 1409 | return std::unique_ptr<IWorkload>(); |
| 1410 | } |
| 1411 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1412 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDebug(const DebugQueueDescriptor& /*descriptor*/, |
| 1413 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1414 | { |
| 1415 | return std::unique_ptr<IWorkload>(); |
| 1416 | } |
| 1417 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1418 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDepthToSpace(const DepthToSpaceQueueDescriptor& /*descriptor*/, |
| 1419 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 1420 | { |
| 1421 | return std::unique_ptr<IWorkload>(); |
| 1422 | } |
| 1423 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1424 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDepthwiseConvolution2d( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1425 | const DepthwiseConvolution2dQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1426 | { |
| 1427 | return std::unique_ptr<IWorkload>(); |
| 1428 | } |
| 1429 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 1430 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDequantize( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1431 | const DequantizeQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 1432 | { |
| 1433 | return std::unique_ptr<IWorkload>(); |
| 1434 | } |
| 1435 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1436 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDetectionPostProcess( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1437 | const DetectionPostProcessQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1438 | { |
| 1439 | return std::unique_ptr<IWorkload>(); |
| 1440 | } |
| 1441 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1442 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDivision(const DivisionQueueDescriptor& /*descriptor*/, |
| 1443 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1444 | { |
| 1445 | return std::unique_ptr<IWorkload>(); |
| 1446 | } |
| 1447 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 1448 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateElementwiseUnary(const ElementwiseUnaryQueueDescriptor& /*desc*/, |
| 1449 | const WorkloadInfo& /*info*/) const |
| 1450 | { |
| 1451 | return std::unique_ptr<IWorkload>(); |
| 1452 | } |
| 1453 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1454 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateEqual(const EqualQueueDescriptor& /*descriptor*/, |
| 1455 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1456 | { |
| 1457 | return std::unique_ptr<IWorkload>(); |
| 1458 | } |
| 1459 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1460 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFakeQuantization(const FakeQuantizationQueueDescriptor& /*desc*/, |
| 1461 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1462 | { |
| 1463 | return std::unique_ptr<IWorkload>(); |
| 1464 | } |
| 1465 | |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 1466 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFill(const FillQueueDescriptor& /*descriptor*/, |
| 1467 | const WorkloadInfo& /*info*/) const |
| 1468 | { |
| 1469 | return std::unique_ptr<IWorkload>(); |
| 1470 | } |
| 1471 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1472 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFloor(const FloorQueueDescriptor& /*descriptor*/, |
| 1473 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1474 | { |
| 1475 | return std::unique_ptr<IWorkload>(); |
| 1476 | } |
| 1477 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1478 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFullyConnected(const FullyConnectedQueueDescriptor& /*descriptor*/, |
| 1479 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1480 | { |
| 1481 | return std::unique_ptr<IWorkload>(); |
| 1482 | } |
| 1483 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1484 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateGather(const GatherQueueDescriptor& /*descriptor*/, |
| 1485 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1486 | { |
| 1487 | return std::unique_ptr<IWorkload>(); |
| 1488 | } |
| 1489 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1490 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateGreater(const GreaterQueueDescriptor& /*descriptor*/, |
| 1491 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1492 | { |
| 1493 | return std::unique_ptr<IWorkload>(); |
| 1494 | } |
| 1495 | |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 1496 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateInstanceNormalization( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1497 | const InstanceNormalizationQueueDescriptor& /*descriptor*/, |
| 1498 | const WorkloadInfo& /*info*/) const |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 1499 | { |
| 1500 | return std::unique_ptr<IWorkload>(); |
| 1501 | } |
| 1502 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1503 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateL2Normalization(const L2NormalizationQueueDescriptor& /*desc*/, |
| 1504 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1505 | { |
| 1506 | return std::unique_ptr<IWorkload>(); |
| 1507 | } |
| 1508 | |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 1509 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogicalBinary(const LogicalBinaryQueueDescriptor& /*desc*/, |
| 1510 | const WorkloadInfo& /*info*/) const |
| 1511 | { |
| 1512 | return std::unique_ptr<IWorkload>(); |
| 1513 | } |
| 1514 | |
| 1515 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogicalUnary(const ElementwiseUnaryQueueDescriptor& /*desc*/, |
| 1516 | const WorkloadInfo& /*info*/) const |
| 1517 | { |
| 1518 | return std::unique_ptr<IWorkload>(); |
| 1519 | } |
| 1520 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1521 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogSoftmax(const LogSoftmaxQueueDescriptor& /*descriptor*/, |
| 1522 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 1523 | { |
| 1524 | return std::unique_ptr<IWorkload>(); |
| 1525 | } |
| 1526 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1527 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLstm(const LstmQueueDescriptor& /*descriptor*/, |
| 1528 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1529 | { |
| 1530 | return std::unique_ptr<IWorkload>(); |
| 1531 | } |
| 1532 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1533 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMaximum(const MaximumQueueDescriptor& /*descriptor*/, |
| 1534 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1535 | { |
| 1536 | return std::unique_ptr<IWorkload>(); |
| 1537 | } |
| 1538 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1539 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMean(const MeanQueueDescriptor& /*descriptor*/, |
| 1540 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1541 | { |
| 1542 | return std::unique_ptr<IWorkload>(); |
| 1543 | } |
| 1544 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1545 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMemCopy(const MemCopyQueueDescriptor& /*descriptor*/, |
| 1546 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1547 | { |
| 1548 | return std::unique_ptr<IWorkload>(); |
| 1549 | } |
| 1550 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1551 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMemImport(const MemImportQueueDescriptor& /*descriptor*/, |
| 1552 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 1553 | { |
| 1554 | return std::unique_ptr<IWorkload>(); |
| 1555 | } |
| 1556 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1557 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMerge(const MergeQueueDescriptor& /*descriptor*/, |
| 1558 | const WorkloadInfo& /*info*/) const |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 1559 | { |
| 1560 | return std::unique_ptr<IWorkload>(); |
| 1561 | } |
| 1562 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1563 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMerger(const MergerQueueDescriptor& /*descriptor*/, |
| 1564 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1565 | { |
| 1566 | return std::unique_ptr<IWorkload>(); |
| 1567 | } |
| 1568 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1569 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMinimum(const MinimumQueueDescriptor& /*descriptor*/, |
| 1570 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1571 | { |
| 1572 | return std::unique_ptr<IWorkload>(); |
| 1573 | } |
| 1574 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1575 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMultiplication(const MultiplicationQueueDescriptor& /*descriptor*/, |
| 1576 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1577 | { |
| 1578 | return std::unique_ptr<IWorkload>(); |
| 1579 | } |
| 1580 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1581 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateNormalization(const NormalizationQueueDescriptor& /*descriptor*/, |
| 1582 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1583 | { |
| 1584 | return std::unique_ptr<IWorkload>(); |
| 1585 | } |
| 1586 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1587 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateOutput(const OutputQueueDescriptor& /*descriptor*/, |
| 1588 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1589 | { |
| 1590 | return std::unique_ptr<IWorkload>(); |
| 1591 | } |
| 1592 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1593 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePad(const PadQueueDescriptor& /*descriptor*/, |
| 1594 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1595 | { |
| 1596 | return std::unique_ptr<IWorkload>(); |
| 1597 | } |
| 1598 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1599 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePermute(const PermuteQueueDescriptor& /*descriptor*/, |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1600 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1601 | { |
| 1602 | return std::unique_ptr<IWorkload>(); |
| 1603 | } |
| 1604 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1605 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePooling2d(const Pooling2dQueueDescriptor& /*descriptor*/, |
| 1606 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1607 | { |
| 1608 | return std::unique_ptr<IWorkload>(); |
| 1609 | } |
| 1610 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1611 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePreCompiled(const PreCompiledQueueDescriptor& /*descriptor*/, |
| 1612 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1613 | { |
| 1614 | return std::unique_ptr<IWorkload>(); |
| 1615 | } |
| 1616 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1617 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePrelu(const PreluQueueDescriptor &/*descriptor*/, |
| 1618 | const WorkloadInfo &/*info*/) const |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1619 | { |
| 1620 | return std::unique_ptr<IWorkload>(); |
| 1621 | } |
| 1622 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1623 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQuantize(const QuantizeQueueDescriptor& /*descriptor*/, |
| 1624 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1625 | { |
| 1626 | return std::unique_ptr<IWorkload>(); |
| 1627 | } |
| 1628 | |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 1629 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQLstm(const QLstmQueueDescriptor& /*descriptor*/, |
| 1630 | const WorkloadInfo& /*info*/) const |
| 1631 | { |
| 1632 | return std::unique_ptr<IWorkload>(); |
| 1633 | } |
| 1634 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1635 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQuantizedLstm(const QuantizedLstmQueueDescriptor& /*descriptor*/, |
| 1636 | const WorkloadInfo& /*info*/) const |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1637 | { |
| 1638 | return std::unique_ptr<IWorkload>(); |
| 1639 | } |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 1640 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateRank(const RankQueueDescriptor& /*descriptor*/, |
| 1641 | const WorkloadInfo& /*info*/) const |
| 1642 | { |
| 1643 | return std::unique_ptr<IWorkload>(); |
| 1644 | } |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1645 | |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 1646 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateReduce(const ReduceQueueDescriptor& /*descriptor*/, |
| 1647 | const WorkloadInfo& /*info*/) const |
| 1648 | { |
| 1649 | return std::unique_ptr<IWorkload>(); |
| 1650 | } |
| 1651 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1652 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateReshape(const ReshapeQueueDescriptor& /*descriptor*/, |
| 1653 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1654 | { |
| 1655 | return std::unique_ptr<IWorkload>(); |
| 1656 | } |
| 1657 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1658 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateResizeBilinear(const ResizeBilinearQueueDescriptor& /*descriptor*/, |
| 1659 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1660 | { |
| 1661 | return std::unique_ptr<IWorkload>(); |
| 1662 | } |
| 1663 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1664 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateResize(const ResizeQueueDescriptor& /*descriptor*/, |
| 1665 | const WorkloadInfo& /*info*/) const |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 1666 | { |
| 1667 | return std::unique_ptr<IWorkload>(); |
| 1668 | } |
| 1669 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1670 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateRsqrt(const RsqrtQueueDescriptor& /*descriptor*/, |
| 1671 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1672 | { |
| 1673 | return std::unique_ptr<IWorkload>(); |
| 1674 | } |
| 1675 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1676 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSlice(const SliceQueueDescriptor& /*descriptor*/, |
| 1677 | const WorkloadInfo& /*info*/) const |
| 1678 | { |
| 1679 | return std::unique_ptr<IWorkload>(); |
| 1680 | } |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1681 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1682 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSoftmax(const SoftmaxQueueDescriptor& /*descriptor*/, |
| 1683 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1684 | { |
| 1685 | return std::unique_ptr<IWorkload>(); |
| 1686 | } |
| 1687 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1688 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSplitter(const SplitterQueueDescriptor& /*descriptor*/, |
| 1689 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1690 | { |
| 1691 | return std::unique_ptr<IWorkload>(); |
| 1692 | } |
| 1693 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1694 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSpaceToBatchNd(const SpaceToBatchNdQueueDescriptor& /*descriptor*/, |
| 1695 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1696 | { |
| 1697 | return std::unique_ptr<IWorkload>(); |
| 1698 | } |
| 1699 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1700 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSpaceToDepth(const SpaceToDepthQueueDescriptor& /*descriptor*/, |
| 1701 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1702 | { |
| 1703 | return std::unique_ptr<IWorkload>(); |
| 1704 | } |
| 1705 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1706 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateStack(const StackQueueDescriptor& /*descriptor*/, |
| 1707 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1708 | { |
| 1709 | return std::unique_ptr<IWorkload>(); |
| 1710 | } |
| 1711 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1712 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateStridedSlice(const StridedSliceQueueDescriptor& /*descriptor*/, |
| 1713 | const WorkloadInfo& /*info*/) const |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1714 | { |
| 1715 | return std::unique_ptr<IWorkload>(); |
| 1716 | } |
| 1717 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1718 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSubtraction(const SubtractionQueueDescriptor& /*descriptor*/, |
| 1719 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1720 | { |
| 1721 | return std::unique_ptr<IWorkload>(); |
| 1722 | } |
| 1723 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1724 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSwitch(const SwitchQueueDescriptor& /*descriptor*/, |
| 1725 | const WorkloadInfo& /*info*/) const |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1726 | { |
| 1727 | return std::unique_ptr<IWorkload>(); |
| 1728 | } |
| 1729 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1730 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateTranspose(const TransposeQueueDescriptor& /*descriptor*/, |
| 1731 | const WorkloadInfo& /*info*/) const |
| 1732 | { |
| 1733 | return std::unique_ptr<IWorkload>(); |
| 1734 | } |
| 1735 | |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1736 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateTransposeConvolution2d( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1737 | const TransposeConvolution2dQueueDescriptor& /*descriptor*/, |
| 1738 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1739 | { |
| 1740 | return std::unique_ptr<IWorkload>(); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 1741 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1742 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1743 | } // namepsace armnn |