From 33a626f14c8db13967ba2a933388223d5bf733c3 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Thu, 27 Aug 2020 15:38:12 +0100 Subject: IVGCVSW-5231 Remove CreateTensorHandle in the test where there is NO_DEPRECATE_WARN * Done for all elementwise layers, Activation, BatchNorm, BatchToSpace Signed-off-by: Keith Davis Change-Id: Id1d15a0960233026aecf7a07e0d3f006e07e4abf --- .../test/layerTests/MultiplicationTestImpl.cpp | 95 ++++++++++++++-------- 1 file changed, 61 insertions(+), 34 deletions(-) (limited to 'src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp') diff --git a/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp index 595fbd4556..b8dc5f5667 100644 --- a/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp @@ -6,6 +6,7 @@ #include "MultiplicationTestImpl.hpp" #include "ElementwiseTestImpl.hpp" +#include template<> std::unique_ptr CreateWorkload( @@ -17,7 +18,8 @@ std::unique_ptr CreateWorkload MultiplicationTest(armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int width = 2u; const unsigned int height = 2u; @@ -52,11 +54,13 @@ LayerTestResult MultiplicationTest(armnn::IWorkloadFactory& workloadFa shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult Multiplication5dTest(armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int width = 3u; const unsigned int height = 2u; @@ -122,12 +126,14 @@ LayerTestResult Multiplication5dTest(armnn::IWorkloadFactory& workload shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1ElementTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { unsigned int shape0[] = { 1, 2, 2, 2 }; unsigned int shape1[] = { 1, 1, 1, 1 }; @@ -146,12 +152,14 @@ LayerTestResult MultiplicationBroadcast1ElementTest( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1DVectorTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { unsigned int shape0[] = { 1, 3, 3, 2 }; unsigned int shape1[] = { 1, 1, 1, 2 }; @@ -180,12 +188,14 @@ LayerTestResult MultiplicationBroadcast1DVectorTest( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { constexpr unsigned int batchSize = 1u; constexpr unsigned int channels = 2u; @@ -229,13 +239,15 @@ LayerTestResult MultiplicationUint8Test( -2, shape, output, + tensorHandleFactory, 1366.255f, -5); } LayerTestResult MultiplicationBroadcast1ElementUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape0[] = { 1, 2, 2, 3 }; const unsigned int shape1[] = { 1, 1, 1, 1 }; @@ -262,12 +274,14 @@ LayerTestResult MultiplicationBroadcast1ElementUint8Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1DVectorUint8Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape0[] = { 1, 2, 2, 3 }; const unsigned int shape1[] = { 1, 1, 1, 3 }; @@ -294,12 +308,14 @@ LayerTestResult MultiplicationBroadcast1DVectorUint8Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape[] = { 1, 2, 2, 3 }; @@ -329,12 +345,14 @@ LayerTestResult MultiplicationInt16Test( shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1ElementInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape0[] = { 1, 2, 2, 3 }; const unsigned int shape1[] = { 1, 1, 1, 1 }; @@ -361,12 +379,14 @@ LayerTestResult MultiplicationBroadcast1ElementInt16Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1DVectorInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape0[] = { 1, 2, 2, 3 }; const unsigned int shape1[] = { 1, 1, 1, 3 }; @@ -393,12 +413,14 @@ LayerTestResult MultiplicationBroadcast1DVectorInt16Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationInt32Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape[] = { 1, 2, 2, 3 }; @@ -428,12 +450,14 @@ LayerTestResult MultiplicationInt32Test( shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1ElementInt32Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape0[] = { 1, 2, 2, 3 }; const unsigned int shape1[] = { 1, 1, 1, 1 }; @@ -460,12 +484,14 @@ LayerTestResult MultiplicationBroadcast1ElementInt32Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult MultiplicationBroadcast1DVectorInt32Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { const unsigned int shape0[] = { 1, 2, 2, 3 }; const unsigned int shape1[] = { 1, 1, 1, 3 }; @@ -492,13 +518,16 @@ LayerTestResult MultiplicationBroadcast1DVectorInt32Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult CompareMultiplicationTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, - armnn::IWorkloadFactory& refWorkloadFactory) + armnn::IWorkloadFactory& refWorkloadFactory, + const armnn::ITensorHandleFactory& tensorHandleFactory, + const armnn::ITensorHandleFactory& refTensorHandleFactory) { IgnoreUnused(memoryManager); const unsigned int width = 16; @@ -521,15 +550,13 @@ LayerTestResult CompareMultiplicationTest( auto input0 = MakeRandomTensor(inputTensorInfo0, 803506992); auto input1 = MakeRandomTensor(inputTensorInfo1, 54902257); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr inputHandle0 = workloadFactory.CreateTensorHandle(inputTensorInfo0); - std::unique_ptr inputHandle1 = workloadFactory.CreateTensorHandle(inputTensorInfo1); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); + std::unique_ptr inputHandle0 = tensorHandleFactory.CreateTensorHandle(inputTensorInfo0); + std::unique_ptr inputHandle1 = tensorHandleFactory.CreateTensorHandle(inputTensorInfo1); + std::unique_ptr outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); - std::unique_ptr inputHandle0Ref = refWorkloadFactory.CreateTensorHandle(inputTensorInfo0); - std::unique_ptr inputHandle1Ref = refWorkloadFactory.CreateTensorHandle(inputTensorInfo1); - std::unique_ptr outputHandleRef = refWorkloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr inputHandle0Ref = refTensorHandleFactory.CreateTensorHandle(inputTensorInfo0); + std::unique_ptr inputHandle1Ref = refTensorHandleFactory.CreateTensorHandle(inputTensorInfo1); + std::unique_ptr outputHandleRef = refTensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::MultiplicationQueueDescriptor data; armnn::WorkloadInfo info; -- cgit v1.2.1