| 144 | } |
| 145 | |
| 146 | std::unique_ptr<IWorkload> RefWorkloadFactory::CreateWorkload(LayerType type, |
| 147 | const QueueDescriptor& descriptor, |
| 148 | const WorkloadInfo& info) const |
| 149 | { |
| 150 | switch(type) |
| 151 | { |
| 152 | case LayerType::Activation : |
| 153 | { |
| 154 | auto activationQueueDescriptor = PolymorphicDowncast<const ActivationQueueDescriptor*>(&descriptor); |
| 155 | return std::make_unique<RefActivationWorkload>(*activationQueueDescriptor, info); |
| 156 | } |
| 157 | case LayerType::Addition : |
| 158 | { |
| 159 | auto additionQueueDescriptor = PolymorphicDowncast<const AdditionQueueDescriptor*>(&descriptor); |
| 160 | if (info.m_InputTensorInfos[0].GetDataType() == armnn::DataType::Signed32) |
| 161 | { |
| 162 | return std::make_unique<RefAdditionWorkload<int32_t>>(*additionQueueDescriptor, info); |
| 163 | } |
| 164 | else |
| 165 | { |
| 166 | return std::make_unique<RefAdditionWorkload<float>>(*additionQueueDescriptor, info); |
| 167 | } |
| 168 | } |
| 169 | case LayerType::ArgMinMax : |
| 170 | { |
| 171 | auto argMinMaxQueueDescriptor = PolymorphicDowncast<const ArgMinMaxQueueDescriptor*>(&descriptor); |
| 172 | return std::make_unique<RefArgMinMaxWorkload>(*argMinMaxQueueDescriptor, info); |
| 173 | } |
| 174 | case LayerType::BatchMatMul: |
| 175 | { |
| 176 | auto batchMatMulQueueDescriptor = PolymorphicDowncast<const BatchMatMulQueueDescriptor*>(&descriptor); |
| 177 | return std::make_unique<RefBatchMatMulWorkload>(*batchMatMulQueueDescriptor, info); |
| 178 | } |
| 179 | case LayerType::BatchNormalization : |
| 180 | { |
| 181 | auto batchNormQueueDescriptor = PolymorphicDowncast<const BatchNormalizationQueueDescriptor*>(&descriptor); |
| 182 | return std::make_unique<RefBatchNormalizationWorkload>(*batchNormQueueDescriptor, info); |
| 183 | } |
| 184 | case LayerType::BatchToSpaceNd : |
| 185 | { |
| 186 | auto batchToSpaceNdQueueDescriptor |
| 187 | = PolymorphicDowncast<const BatchToSpaceNdQueueDescriptor*>(&descriptor); |
| 188 | return std::make_unique<RefBatchToSpaceNdWorkload>(*batchToSpaceNdQueueDescriptor, info); |
| 189 | } |
| 190 | case LayerType::BroadcastTo: |
| 191 | { |
| 192 | auto broadcastToQueueDescriptor = PolymorphicDowncast<const BroadcastToQueueDescriptor*>(&descriptor); |
| 193 | return std::make_unique<RefBroadcastToWorkload>(*broadcastToQueueDescriptor, info); |
| 194 | } |
| 195 | case LayerType::Cast : |
| 196 | { |
| 197 | auto castQueueDescriptor = PolymorphicDowncast<const CastQueueDescriptor*>(&descriptor); |
| 198 | return std::make_unique<RefCastWorkload>(*castQueueDescriptor, info); |
| 199 | } |
| 200 | case LayerType::ChannelShuffle : |
| 201 | { |
| 202 | auto channelShuffleQueueDescriptor |
| 203 | = PolymorphicDowncast<const ChannelShuffleQueueDescriptor*>(&descriptor); |
no test coverage detected