From 826a543547f325bfac7da507d19a55af9c138a50 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Thu, 27 Aug 2020 16:15:20 +0100 Subject: IVGCVSW-5253 Use CreateTensorHandle() function from TensorHandleFactory in the tests for layers M-P Signed-off-by: Finn Williams Change-Id: I324eee7d750e30f714e0d346b7da7b69866ff935 --- .../test/layerTests/MeanTestImpl.hpp | 45 ++- .../test/layerTests/NormalizationTestImpl.cpp | 50 +-- .../test/layerTests/NormalizationTestImpl.hpp | 11 +- .../backendsCommon/test/layerTests/PadTestImpl.cpp | 111 +++--- .../backendsCommon/test/layerTests/PadTestImpl.hpp | 51 ++- .../test/layerTests/PermuteTestImpl.hpp | 27 +- .../test/layerTests/Pooling2dTestImpl.cpp | 388 ++++++++++++++------- .../test/layerTests/Pooling2dTestImpl.hpp | 154 +++++--- .../test/layerTests/PreluTestImpl.hpp | 6 +- 9 files changed, 544 insertions(+), 299 deletions(-) (limited to 'src/backends/backendsCommon') diff --git a/src/backends/backendsCommon/test/layerTests/MeanTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/MeanTestImpl.hpp index 283bfd9502..ba827b1860 100644 --- a/src/backends/backendsCommon/test/layerTests/MeanTestImpl.hpp +++ b/src/backends/backendsCommon/test/layerTests/MeanTestImpl.hpp @@ -19,6 +19,7 @@ template MeanTestHelper( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const unsigned int* inputShape, const std::vector& inputData, const std::vector& axis, @@ -45,10 +46,8 @@ LayerTestResult MeanTestHelper( result.outputExpected = MakeTensor( outputTensorInfo, ConvertToDataType(outputData, outputTensorInfo)); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::MeanQueueDescriptor data; data.m_Parameters.m_Axis = axis; @@ -77,7 +76,8 @@ LayerTestResult MeanTestHelper( template> LayerTestResult MeanSimpleTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 3, 2 }; const unsigned int outputShape[] = { 1 }; @@ -86,13 +86,14 @@ LayerTestResult MeanSimpleTest( std::vector output({ 2.5f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, {}, false, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, inputShape, input, {}, false, outputShape, output); } template> LayerTestResult MeanSimpleAxisTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 2, 3, 1, 2 }; const unsigned int outputShape[] = { 3, 1, 2 }; @@ -101,13 +102,14 @@ LayerTestResult MeanSimpleAxisTest( std::vector output({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, { 0 }, false, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, inputShape, input, { 0 }, false, outputShape, output); } template> LayerTestResult MeanKeepDimsTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 1, 1, 3, 2 }; const unsigned int outputShape[] = { 1, 1, 1, 2 }; @@ -116,13 +118,14 @@ LayerTestResult MeanKeepDimsTest( std::vector output({ 2.5f, 2.5f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, { 2 }, true, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, inputShape, input, { 2 }, true, outputShape, output); } template> LayerTestResult MeanMultipleDimsTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 2, 3, 1, 2 }; const unsigned int outputShape[] = { 1, 3, 1, 1 }; @@ -131,13 +134,15 @@ LayerTestResult MeanMultipleDimsTest( std::vector output({ 2.0f, 4.0f, 6.0f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, { 0, 3 }, true, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, + inputShape, input, { 0, 3 }, true, outputShape, output); } template> LayerTestResult MeanVts1Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 4, 3, 2 }; const unsigned int outputShape[] = { 2 }; @@ -147,13 +152,15 @@ LayerTestResult MeanVts1Test( std::vector output({ 12.0f, 13.0f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, { 0, 1 }, false, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, + inputShape, input, { 0, 1 }, false, outputShape, output); } template> LayerTestResult MeanVts2Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 4, 3, 2 }; const unsigned int outputShape[] = { 1, 3, 1 }; @@ -163,13 +170,15 @@ LayerTestResult MeanVts2Test( std::vector output({ 10.5f, 12.5f, 14.5f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, { 0, 2 }, true, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, + inputShape, input, { 0, 2 }, true, outputShape, output); } template> LayerTestResult MeanVts3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int inputShape[] = { 1, 2, 2, 1 }; const unsigned int outputShape[] = { 1, 2, 1 }; @@ -178,5 +187,5 @@ LayerTestResult MeanVts3Test( std::vector output({ 1.5f, 3.5f }); return MeanTestHelper( - workloadFactory, memoryManager, inputShape, input, { 2 }, false, outputShape, output); + workloadFactory, memoryManager, tensorHandleFactory, inputShape, input, { 2 }, false, outputShape, output); } diff --git a/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp index ce7ef37d13..b42b180dc9 100644 --- a/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp @@ -21,6 +21,7 @@ namespace LayerTestResult SimpleNormalizationTestImpl( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, armnn::NormalizationAlgorithmChannel normChannel, armnn::NormalizationAlgorithmMethod normMethod) { @@ -57,10 +58,8 @@ LayerTestResult SimpleNormalizationTestImpl( float kappa = 1.f; uint32_t normSize = 3; - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::NormalizationQueueDescriptor data; armnn::WorkloadInfo info; @@ -167,6 +166,7 @@ LayerTestResult SimpleNormalizationTestImpl( LayerTestResult SimpleNormalizationNhwcTestImpl( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, armnn::NormalizationAlgorithmChannel normChannel, armnn::NormalizationAlgorithmMethod normMethod) { @@ -202,10 +202,8 @@ LayerTestResult SimpleNormalizationNhwcTestImpl( float kappa = 1.f; uint32_t normSize = 3; - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::NormalizationQueueDescriptor data; armnn::WorkloadInfo info; @@ -271,6 +269,8 @@ LayerTestResult CompareNormalizationTestImpl( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::NormalizationAlgorithmChannel normChannel, armnn::NormalizationAlgorithmMethod normMethod) { @@ -302,10 +302,8 @@ LayerTestResult CompareNormalizationTestImpl( constexpr float kappa = 1.f; constexpr uint32_t normSize = 5; - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::NormalizationQueueDescriptor data; armnn::WorkloadInfo info; @@ -318,10 +316,8 @@ LayerTestResult CompareNormalizationTestImpl( data.m_Parameters.m_Beta = beta; data.m_Parameters.m_K = kappa; - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr outputHandleRef = refWorkloadFactory.CreateTensorHandle(outputTensorInfo); - std::unique_ptr inputHandleRef = refWorkloadFactory.CreateTensorHandle(inputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr outputHandleRef = refTensorHandleFactory.CreateTensorHandle(outputTensorInfo); + std::unique_ptr inputHandleRef = refTensorHandleFactory.CreateTensorHandle(inputTensorInfo); armnn::NormalizationQueueDescriptor refData = data; armnn::WorkloadInfo refInfo = info; @@ -365,37 +361,45 @@ LayerTestResult CompareNormalizationTestImpl( LayerTestResult SimpleNormalizationAcrossTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { auto normMethod = armnn::NormalizationAlgorithmMethod::LocalBrightness; auto normChannel = armnn::NormalizationAlgorithmChannel::Across; - return SimpleNormalizationTestImpl(workloadFactory, memoryManager, normChannel, normMethod); + return SimpleNormalizationTestImpl(workloadFactory, memoryManager, tensorHandleFactory, normChannel, normMethod); } LayerTestResult SimpleNormalizationWithinTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { auto normMethod = armnn::NormalizationAlgorithmMethod::LocalBrightness; auto normChannel = armnn::NormalizationAlgorithmChannel::Within; - return SimpleNormalizationTestImpl(workloadFactory, memoryManager, normChannel, normMethod); + return SimpleNormalizationTestImpl(workloadFactory, memoryManager, tensorHandleFactory, normChannel, normMethod); } LayerTestResult SimpleNormalizationAcrossNhwcTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { auto normMethod = armnn::NormalizationAlgorithmMethod::LocalBrightness; auto normChannel = armnn::NormalizationAlgorithmChannel::Across; - return SimpleNormalizationNhwcTestImpl(workloadFactory, memoryManager, normChannel, normMethod); + return SimpleNormalizationNhwcTestImpl( + workloadFactory, memoryManager, tensorHandleFactory, normChannel, normMethod); } LayerTestResult CompareNormalizationTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::NormalizationAlgorithmChannel normChannel, armnn::NormalizationAlgorithmMethod normMethod) { - return CompareNormalizationTestImpl(workloadFactory, memoryManager, refWorkloadFactory, normChannel, normMethod); + return CompareNormalizationTestImpl( + workloadFactory, memoryManager, refWorkloadFactory, tensorHandleFactory, refTensorHandleFactory, + normChannel, normMethod); } diff --git a/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.hpp index 4da1ad2606..3a276e8c4c 100644 --- a/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.hpp +++ b/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.hpp @@ -14,19 +14,24 @@ LayerTestResult SimpleNormalizationAcrossTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult SimpleNormalizationWithinTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult SimpleNormalizationAcrossNhwcTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult CompareNormalizationTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::NormalizationAlgorithmChannel normChannel, armnn::NormalizationAlgorithmMethod normMethod); diff --git a/src/backends/backendsCommon/test/layerTests/PadTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/PadTestImpl.cpp index 35e6103f7f..5511f86e17 100644 --- a/src/backends/backendsCommon/test/layerTests/PadTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/PadTestImpl.cpp @@ -20,6 +20,7 @@ template LayerTestResult Pad2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset, const float customPaddingValue) @@ -58,10 +59,9 @@ LayerTestResult Pad2dTestCommon( LayerTestResult result(outputTensorInfo); result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); + armnn::PadQueueDescriptor descriptor; @@ -95,6 +95,7 @@ template LayerTestResult Pad3dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset) { @@ -144,10 +145,9 @@ LayerTestResult Pad3dTestCommon( LayerTestResult result(outputTensorInfo); result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); + armnn::PadQueueDescriptor descriptor; @@ -181,6 +181,7 @@ template LayerTestResult Pad4dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset) { @@ -384,10 +385,8 @@ LayerTestResult Pad4dTestCommon( LayerTestResult result(outputTensorInfo); result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::PadQueueDescriptor descriptor; @@ -426,6 +425,7 @@ template LayerTestResult, 2> Pad2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset, const float customPaddingValue); @@ -434,6 +434,7 @@ template LayerTestResult, 3> Pad3dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset); @@ -441,6 +442,7 @@ template LayerTestResult, 4> Pad4dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset); @@ -450,112 +452,133 @@ Pad4dTestCommon( LayerTestResult PadUint82dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0); } LayerTestResult PadUint82dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0, 1.0f); + return Pad2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0, 1.0f); } LayerTestResult PadUint83dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad3dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad3dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0); } LayerTestResult PadUint84dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad4dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad4dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0); } LayerTestResult PadFloat322dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0); } LayerTestResult PadFloat322dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0, 1.0f); + return Pad2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0, 1.0f); } LayerTestResult PadFloat323dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad3dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad3dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0); } LayerTestResult PadFloat324dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad4dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad4dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0); } LayerTestResult PadBFloat162dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0); } LayerTestResult PadBFloat162dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0, 1.0f); + return Pad2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0, 1.0f); } LayerTestResult PadBFloat163dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad3dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad3dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0); } LayerTestResult PadBFloat164dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad4dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad4dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 0.0f, 0); } LayerTestResult PadInt82dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0); } LayerTestResult PadInt82dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0, 1.0f); + return Pad2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0, 1.0f); } LayerTestResult PadInt83dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad3dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad3dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0); } LayerTestResult PadInt84dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return Pad4dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad4dTestCommon(workloadFactory, memoryManager, tensorHandleFactory, 1.0f, 0); } diff --git a/src/backends/backendsCommon/test/layerTests/PadTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/PadTestImpl.hpp index 7b36455063..8d603862b7 100644 --- a/src/backends/backendsCommon/test/layerTests/PadTestImpl.hpp +++ b/src/backends/backendsCommon/test/layerTests/PadTestImpl.hpp @@ -18,6 +18,7 @@ template> LayerTestResult Pad2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset, const float customPaddingValue = 0.0f); @@ -26,6 +27,7 @@ template> LayerTestResult Pad3dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset); @@ -33,69 +35,86 @@ template> LayerTestResult Pad4dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale, int32_t qOffset); LayerTestResult PadUint82dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadUint82dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadUint83dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadUint84dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadFloat322dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadFloat322dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadFloat323dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadFloat324dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadBFloat162dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadBFloat162dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadBFloat163dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadBFloat164dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadInt82dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadInt82dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadInt83dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult PadInt84dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); \ No newline at end of file + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); \ No newline at end of file diff --git a/src/backends/backendsCommon/test/layerTests/PermuteTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/PermuteTestImpl.hpp index 0d66af93e6..74d29f0250 100644 --- a/src/backends/backendsCommon/test/layerTests/PermuteTestImpl.hpp +++ b/src/backends/backendsCommon/test/layerTests/PermuteTestImpl.hpp @@ -19,6 +19,7 @@ template LayerTestResult SimplePermuteTestImpl( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, armnn::PermuteDescriptor descriptor, armnn::TensorInfo inputTensorInfo, armnn::TensorInfo outputTensorInfo, @@ -31,10 +32,8 @@ LayerTestResult SimplePermuteTestImpl( LayerTestResult ret(outputTensorInfo); ret.outputExpected = MakeTensor(outputTensorInfo, outputExpectedData); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::PermuteQueueDescriptor data; data.m_Parameters = descriptor; @@ -59,7 +58,8 @@ LayerTestResult SimplePermuteTestImpl( template> LayerTestResult SimplePermuteTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo; armnn::TensorInfo outputTensorInfo; @@ -100,7 +100,7 @@ LayerTestResult SimplePermuteTest( }, qScale, qOffset); - return SimplePermuteTestImpl(workloadFactory, memoryManager, + return SimplePermuteTestImpl(workloadFactory, memoryManager, tensorHandleFactory, descriptor, inputTensorInfo, outputTensorInfo, input, outputExpected); } @@ -108,7 +108,8 @@ LayerTestResult SimplePermuteTest( template> LayerTestResult PermuteValueSet1Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo; armnn::TensorInfo outputTensorInfo; @@ -150,7 +151,7 @@ LayerTestResult PermuteValueSet1Test( }, qScale, qOffset); - return SimplePermuteTestImpl(workloadFactory, memoryManager, + return SimplePermuteTestImpl(workloadFactory, memoryManager, tensorHandleFactory, descriptor, inputTensorInfo, outputTensorInfo, input, outputExpected); } @@ -158,7 +159,8 @@ LayerTestResult PermuteValueSet1Test( template> LayerTestResult PermuteValueSet2Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo; armnn::TensorInfo outputTensorInfo; @@ -200,7 +202,7 @@ LayerTestResult PermuteValueSet2Test( }, qScale, qOffset); - return SimplePermuteTestImpl(workloadFactory, memoryManager, + return SimplePermuteTestImpl(workloadFactory, memoryManager, tensorHandleFactory, descriptor, inputTensorInfo, outputTensorInfo, input, outputExpected); } @@ -208,7 +210,8 @@ LayerTestResult PermuteValueSet2Test( template> LayerTestResult PermuteValueSet3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo; armnn::TensorInfo outputTensorInfo; @@ -252,7 +255,7 @@ LayerTestResult PermuteValueSet3Test( }, qScale, qOffset); - return SimplePermuteTestImpl(workloadFactory, memoryManager, + return SimplePermuteTestImpl(workloadFactory, memoryManager, tensorHandleFactory, descriptor, inputTensorInfo, outputTensorInfo, input, outputExpected); } diff --git a/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.cpp index 078e74403e..a4f87ff3ed 100644 --- a/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.cpp @@ -34,6 +34,7 @@ template> LayerTestResult SimplePooling2dTestImpl( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, armnn::Pooling2dDescriptor descriptor, float qScale, int32_t qOffset, @@ -74,10 +75,8 @@ LayerTestResult SimplePooling2dTestImpl( LayerTestResult result(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::Pooling2dQueueDescriptor queueDescriptor; queueDescriptor.m_Parameters = descriptor; @@ -128,6 +127,7 @@ template> LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding, float qScale = 1.0f, int32_t qOffset = 0) @@ -246,13 +246,14 @@ LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4TestCommon( } return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult SimpleMaxPooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout = armnn::DataLayout::NCHW, float qScale = 1.0f, int32_t qOffset = 0) @@ -317,13 +318,14 @@ LayerTestResult SimpleMaxPooling2dTestCommon( auto outputExpected = MakeTensor(outputTensorInfo, outputData); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult SimpleAveragePooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, armnn::DataLayout dataLayout = armnn::DataLayout::NCHW, float qScale = 1.0f, int32_t qOffset = 0) @@ -388,13 +390,14 @@ LayerTestResult SimpleAveragePooling2dTestCommon( auto outputExpected = MakeTensor(outputTensorInfo, outputData); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult LargeTensorsAveragePooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -439,13 +442,14 @@ LayerTestResult LargeTensorsAveragePooling2dTestCommon( auto outputExpected = MakeTensor(outputTensorInfo, outputVec); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult SimpleL2Pooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, armnn::DataLayout dataLayout = armnn::DataLayout::NCHW, float qScale = 1.0f, int32_t qOffset = 0) @@ -501,13 +505,14 @@ LayerTestResult SimpleL2Pooling2dTestCommon( auto outputExpected = MakeTensor(outputTensorInfo, outputData); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult L2Pooling2dSize3Stride1TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -536,13 +541,14 @@ LayerTestResult L2Pooling2dSize3Stride1TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult L2Pooling2dSize3Stride3TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -577,13 +583,14 @@ LayerTestResult L2Pooling2dSize3Stride3TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult L2Pooling2dSize3Stride4TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -615,13 +622,14 @@ LayerTestResult L2Pooling2dSize3Stride4TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult L2Pooling2dSize7TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -652,13 +660,14 @@ LayerTestResult L2Pooling2dSize7TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult L2Pooling2dSize9TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -691,13 +700,14 @@ LayerTestResult L2Pooling2dSize9TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult AsymmetricNonSquarePooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -732,7 +742,7 @@ LayerTestResult AsymmetricNonSquarePooling2dTestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> @@ -740,6 +750,8 @@ LayerTestResult ComparePooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType, float qScale = 1.0f, int32_t qOffset = 0) @@ -781,10 +793,8 @@ LayerTestResult ComparePooling2dTestCommon( LayerTestResult comparisonResult(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::Pooling2dQueueDescriptor data; armnn::WorkloadInfo info; @@ -801,10 +811,8 @@ LayerTestResult ComparePooling2dTestCommon( data.m_Parameters.m_PadBottom = padY; data.m_Parameters.m_OutputShapeRounding = armnn::OutputShapeRounding::Floor; - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr outputHandleRef = refWorkloadFactory.CreateTensorHandle(outputTensorInfo); - std::unique_ptr inputHandleRef = refWorkloadFactory.CreateTensorHandle(inputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr outputHandleRef = refTensorHandleFactory.CreateTensorHandle(outputTensorInfo); + std::unique_ptr inputHandleRef = refTensorHandleFactory.CreateTensorHandle(inputTensorInfo); // Don't execute if Pooling is not supported, as an exception will be raised. armnn::BackendId backend = workloadFactory.GetBackendId(); @@ -856,6 +864,7 @@ template> LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding, float qScale = 1.0f, int32_t qOffset = 0) @@ -923,7 +932,7 @@ LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2TestCommon( QuantizedVector(expectedOutputDataWithPadding, qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } // @@ -939,6 +948,7 @@ template> LayerTestResult IgnorePaddingAveragePooling2dSize3x2Stride2x2TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding, float qScale = 1.0f, int32_t qOffset = 0) @@ -1001,7 +1011,7 @@ LayerTestResult IgnorePaddingAveragePooling2dSize3x2Stride2x2TestCommon( QuantizedVector(expectedOutputDataWithPadding, qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } @@ -1009,6 +1019,7 @@ template> LayerTestResult IgnorePaddingSimpleMaxPooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1052,13 +1063,14 @@ LayerTestResult IgnorePaddingSimpleMaxPooling2dTestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult IgnorePaddingMaxPooling2dSize3TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1103,13 +1115,14 @@ LayerTestResult IgnorePaddingMaxPooling2dSize3TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult IgnorePaddingSimpleAveragePooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1153,13 +1166,14 @@ LayerTestResult IgnorePaddingSimpleAveragePooling2dTestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1203,13 +1217,14 @@ LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingTestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult IgnorePaddingAveragePooling2dSize3TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1254,13 +1269,14 @@ LayerTestResult IgnorePaddingAveragePooling2dSize3TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult IgnorePaddingSimpleL2Pooling2dTestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1304,13 +1320,14 @@ LayerTestResult IgnorePaddingSimpleL2Pooling2dTestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } template> LayerTestResult IgnorePaddingL2Pooling2dSize3TestCommon( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, float qScale = 1.0f, int32_t qOffset = 0) { @@ -1355,7 +1372,7 @@ LayerTestResult IgnorePaddingL2Pooling2dSize3TestCommon( qScale, qOffset)); return SimplePooling2dTestImpl( - workloadFactory, memoryManager, descriptor, qScale, qOffset, input, outputExpected); + workloadFactory, memoryManager, tensorHandleFactory, descriptor, qScale, qOffset, input, outputExpected); } } // anonymous namespace @@ -1363,469 +1380,570 @@ LayerTestResult IgnorePaddingL2Pooling2dSize3TestCommon( LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return SimpleMaxPooling2dSize2x2Stride2x2TestCommon( - workloadFactory, memoryManager, forceNoPadding); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding); } LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2Uint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return SimpleMaxPooling2dSize2x2Stride2x2TestCommon( - workloadFactory, memoryManager, forceNoPadding, 3.0f, -5); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding, 3.0f, -5); } LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2Int16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return SimpleMaxPooling2dSize2x2Stride2x2TestCommon( - workloadFactory, memoryManager, forceNoPadding); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding); } LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return SimpleMaxPooling2dSize3x3Stride2x4TestCommon( - workloadFactory, memoryManager, forceNoPadding); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding); } LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4Uint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return SimpleMaxPooling2dSize3x3Stride2x4TestCommon( - workloadFactory, memoryManager, forceNoPadding, 0.1f, 128); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding, 0.1f, 128); } LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4Int16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return SimpleMaxPooling2dSize3x3Stride2x4TestCommon( - workloadFactory, memoryManager, forceNoPadding); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding); } LayerTestResult SimpleMaxPooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleMaxPooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleMaxPooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult SimpleMaxPooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleMaxPooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleMaxPooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult SimpleMaxPooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleMaxPooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleMaxPooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult IgnorePaddingSimpleMaxPooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingSimpleMaxPooling2dTestCommon(workloadFactory, memoryManager); + return IgnorePaddingSimpleMaxPooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleMaxPooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleMaxPooling2dTestCommon( - workloadFactory, memoryManager, 1.0f, -5); + workloadFactory, memoryManager, tensorHandleFactory, 1.0f, -5); } LayerTestResult IgnorePaddingSimpleMaxPooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleMaxPooling2dTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingMaxPooling2dSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingMaxPooling2dSize3TestCommon(workloadFactory, memoryManager); + return IgnorePaddingMaxPooling2dSize3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingMaxPooling2dSize3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingMaxPooling2dSize3TestCommon( - workloadFactory, memoryManager, 1.0f, -5); + workloadFactory, memoryManager, tensorHandleFactory, 1.0f, -5); } LayerTestResult IgnorePaddingMaxPooling2dSize3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingMaxPooling2dSize3TestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult SimpleAveragePooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleAveragePooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleAveragePooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult SimpleAveragePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { return SimpleAveragePooling2dTestCommon( - workloadFactory, memoryManager, dataLayout, 0.5, -1); + workloadFactory, memoryManager, tensorHandleFactory, dataLayout, 0.5, -1); } LayerTestResult SimpleAveragePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { return SimpleAveragePooling2dTestCommon( - workloadFactory, memoryManager, dataLayout); + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult IgnorePaddingAveragePooling2dSize3x2Stride2x2Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding) { return IgnorePaddingAveragePooling2dSize3x2Stride2x2TestCommon( - workloadFactory, memoryManager, forceNoPadding); + workloadFactory, memoryManager, tensorHandleFactory, forceNoPadding); } LayerTestResult LargeTensorsAveragePooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return LargeTensorsAveragePooling2dTestCommon(workloadFactory, memoryManager); + return LargeTensorsAveragePooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult LargeTensorsAveragePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return LargeTensorsAveragePooling2dTestCommon( - workloadFactory, memoryManager, 0.5, -1); + workloadFactory, memoryManager, tensorHandleFactory, 0.5, -1); } LayerTestResult LargeTensorsAveragePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return LargeTensorsAveragePooling2dTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleAveragePooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingSimpleAveragePooling2dTestCommon(workloadFactory, memoryManager); + return IgnorePaddingSimpleAveragePooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleAveragePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleAveragePooling2dTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleAveragePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleAveragePooling2dTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleAveragePooling2dNoPaddingTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleAveragePooling2dNoPaddingTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingSimpleAveragePooling2dNoPaddingTestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingAveragePooling2dSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingAveragePooling2dSize3TestCommon(workloadFactory, memoryManager); + return IgnorePaddingAveragePooling2dSize3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingAveragePooling2dSize3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingAveragePooling2dSize3TestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingAveragePooling2dSize3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { return IgnorePaddingAveragePooling2dSize3TestCommon( - workloadFactory, memoryManager); + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult SimpleL2Pooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleL2Pooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleL2Pooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult SimpleL2Pooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleL2Pooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleL2Pooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult SimpleL2Pooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout) { - return SimpleL2Pooling2dTestCommon(workloadFactory, memoryManager, dataLayout); + return SimpleL2Pooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory, dataLayout); } LayerTestResult L2Pooling2dSize3Stride1Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride1TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride1TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride1Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride1TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride1TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride1Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride1TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride1TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride3TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride3TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride3TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride4Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride4TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride4TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride4Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride4TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride4TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize3Stride4Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize3Stride4TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize3Stride4TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize7Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize7TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize7TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize7Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize7TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize7TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize7Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize7TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize7TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize9Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize9TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize9TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize9Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize9TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize9TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult L2Pooling2dSize9Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return L2Pooling2dSize9TestCommon(workloadFactory, memoryManager); + return L2Pooling2dSize9TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleL2Pooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingSimpleL2Pooling2dTestCommon(workloadFactory, memoryManager); + return IgnorePaddingSimpleL2Pooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleL2Pooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingSimpleL2Pooling2dTestCommon(workloadFactory, memoryManager); + return IgnorePaddingSimpleL2Pooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingSimpleL2Pooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingSimpleL2Pooling2dTestCommon(workloadFactory, memoryManager); + return IgnorePaddingSimpleL2Pooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingL2Pooling2dSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingL2Pooling2dSize3TestCommon(workloadFactory, memoryManager); + return IgnorePaddingL2Pooling2dSize3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingL2Pooling2dSize3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingL2Pooling2dSize3TestCommon(workloadFactory, memoryManager); + return IgnorePaddingL2Pooling2dSize3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult IgnorePaddingL2Pooling2dSize3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return IgnorePaddingL2Pooling2dSize3TestCommon(workloadFactory, memoryManager); + return IgnorePaddingL2Pooling2dSize3TestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult AsymmetricNonSquarePooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return AsymmetricNonSquarePooling2dTestCommon(workloadFactory, memoryManager); + return AsymmetricNonSquarePooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult AsymmetricNonSquarePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return AsymmetricNonSquarePooling2dTestCommon(workloadFactory, memoryManager); + return AsymmetricNonSquarePooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult AsymmetricNonSquarePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { - return AsymmetricNonSquarePooling2dTestCommon(workloadFactory, memoryManager); + return AsymmetricNonSquarePooling2dTestCommon( + workloadFactory, memoryManager, tensorHandleFactory); } LayerTestResult ComparePooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType) { return ComparePooling2dTestCommon( - workloadFactory, memoryManager, refWorkloadFactory, poolingType); + workloadFactory, memoryManager, refWorkloadFactory, tensorHandleFactory, refTensorHandleFactory, poolingType); } LayerTestResult ComparePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType) { return ComparePooling2dTestCommon( - workloadFactory, memoryManager, refWorkloadFactory, poolingType, 0.1f, 128); + workloadFactory, memoryManager, refWorkloadFactory, tensorHandleFactory, refTensorHandleFactory, + poolingType, 0.1f, 128); } LayerTestResult ComparePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType) { return ComparePooling2dTestCommon( - workloadFactory, memoryManager, refWorkloadFactory, poolingType); + workloadFactory, memoryManager, refWorkloadFactory, tensorHandleFactory, refTensorHandleFactory, poolingType); } diff --git a/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.hpp index 2f0cde219a..bf2c39e9a3 100644 --- a/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.hpp +++ b/src/backends/backendsCommon/test/layerTests/Pooling2dTestImpl.hpp @@ -15,265 +15,329 @@ LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding); LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2Uint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding); LayerTestResult SimpleMaxPooling2dSize2x2Stride2x2Int16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding); LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, bool forceNoPadding); LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4Uint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, - bool forceNoPadding ); + const armnn::ITensorHandleFactory& tensorHandleFactory, + bool forceNoPadding); LayerTestResult SimpleMaxPooling2dSize3x3Stride2x4Int16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, - bool forceNoPadding ); + const armnn::ITensorHandleFactory& tensorHandleFactory, + bool forceNoPadding); LayerTestResult SimpleMaxPooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult SimpleMaxPooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult SimpleMaxPooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult IgnorePaddingSimpleMaxPooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleMaxPooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleMaxPooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingMaxPooling2dSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingMaxPooling2dSize3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingMaxPooling2dSize3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult SimpleAveragePooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult SimpleAveragePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult SimpleAveragePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult LargeTensorsAveragePooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult LargeTensorsAveragePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult LargeTensorsAveragePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingAveragePooling2dSize3x2Stride2x2Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, - bool forceNoPadding); + const armnn::ITensorHandleFactory& tensorHandleFactory, + bool forceNoPadding ); LayerTestResult IgnorePaddingSimpleAveragePooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleAveragePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleAveragePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleAveragePooling2dNoPaddingInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingAveragePooling2dSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingAveragePooling2dSize3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingAveragePooling2dSize3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult SimpleL2Pooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult SimpleL2Pooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult SimpleL2Pooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory, const armnn::DataLayout dataLayout); LayerTestResult L2Pooling2dSize3Stride1Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride1Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride1Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride4Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride4Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize3Stride4Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize7Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize7Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize7Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize9Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize9Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult L2Pooling2dSize9Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleL2Pooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleL2Pooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingSimpleL2Pooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingL2Pooling2dSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingL2Pooling2dSize3Uint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult IgnorePaddingL2Pooling2dSize3Int16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult AsymmetricNonSquarePooling2dTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult AsymmetricNonSquarePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult AsymmetricNonSquarePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); LayerTestResult ComparePooling2dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType); LayerTestResult ComparePooling2dUint8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType); LayerTestResult ComparePooling2dInt16Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory, armnn::PoolingAlgorithm poolingType); diff --git a/src/backends/backendsCommon/test/layerTests/PreluTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/PreluTestImpl.hpp index de0b27b6c1..a5c53d0e58 100644 --- a/src/backends/backendsCommon/test/layerTests/PreluTestImpl.hpp +++ b/src/backends/backendsCommon/test/layerTests/PreluTestImpl.hpp @@ -20,10 +20,11 @@ #include -template> +template> LayerTestResult PreluTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { IgnoreUnused(memoryManager); @@ -77,7 +78,6 @@ LayerTestResult PreluTest( outputTensorInfo.GetQuantizationScale(), outputTensorInfo.GetQuantizationOffset())); - auto tensorHandleFactory = WorkloadFactoryHelper::GetTensorHandleFactory(memoryManager); std::unique_ptr inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); std::unique_ptr alphaHandle = tensorHandleFactory.CreateTensorHandle(alphaTensorInfo); std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); -- cgit v1.2.1