diff options
author | Finn Williams <Finn.Williams@arm.com> | 2020-08-28 13:17:05 +0100 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2020-08-31 16:31:07 +0000 |
commit | ec36d3ee6619f1e777aa82c694ee2ec0433fc770 (patch) | |
tree | a075a265c8ca600193a76f87af93b432fb9dc40f /src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp | |
parent | 33a626f14c8db13967ba2a933388223d5bf733c3 (diff) | |
download | armnn-ec36d3ee6619f1e777aa82c694ee2ec0433fc770.tar.gz |
IVGCVSW-5256 Use CreateTensorHandle() function from TensorHandleFactory in the tests for layers Q,R & T
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I6fc613d31785298a0b7ed18f1abdd59bafed1e8e
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp')
-rw-r--r-- | src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp | 125 |
1 files changed, 80 insertions, 45 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp index f815968a7f..aeed272446 100644 --- a/src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/RankTestImpl.cpp @@ -16,7 +16,8 @@ LayerTestResult<int32_t, 1> RankTest( armnn::TensorInfo inputTensorInfo, boost::multi_array<T, n> input, armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { IgnoreUnused(memoryManager); @@ -26,10 +27,8 @@ LayerTestResult<int32_t, 1> RankTest( LayerTestResult<int32_t , 1> ret(outputTensorInfo); ret.outputExpected = MakeTensor<uint32_t, 1>(outputTensorInfo, { n }); - ARMNN_NO_DEPRECATE_WARN_BEGIN - std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - ARMNN_NO_DEPRECATE_WARN_END + std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo); armnn::RankQueueDescriptor data; armnn::WorkloadInfo info; @@ -53,46 +52,50 @@ LayerTestResult<int32_t, 1> RankTest( template<armnn::DataType ArmnnType, typename T> LayerTestResult<int32_t, 1> RankDimSize1Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo({6}, ArmnnType, 1.0f, 0); auto input = MakeTensor<T, 1>(inputTensorInfo, ConvertToDataType<ArmnnType>( { -37.5f, -15.2f, -8.76f, -2.0f, -1.3f, -0.5f }, inputTensorInfo)); - return RankTest<T, 1>(inputTensorInfo, input, workloadFactory, memoryManager); + return RankTest<T, 1>(inputTensorInfo, input, workloadFactory, memoryManager, tensorHandleFactory); } template<armnn::DataType ArmnnType, typename T> LayerTestResult<int32_t, 1> RankDimSize2Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo({1, 3}, ArmnnType, 1.0f, 0); auto input = MakeTensor<T, 2>(inputTensorInfo, ConvertToDataType<ArmnnType>( { -37.5f, -15.2f, -8.76f }, inputTensorInfo)); - return RankTest<T, 2>(inputTensorInfo, input, workloadFactory, memoryManager); + return RankTest<T, 2>(inputTensorInfo, input, workloadFactory, memoryManager, tensorHandleFactory); } template<armnn::DataType ArmnnType, typename T> LayerTestResult<int32_t, 1> RankDimSize3Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo({1, 3, 2}, ArmnnType, 1.0f, 0); auto input = MakeTensor<T, 3>(inputTensorInfo, ConvertToDataType<ArmnnType>( { -37.5f, -15.2f, -8.76f, -2.0f, -1.5f, -1.3f}, inputTensorInfo)); - return RankTest<T, 3>(inputTensorInfo, input, workloadFactory, memoryManager); + return RankTest<T, 3>(inputTensorInfo, input, workloadFactory, memoryManager, tensorHandleFactory); } template<armnn::DataType ArmnnType, typename T> LayerTestResult<int32_t, 1> RankDimSize4Test( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory) { armnn::TensorInfo inputTensorInfo({1, 3, 2, 3}, ArmnnType, 1.0f, 0); auto input = MakeTensor<T, 4>(inputTensorInfo, ConvertToDataType<ArmnnType>( @@ -100,165 +103,197 @@ LayerTestResult<int32_t, 1> RankDimSize4Test( 1.0f, 0.4f, 0.5f, 1.3f, 1.5f, 2.0f, 8.76f, 15.2f, 37.5f }, inputTensorInfo)); - return RankTest<T, 4>(inputTensorInfo, input, workloadFactory, memoryManager); + return RankTest<T, 4>(inputTensorInfo, input, workloadFactory, memoryManager, tensorHandleFactory); } template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::Float16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::Float32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::QAsymmU8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::Signed32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::QSymmS16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::QSymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::QAsymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize4Test<armnn::DataType::BFloat16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::Float16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::Float32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::QAsymmU8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::Signed32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::QSymmS16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::QSymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::QAsymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize3Test<armnn::DataType::BFloat16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::Float16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::Float32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::QAsymmU8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::Signed32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::QSymmS16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::QSymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::QAsymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize2Test<armnn::DataType::BFloat16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::Float16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::Float32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::QAsymmU8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::Signed32>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::QSymmS16>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::QSymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::QAsymmS8>( armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, + const armnn::ITensorHandleFactory& tensorHandleFactory); template LayerTestResult<int32_t, 1> RankDimSize1Test<armnn::DataType::BFloat16>( 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 |