diff options
author | David Monahan <david.monahan@arm.com> | 2023-01-12 14:53:34 +0000 |
---|---|---|
committer | David Monahan <david.monahan@arm.com> | 2023-01-13 11:28:52 +0000 |
commit | d7fca093be53b314e100e15a8fa080cb506b60a3 (patch) | |
tree | faf4adbdd3154ffa6101bcbbf8c4839179ad180b /src/backends/reference/test | |
parent | c17a35f4b016c223add511a148ed3bb741770593 (diff) | |
download | armnn-d7fca093be53b314e100e15a8fa080cb506b60a3.tar.gz |
IVGCVSW-7173 Add Rsqrt to Tosa Ref Backend
* Added ElementwiseUnary support with a mapping for Rsqrt
* Added unittests
* Added Rsqrt EndtoEnd tests for all backends
* Changed TosaRefLayerSupport to default to false on unsupported layers
Signed-off-by: David Monahan <david.monahan@arm.com>
Change-Id: I3eaa9c684647ead61520a563815581aa68bee51b
Diffstat (limited to 'src/backends/reference/test')
-rw-r--r-- | src/backends/reference/test/RefEndToEndTests.cpp | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/backends/reference/test/RefEndToEndTests.cpp b/src/backends/reference/test/RefEndToEndTests.cpp index 8fcb3d19bc..6ff57716d0 100644 --- a/src/backends/reference/test/RefEndToEndTests.cpp +++ b/src/backends/reference/test/RefEndToEndTests.cpp @@ -43,46 +43,43 @@ TEST_SUITE("RefEndToEnd") { std::vector<armnn::BackendId> defaultBackends = {armnn::Compute::CpuRef}; +// ElementwiseUnary // Abs TEST_CASE("RefAbsEndToEndTestFloat32") { - std::vector<float> expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; - ElementwiseUnarySimpleEndToEnd<armnn::DataType::Float32>(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); } TEST_CASE("RefAbsEndToEndTestUint8") { - // Note the expected output will be implicitly quantized by the below test function - std::vector<float> expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; - ElementwiseUnarySimpleEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); } TEST_CASE("RefAbsEndToEndTestInt16") { - // Note the expected output will be implicitly quantized by the below test function - std::vector<float> expectedOutput = - { - 1.f, 1.f, 1.f, 1.f, 5.f, 5.f, 5.f, 5.f, - 3.f, 3.f, 3.f, 3.f, 4.f, 4.f, 4.f, 4.f - }; + ElementwiseUnarySimpleEndToEnd<armnn::DataType::QSymmS16>(defaultBackends, + UnaryOperation::Abs); +} +// Rsqrt +TEST_CASE("RefRsqrtEndToEndTestFloat32") +{ + ElementwiseUnarySimpleEndToEnd<armnn::DataType::Float32>(defaultBackends, + UnaryOperation::Rsqrt); +} + +TEST_CASE("RefRsqrtEndToEndTestUint8") +{ + ElementwiseUnarySimpleEndToEnd<armnn::DataType::QAsymmU8>(defaultBackends, + UnaryOperation::Rsqrt); +} + +TEST_CASE("RefRsqrtEndToEndTestInt16") +{ ElementwiseUnarySimpleEndToEnd<armnn::DataType::QSymmS16>(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Rsqrt); } // Addition |