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/DivisionTestImpl.cpp | 90 +++++++++++++++------- 1 file changed, 61 insertions(+), 29 deletions(-) (limited to 'src/backends/backendsCommon/test/layerTests/DivisionTestImpl.cpp') diff --git a/src/backends/backendsCommon/test/layerTests/DivisionTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/DivisionTestImpl.cpp index c52c5ce9f2..f3688347d2 100644 --- a/src/backends/backendsCommon/test/layerTests/DivisionTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/DivisionTestImpl.cpp @@ -18,7 +18,8 @@ std::unique_ptr CreateWorkload LayerTestResult DivisionByZeroTest( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { IgnoreUnused(memoryManager); const unsigned int width = 2u; @@ -54,12 +55,14 @@ LayerTestResult DivisionByZeroTest( shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionTest( 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; @@ -94,12 +97,14 @@ LayerTestResult DivisionTest( shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1ElementTest( 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 }; @@ -118,12 +123,14 @@ LayerTestResult DivisionBroadcast1ElementTest( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1DVectorTest( 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 }; @@ -152,12 +159,14 @@ LayerTestResult DivisionBroadcast1DVectorTest( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionFloat16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { using namespace half_float::literal; @@ -194,12 +203,14 @@ LayerTestResult DivisionFloat16Test( shape, input1, shape, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1ElementFloat16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { using namespace half_float::literal; @@ -220,12 +231,14 @@ LayerTestResult DivisionBroadcast1ElementFloat16Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1DVectorFloat16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { using namespace half_float::literal; @@ -256,12 +269,14 @@ LayerTestResult DivisionBroadcast1DVectorFloat16Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionUint8Test( 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; @@ -297,13 +312,15 @@ LayerTestResult DivisionUint8Test( input1, shape, output, + tensorHandleFactory, 0.25f, 0); } LayerTestResult DivisionBroadcast1ElementUint8Test( 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 }; @@ -322,12 +339,14 @@ LayerTestResult DivisionBroadcast1ElementUint8Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1DVectorUint8Test( 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 }; @@ -356,12 +375,14 @@ LayerTestResult DivisionBroadcast1DVectorUint8Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionInt16Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { unsigned int shape[] = { 2, 2, 2, 2 }; @@ -392,13 +413,15 @@ LayerTestResult DivisionInt16Test( input1, shape, output, + tensorHandleFactory, 0.25f, 0); } LayerTestResult DivisionBroadcast1ElementInt16Test( 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 }; @@ -417,12 +440,14 @@ LayerTestResult DivisionBroadcast1ElementInt16Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1DVectorInt16Test( 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 }; @@ -451,12 +476,14 @@ LayerTestResult DivisionBroadcast1DVectorInt16Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionInt32Test( 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; @@ -493,13 +520,15 @@ LayerTestResult DivisionInt32Test( input1, shape, output, + tensorHandleFactory, 1.f, 0); } LayerTestResult DivisionBroadcast1ElementInt32Test( 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 }; @@ -518,12 +547,14 @@ LayerTestResult DivisionBroadcast1ElementInt32Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } LayerTestResult DivisionBroadcast1DVectorInt32Test( 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 }; @@ -552,5 +583,6 @@ LayerTestResult DivisionBroadcast1DVectorInt32Test( shape1, input1, shape0, - output); + output, + tensorHandleFactory); } \ No newline at end of file -- cgit v1.2.1