From d7fca093be53b314e100e15a8fa080cb506b60a3 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Thu, 12 Jan 2023 14:53:34 +0000 Subject: 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 Change-Id: I3eaa9c684647ead61520a563815581aa68bee51b --- src/backends/reference/test/RefEndToEndTests.cpp | 47 +++++++++++------------- 1 file changed, 22 insertions(+), 25 deletions(-) (limited to 'src/backends/reference') 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 defaultBackends = {armnn::Compute::CpuRef}; +// ElementwiseUnary // Abs TEST_CASE("RefAbsEndToEndTestFloat32") { - std::vector 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(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); } TEST_CASE("RefAbsEndToEndTestUint8") { - // Note the expected output will be implicitly quantized by the below test function - std::vector 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(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Abs); } TEST_CASE("RefAbsEndToEndTestInt16") { - // Note the expected output will be implicitly quantized by the below test function - std::vector 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(defaultBackends, + UnaryOperation::Abs); +} +// Rsqrt +TEST_CASE("RefRsqrtEndToEndTestFloat32") +{ + ElementwiseUnarySimpleEndToEnd(defaultBackends, + UnaryOperation::Rsqrt); +} + +TEST_CASE("RefRsqrtEndToEndTestUint8") +{ + ElementwiseUnarySimpleEndToEnd(defaultBackends, + UnaryOperation::Rsqrt); +} + +TEST_CASE("RefRsqrtEndToEndTestInt16") +{ ElementwiseUnarySimpleEndToEnd(defaultBackends, - UnaryOperation::Abs, - expectedOutput); + UnaryOperation::Rsqrt); } // Addition -- cgit v1.2.1