2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include <backendsCommon/test/EndToEndTestImpl.hpp>
8 #include <backendsCommon/test/ActivationEndToEndTestImpl.hpp>
9 #include <backendsCommon/test/ArgMinMaxEndToEndTestImpl.hpp>
10 #include <backendsCommon/test/ComparisonEndToEndTestImpl.hpp>
11 #include <backendsCommon/test/ConcatEndToEndTestImpl.hpp>
12 #include <backendsCommon/test/DepthToSpaceEndToEndTestImpl.hpp>
13 #include <backendsCommon/test/DequantizeEndToEndTestImpl.hpp>
14 #include <backendsCommon/test/DetectionPostProcessEndToEndTestImpl.hpp>
15 #include <backendsCommon/test/ElementwiseUnaryEndToEndTestImpl.hpp>
16 #include <backendsCommon/test/InstanceNormalizationEndToEndTestImpl.hpp>
17 #include <backendsCommon/test/PreluEndToEndTestImpl.hpp>
18 #include <backendsCommon/test/QuantizedLstmEndToEndTestImpl.hpp>
19 #include <backendsCommon/test/SpaceToDepthEndToEndTestImpl.hpp>
20 #include <backendsCommon/test/SplitterEndToEndTestImpl.hpp>
21 #include <backendsCommon/test/TransposeConvolution2dEndToEndTestImpl.hpp>
23 #include <boost/test/unit_test.hpp>
25 BOOST_AUTO_TEST_SUITE(NeonEndToEnd)
27 std::vector<armnn::BackendId> defaultBackends = {armnn::Compute::CpuAcc};
30 BOOST_AUTO_TEST_CASE(NeonAbsEndToEndTestFloat32)
32 std::vector<float> expectedOutput =
34 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f,
35 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f
38 ElementwiseUnarySimpleEndToEnd<armnn::DataType::Float32>(defaultBackends,
44 BOOST_AUTO_TEST_CASE(ConstantUsage_Neon_Float32)
46 BOOST_TEST(ConstantUsageFloat32Test(defaultBackends));
49 #if defined(ARMNNREF_ENABLED)
51 // This test unit needs the reference backend, it's not available if the reference backend is not built
53 BOOST_AUTO_TEST_CASE(FallbackToCpuRef)
55 using namespace armnn;
57 // Create runtime in which test will run and allow fallback to CpuRef.
58 IRuntime::CreationOptions options;
59 IRuntimePtr runtime(IRuntime::Create(options));
61 // Builds up the structure of the network.
62 INetworkPtr net(INetwork::Create());
64 IConnectableLayer* input = net->AddInputLayer(0);
66 // This layer configuration isn't supported by CpuAcc but we allow fallback to CpuRef so it shoud pass.
67 NormalizationDescriptor descriptor;
68 IConnectableLayer* pooling = net->AddNormalizationLayer(descriptor);
70 IConnectableLayer* output = net->AddOutputLayer(0);
72 input->GetOutputSlot(0).Connect(pooling->GetInputSlot(0));
73 pooling->GetOutputSlot(0).Connect(output->GetInputSlot(0));
75 input->GetOutputSlot(0).SetTensorInfo(TensorInfo({ 1, 1, 4, 4 }, DataType::Float32));
76 pooling->GetOutputSlot(0).SetTensorInfo(TensorInfo({ 1, 1, 4, 4 }, DataType::Float32));
78 // optimize the network
79 std::vector<BackendId> backends = {Compute::CpuAcc, Compute::CpuRef};
80 IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime->GetDeviceSpec());
82 // Load it into the runtime. It should pass.
84 BOOST_TEST(runtime->LoadNetwork(netId, std::move(optNet)) == Status::Success);
89 BOOST_AUTO_TEST_CASE(NeonGreaterSimpleEndToEndTest)
91 const std::vector<uint8_t> expectedOutput({ 0, 0, 0, 0, 1, 1, 1, 1,
92 0, 0, 0, 0, 0, 0, 0, 0 });
94 ComparisonSimpleEndToEnd<armnn::DataType::Float32>(defaultBackends,
95 ComparisonOperation::Greater,
99 BOOST_AUTO_TEST_CASE(NeonGreaterSimpleEndToEndUint8Test)
101 const std::vector<uint8_t> expectedOutput({ 0, 0, 0, 0, 1, 1, 1, 1,
102 0, 0, 0, 0, 0, 0, 0, 0 });
104 ComparisonSimpleEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends,
105 ComparisonOperation::Greater,
109 BOOST_AUTO_TEST_CASE(NeonGreaterBroadcastEndToEndTest)
111 const std::vector<uint8_t> expectedOutput({ 0, 1, 0, 0, 0, 1,
114 ComparisonBroadcastEndToEnd<armnn::DataType::Float32>(defaultBackends,
115 ComparisonOperation::Greater,
119 BOOST_AUTO_TEST_CASE(NeonGreaterBroadcastEndToEndUint8Test)
121 const std::vector<uint8_t> expectedOutput({ 0, 1, 0, 0, 0, 1,
124 ComparisonBroadcastEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends,
125 ComparisonOperation::Greater,
129 BOOST_AUTO_TEST_CASE(NeonConcatEndToEndDim0Test)
131 ConcatDim0EndToEnd<armnn::DataType::Float32>(defaultBackends);
134 BOOST_AUTO_TEST_CASE(NeonConcatEndToEndDim0Uint8Test)
136 ConcatDim0EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
139 BOOST_AUTO_TEST_CASE(NeonConcatEndToEndDim1Test)
141 ConcatDim1EndToEnd<armnn::DataType::Float32>(defaultBackends);
144 BOOST_AUTO_TEST_CASE(NeonConcatEndToEndDim1Uint8Test)
146 ConcatDim1EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
149 BOOST_AUTO_TEST_CASE(NeonConcatEndToEndDim3Test)
151 ConcatDim3EndToEnd<armnn::DataType::Float32>(defaultBackends);
154 BOOST_AUTO_TEST_CASE(NeonConcatEndToEndDim3Uint8Test)
156 ConcatDim3EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
160 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNchwFloat32)
162 DepthToSpaceEndToEnd<armnn::DataType::Float32>(defaultBackends, armnn::DataLayout::NCHW);
165 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNchwFloat16)
167 DepthToSpaceEndToEnd<armnn::DataType::Float16>(defaultBackends, armnn::DataLayout::NCHW);
170 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNchwUint8)
172 DepthToSpaceEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends, armnn::DataLayout::NCHW);
175 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNchwInt16)
177 DepthToSpaceEndToEnd<armnn::DataType::QSymmS16>(defaultBackends, armnn::DataLayout::NCHW);
180 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNhwcFloat32)
182 DepthToSpaceEndToEnd<armnn::DataType::Float32>(defaultBackends, armnn::DataLayout::NHWC);
185 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNhwcFloat16)
187 DepthToSpaceEndToEnd<armnn::DataType::Float16>(defaultBackends, armnn::DataLayout::NHWC);
190 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNhwcUint8)
192 DepthToSpaceEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends, armnn::DataLayout::NHWC);
195 BOOST_AUTO_TEST_CASE(DephtToSpaceEndToEndNhwcInt16)
197 DepthToSpaceEndToEnd<armnn::DataType::QSymmS16>(defaultBackends, armnn::DataLayout::NHWC);
201 BOOST_AUTO_TEST_CASE(DequantizeEndToEndSimpleTest)
203 DequantizeEndToEndSimple<armnn::DataType::QAsymmU8>(defaultBackends);
206 BOOST_AUTO_TEST_CASE(DequantizeEndToEndOffsetTest)
208 DequantizeEndToEndOffset<armnn::DataType::QAsymmU8>(defaultBackends);
211 BOOST_AUTO_TEST_CASE(NeonEluEndToEndTestFloat32)
213 EluEndToEndTest<armnn::DataType::Float32>(defaultBackends);
216 BOOST_AUTO_TEST_CASE(NeonEluEndToEndTestFloat16)
218 EluEndToEndTest<armnn::DataType::Float16>(defaultBackends);
221 BOOST_AUTO_TEST_CASE(NeonPreluEndToEndFloat32Test)
223 PreluEndToEndNegativeTest<armnn::DataType::Float32>(defaultBackends);
226 BOOST_AUTO_TEST_CASE(NeonPreluEndToEndTestUint8Test)
228 PreluEndToEndPositiveTest<armnn::DataType::QAsymmU8>(defaultBackends);
231 BOOST_AUTO_TEST_CASE(NeonSpaceToDepthNhwcEndToEndTest1)
233 SpaceToDepthNhwcEndToEndTest1(defaultBackends);
236 BOOST_AUTO_TEST_CASE(NeonSpaceToDepthNchwEndToEndTest1)
238 SpaceToDepthNchwEndToEndTest1(defaultBackends);
241 BOOST_AUTO_TEST_CASE(NeonSpaceToDepthNhwcEndToEndTest2)
243 SpaceToDepthNhwcEndToEndTest2(defaultBackends);
246 BOOST_AUTO_TEST_CASE(NeonSpaceToDepthNchwEndToEndTest2)
248 SpaceToDepthNchwEndToEndTest2(defaultBackends);
251 BOOST_AUTO_TEST_CASE(NeonSplitter1dEndToEndTest)
253 Splitter1dEndToEnd<armnn::DataType::Float32>(defaultBackends);
256 BOOST_AUTO_TEST_CASE(NeonSplitter1dEndToEndUint8Test)
258 Splitter1dEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
261 BOOST_AUTO_TEST_CASE(NeonSplitter2dDim0EndToEndTest)
263 Splitter2dDim0EndToEnd<armnn::DataType::Float32>(defaultBackends);
266 BOOST_AUTO_TEST_CASE(NeonSplitter2dDim1EndToEndTest)
268 Splitter2dDim1EndToEnd<armnn::DataType::Float32>(defaultBackends);
271 BOOST_AUTO_TEST_CASE(NeonSplitter2dDim0EndToEndUint8Test)
273 Splitter2dDim0EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
276 BOOST_AUTO_TEST_CASE(NeonSplitter2dDim1EndToEndUint8Test)
278 Splitter2dDim1EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
281 BOOST_AUTO_TEST_CASE(NeonSplitter3dDim0EndToEndTest)
283 Splitter3dDim0EndToEnd<armnn::DataType::Float32>(defaultBackends);
286 BOOST_AUTO_TEST_CASE(NeonSplitter3dDim1EndToEndTest)
288 Splitter3dDim1EndToEnd<armnn::DataType::Float32>(defaultBackends);
291 BOOST_AUTO_TEST_CASE(NeonSplitter3dDim2EndToEndTest)
293 Splitter3dDim2EndToEnd<armnn::DataType::Float32>(defaultBackends);
296 BOOST_AUTO_TEST_CASE(NeonSplitter3dDim0EndToEndUint8Test)
298 Splitter3dDim0EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
301 BOOST_AUTO_TEST_CASE(NeonSplitter3dDim1EndToEndUint8Test)
303 Splitter3dDim1EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
306 BOOST_AUTO_TEST_CASE(NeonSplitter3dDim2EndToEndUint8Test)
308 Splitter3dDim2EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
311 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim0EndToEndTest)
313 Splitter4dDim0EndToEnd<armnn::DataType::Float32>(defaultBackends);
316 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim1EndToEndTest)
318 Splitter4dDim1EndToEnd<armnn::DataType::Float32>(defaultBackends);
321 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim2EndToEndTest)
323 Splitter4dDim2EndToEnd<armnn::DataType::Float32>(defaultBackends);
326 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim3EndToEndTest)
328 Splitter4dDim3EndToEnd<armnn::DataType::Float32>(defaultBackends);
331 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim0EndToEndUint8Test)
333 Splitter4dDim0EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
336 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim1EndToEndUint8Test)
338 Splitter4dDim1EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
341 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim2EndToEndUint8Test)
343 Splitter4dDim2EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
346 BOOST_AUTO_TEST_CASE(NeonSplitter4dDim3EndToEndUint8Test)
348 Splitter4dDim3EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
351 BOOST_AUTO_TEST_CASE(NeonQuantizedLstmEndToEndTest)
353 QuantizedLstmEndToEnd(defaultBackends);
356 BOOST_AUTO_TEST_CASE(NeonTransposeConvolution2dEndToEndFloatNchwTest)
358 TransposeConvolution2dEndToEnd<armnn::DataType::Float32, armnn::DataType::Float32>(
359 defaultBackends, armnn::DataLayout::NCHW);
362 BOOST_AUTO_TEST_CASE(NeonTransposeConvolution2dEndToEndUint8NchwTest)
364 TransposeConvolution2dEndToEnd<armnn::DataType::QAsymmU8, armnn::DataType::Signed32>(
365 defaultBackends, armnn::DataLayout::NCHW);
368 BOOST_AUTO_TEST_CASE(NeonTransposeConvolution2dEndToEndFloatNhwcTest)
370 TransposeConvolution2dEndToEnd<armnn::DataType::Float32, armnn::DataType::Float32>(
371 defaultBackends, armnn::DataLayout::NHWC);
374 BOOST_AUTO_TEST_CASE(NeonTransposeConvolution2dEndToEndUint8NhwcTest)
376 TransposeConvolution2dEndToEnd<armnn::DataType::QAsymmU8, armnn::DataType::Signed32>(
377 defaultBackends, armnn::DataLayout::NHWC);
380 BOOST_AUTO_TEST_CASE(NeonImportNonAlignedInputPointerTest)
382 ImportNonAlignedInputPointerTest(defaultBackends);
385 BOOST_AUTO_TEST_CASE(NeonExportNonAlignedOutputPointerTest)
387 ExportNonAlignedOutputPointerTest(defaultBackends);
390 BOOST_AUTO_TEST_CASE(NeonImportAlignedPointerTest, * boost::unit_test::disabled())
392 ImportAlignedPointerTest(defaultBackends);
395 BOOST_AUTO_TEST_CASE(NeonImportOnlyWorkload, * boost::unit_test::disabled())
397 ImportOnlyWorkload(defaultBackends);
400 BOOST_AUTO_TEST_CASE(NeonExportOnlyWorkload, * boost::unit_test::disabled())
402 ExportOnlyWorkload(defaultBackends);
405 BOOST_AUTO_TEST_CASE(NeonImportAndExportWorkload, * boost::unit_test::disabled())
407 ImportAndExportWorkload(defaultBackends);
410 BOOST_AUTO_TEST_CASE(NeonExportOutputWithSeveralOutputSlotConnectionsTest, * boost::unit_test::disabled())
412 ExportOutputWithSeveralOutputSlotConnectionsTest(defaultBackends);
415 // InstanceNormalization
416 BOOST_AUTO_TEST_CASE(NeonInstanceNormalizationNchwEndToEndTest1)
418 InstanceNormalizationNchwEndToEndTest1(defaultBackends);
421 BOOST_AUTO_TEST_CASE(NeonInstanceNormalizationNchwEndToEndTest2)
423 InstanceNormalizationNchwEndToEndTest2(defaultBackends);
427 BOOST_AUTO_TEST_CASE(NeonArgMaxSimpleTest)
429 ArgMaxEndToEndSimple<armnn::DataType::Float32>(defaultBackends);
432 BOOST_AUTO_TEST_CASE(NeonArgMinSimpleTest)
434 ArgMinEndToEndSimple<armnn::DataType::Float32>(defaultBackends);
437 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis0Test)
439 ArgMaxAxis0EndToEnd<armnn::DataType::Float32>(defaultBackends);
442 BOOST_AUTO_TEST_CASE(NeonArgMinAxis0Test)
444 ArgMinAxis0EndToEnd<armnn::DataType::Float32>(defaultBackends);
447 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis1Test)
449 ArgMaxAxis1EndToEnd<armnn::DataType::Float32>(defaultBackends);
452 BOOST_AUTO_TEST_CASE(NeonArgMinAxis1Test)
454 ArgMinAxis1EndToEnd<armnn::DataType::Float32>(defaultBackends);
457 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis2Test)
459 ArgMaxAxis2EndToEnd<armnn::DataType::Float32>(defaultBackends);
462 BOOST_AUTO_TEST_CASE(NeonArgMinAxis2Test)
464 ArgMinAxis2EndToEnd<armnn::DataType::Float32>(defaultBackends);
467 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis3Test)
469 ArgMaxAxis3EndToEnd<armnn::DataType::Float32>(defaultBackends);
472 BOOST_AUTO_TEST_CASE(NeonArgMinAxis3Test)
474 ArgMinAxis3EndToEnd<armnn::DataType::Float32>(defaultBackends);
477 BOOST_AUTO_TEST_CASE(NeonArgMaxSimpleTestQuantisedAsymm8)
479 ArgMaxEndToEndSimple<armnn::DataType::QAsymmU8>(defaultBackends);
482 BOOST_AUTO_TEST_CASE(NeonArgMinSimpleTestQuantisedAsymm8)
484 ArgMinEndToEndSimple<armnn::DataType::QAsymmU8>(defaultBackends);
487 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis0TestQuantisedAsymm8)
489 ArgMaxAxis0EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
492 BOOST_AUTO_TEST_CASE(NeonArgMinAxis0TestQuantisedAsymm8)
494 ArgMinAxis0EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
497 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis1TestQuantisedAsymm8)
499 ArgMaxAxis1EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
502 BOOST_AUTO_TEST_CASE(NeonArgMinAxis1TestQuantisedAsymm8)
504 ArgMinAxis1EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
507 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis2TestQuantisedAsymm8)
509 ArgMaxAxis2EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
512 BOOST_AUTO_TEST_CASE(NeonArgMinAxis2TestQuantisedAsymm8)
514 ArgMinAxis2EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
517 BOOST_AUTO_TEST_CASE(NeonArgMaxAxis3TestQuantisedAsymm8)
519 ArgMaxAxis3EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
522 BOOST_AUTO_TEST_CASE(NeonArgMinAxis3TestQuantisedAsymm8)
524 ArgMinAxis3EndToEnd<armnn::DataType::QAsymmU8>(defaultBackends);
527 BOOST_AUTO_TEST_CASE(NeonStridedSliceInvalidSliceEndToEndTest)
529 StridedSliceInvalidSliceEndToEndTest(defaultBackends);
532 BOOST_AUTO_TEST_CASE(NeonDetectionPostProcessRegularNmsTest, * boost::unit_test::disabled())
534 std::vector<float> boxEncodings({
535 0.0f, 0.0f, 0.0f, 0.0f,
536 0.0f, 1.0f, 0.0f, 0.0f,
537 0.0f, -1.0f, 0.0f, 0.0f,
538 0.0f, 0.0f, 0.0f, 0.0f,
539 0.0f, 1.0f, 0.0f, 0.0f,
540 0.0f, 0.0f, 0.0f, 0.0f
542 std::vector<float> scores({
550 std::vector<float> anchors({
551 0.5f, 0.5f, 1.0f, 1.0f,
552 0.5f, 0.5f, 1.0f, 1.0f,
553 0.5f, 0.5f, 1.0f, 1.0f,
554 0.5f, 10.5f, 1.0f, 1.0f,
555 0.5f, 10.5f, 1.0f, 1.0f,
556 0.5f, 100.5f, 1.0f, 1.0f
558 DetectionPostProcessRegularNmsEndToEnd<armnn::DataType::Float32>(defaultBackends, boxEncodings, scores, anchors);
561 inline void QuantizeData(uint8_t* quant, const float* dequant, const TensorInfo& info)
563 for (size_t i = 0; i < info.GetNumElements(); i++)
565 quant[i] = armnn::Quantize<uint8_t>(dequant[i], info.GetQuantizationScale(), info.GetQuantizationOffset());
569 BOOST_AUTO_TEST_CASE(NeonDetectionPostProcessRegularNmsUint8Test, * boost::unit_test::disabled())
571 armnn::TensorInfo boxEncodingsInfo({ 1, 6, 4 }, armnn::DataType::Float32);
572 armnn::TensorInfo scoresInfo({ 1, 6, 3 }, armnn::DataType::Float32);
573 armnn::TensorInfo anchorsInfo({ 6, 4 }, armnn::DataType::Float32);
575 boxEncodingsInfo.SetQuantizationScale(1.0f);
576 boxEncodingsInfo.SetQuantizationOffset(1);
577 scoresInfo.SetQuantizationScale(0.01f);
578 scoresInfo.SetQuantizationOffset(0);
579 anchorsInfo.SetQuantizationScale(0.5f);
580 anchorsInfo.SetQuantizationOffset(0);
582 std::vector<float> boxEncodings({
583 0.0f, 0.0f, 0.0f, 0.0f,
584 0.0f, 1.0f, 0.0f, 0.0f,
585 0.0f, -1.0f, 0.0f, 0.0f,
586 0.0f, 0.0f, 0.0f, 0.0f,
587 0.0f, 1.0f, 0.0f, 0.0f,
588 0.0f, 0.0f, 0.0f, 0.0f
590 std::vector<float> scores({
598 std::vector<float> anchors({
599 0.5f, 0.5f, 1.0f, 1.0f,
600 0.5f, 0.5f, 1.0f, 1.0f,
601 0.5f, 0.5f, 1.0f, 1.0f,
602 0.5f, 10.5f, 1.0f, 1.0f,
603 0.5f, 10.5f, 1.0f, 1.0f,
604 0.5f, 100.5f, 1.0f, 1.0f
607 std::vector<uint8_t> qBoxEncodings(boxEncodings.size(), 0);
608 std::vector<uint8_t> qScores(scores.size(), 0);
609 std::vector<uint8_t> qAnchors(anchors.size(), 0);
610 QuantizeData(qBoxEncodings.data(), boxEncodings.data(), boxEncodingsInfo);
611 QuantizeData(qScores.data(), scores.data(), scoresInfo);
612 QuantizeData(qAnchors.data(), anchors.data(), anchorsInfo);
613 DetectionPostProcessRegularNmsEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends, qBoxEncodings,
615 1.0f, 1, 0.01f, 0, 0.5f, 0);
618 BOOST_AUTO_TEST_CASE(NeonDetectionPostProcessFastNmsTest, * boost::unit_test::disabled())
620 std::vector<float> boxEncodings({
621 0.0f, 0.0f, 0.0f, 0.0f,
622 0.0f, 1.0f, 0.0f, 0.0f,
623 0.0f, -1.0f, 0.0f, 0.0f,
624 0.0f, 0.0f, 0.0f, 0.0f,
625 0.0f, 1.0f, 0.0f, 0.0f,
626 0.0f, 0.0f, 0.0f, 0.0f
628 std::vector<float> scores({
636 std::vector<float> anchors({
637 0.5f, 0.5f, 1.0f, 1.0f,
638 0.5f, 0.5f, 1.0f, 1.0f,
639 0.5f, 0.5f, 1.0f, 1.0f,
640 0.5f, 10.5f, 1.0f, 1.0f,
641 0.5f, 10.5f, 1.0f, 1.0f,
642 0.5f, 100.5f, 1.0f, 1.0f
644 DetectionPostProcessFastNmsEndToEnd<armnn::DataType::Float32>(defaultBackends, boxEncodings, scores, anchors);
647 BOOST_AUTO_TEST_CASE(NeonDetectionPostProcessFastNmsUint8Test, * boost::unit_test::disabled())
649 armnn::TensorInfo boxEncodingsInfo({ 1, 6, 4 }, armnn::DataType::Float32);
650 armnn::TensorInfo scoresInfo({ 1, 6, 3 }, armnn::DataType::Float32);
651 armnn::TensorInfo anchorsInfo({ 6, 4 }, armnn::DataType::Float32);
653 boxEncodingsInfo.SetQuantizationScale(1.0f);
654 boxEncodingsInfo.SetQuantizationOffset(1);
655 scoresInfo.SetQuantizationScale(0.01f);
656 scoresInfo.SetQuantizationOffset(0);
657 anchorsInfo.SetQuantizationScale(0.5f);
658 anchorsInfo.SetQuantizationOffset(0);
660 std::vector<float> boxEncodings({
661 0.0f, 0.0f, 0.0f, 0.0f,
662 0.0f, 1.0f, 0.0f, 0.0f,
663 0.0f, -1.0f, 0.0f, 0.0f,
664 0.0f, 0.0f, 0.0f, 0.0f,
665 0.0f, 1.0f, 0.0f, 0.0f,
666 0.0f, 0.0f, 0.0f, 0.0f
668 std::vector<float> scores({
676 std::vector<float> anchors({
677 0.5f, 0.5f, 1.0f, 1.0f,
678 0.5f, 0.5f, 1.0f, 1.0f,
679 0.5f, 0.5f, 1.0f, 1.0f,
680 0.5f, 10.5f, 1.0f, 1.0f,
681 0.5f, 10.5f, 1.0f, 1.0f,
682 0.5f, 100.5f, 1.0f, 1.0f
685 std::vector<uint8_t> qBoxEncodings(boxEncodings.size(), 0);
686 std::vector<uint8_t> qScores(scores.size(), 0);
687 std::vector<uint8_t> qAnchors(anchors.size(), 0);
688 QuantizeData(qBoxEncodings.data(), boxEncodings.data(), boxEncodingsInfo);
689 QuantizeData(qScores.data(), scores.data(), scoresInfo);
690 QuantizeData(qAnchors.data(), anchors.data(), anchorsInfo);
691 DetectionPostProcessFastNmsEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends, qBoxEncodings,
693 1.0f, 1, 0.01f, 0, 0.5f, 0);
696 BOOST_AUTO_TEST_SUITE_END()