| 245 | } |
| 246 | |
| 247 | std::unique_ptr<IWorkload> ClWorkloadFactory::CreateWorkload(LayerType type, |
| 248 | const QueueDescriptor& descriptor, |
| 249 | const WorkloadInfo& info) const |
| 250 | { |
| 251 | switch(type) |
| 252 | { |
| 253 | case LayerType::Activation : |
| 254 | { |
| 255 | auto activationQueueDescriptor = PolymorphicDowncast<const ActivationQueueDescriptor*>(&descriptor); |
| 256 | return MakeWorkload<ClActivationWorkload>(*activationQueueDescriptor, info, m_CLCompileContext); |
| 257 | } |
| 258 | case LayerType::Addition : |
| 259 | { |
| 260 | auto additionQueueDescriptor = PolymorphicDowncast<const AdditionQueueDescriptor*>(&descriptor); |
| 261 | return MakeWorkload<ClAdditionWorkload>(*additionQueueDescriptor, info, m_CLCompileContext); |
| 262 | } |
| 263 | case LayerType::ArgMinMax : |
| 264 | { |
| 265 | auto argMinMaxQueueDescriptor = PolymorphicDowncast<const ArgMinMaxQueueDescriptor*>(&descriptor); |
| 266 | return MakeWorkload<ClArgMinMaxWorkload>(*argMinMaxQueueDescriptor, info, m_CLCompileContext); |
| 267 | } |
| 268 | case LayerType::BatchMatMul : |
| 269 | { |
| 270 | auto batchMatMulQueueDescriptor = PolymorphicDowncast<const BatchMatMulQueueDescriptor*>(&descriptor); |
| 271 | return std::make_unique<ClBatchMatMulWorkload>(*batchMatMulQueueDescriptor, info, m_CLCompileContext); |
| 272 | } |
| 273 | case LayerType::BatchNormalization : |
| 274 | { |
| 275 | auto batchNormalizationQueueDescriptor |
| 276 | = PolymorphicDowncast<const BatchNormalizationQueueDescriptor*>(&descriptor); |
| 277 | return MakeWorkload<ClBatchNormalizationFloatWorkload, NullWorkload> |
| 278 | (*batchNormalizationQueueDescriptor, info, m_CLCompileContext); |
| 279 | } |
| 280 | case LayerType::BatchToSpaceNd : |
| 281 | { |
| 282 | auto batchToSpaceNdQueueDescriptor |
| 283 | = PolymorphicDowncast<const BatchToSpaceNdQueueDescriptor*>(&descriptor); |
| 284 | return MakeWorkload<ClBatchToSpaceNdWorkload>(*batchToSpaceNdQueueDescriptor, info, m_CLCompileContext); |
| 285 | } |
| 286 | case LayerType::Cast : |
| 287 | { |
| 288 | auto castQueueDescriptor = PolymorphicDowncast<const CastQueueDescriptor*>(&descriptor); |
| 289 | return MakeWorkload<ClCastWorkload>(*castQueueDescriptor, info, m_CLCompileContext); |
| 290 | } |
| 291 | case LayerType::ChannelShuffle : |
| 292 | { |
| 293 | auto channelShuffleQueueDescriptor |
| 294 | = PolymorphicDowncast<const ChannelShuffleQueueDescriptor*>(&descriptor); |
| 295 | return MakeWorkload<ClChannelShuffleWorkload>(*channelShuffleQueueDescriptor, info, m_CLCompileContext); |
| 296 | } |
| 297 | case LayerType::Comparison : |
| 298 | { |
| 299 | auto comparisonQueueDescriptor = PolymorphicDowncast<const ComparisonQueueDescriptor*>(&descriptor); |
| 300 | return MakeWorkload<ClComparisonWorkload>(*comparisonQueueDescriptor, info, m_CLCompileContext); |
| 301 | } |
| 302 | case LayerType::Concat : |
| 303 | { |
| 304 | auto concatQueueDescriptor = PolymorphicDowncast<const ConcatQueueDescriptor*>(&descriptor); |
no test coverage detected