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