aboutsummaryrefslogtreecommitdiff
path: root/src/backends/tosaReference/test
diff options
context:
space:
mode:
authorCathal Corbett <cathal.corbett@arm.com>2022-12-22 13:09:38 +0000
committerCathal Corbett <cathal.corbett@arm.com>2022-12-23 13:37:25 +0000
commit0bb096d9cd11bec1a890066064c8a28c4a4fd6ee (patch)
treef01cc42856da05e9e3f5af452979136afb045588 /src/backends/tosaReference/test
parent56fb21ee9fd51038505ef663ef5717df5945f385 (diff)
downloadarmnn-0bb096d9cd11bec1a890066064c8a28c4a4fd6ee.tar.gz
IVGCVSW-7343 Add Transpose support to TOSA Reference Backend
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I11505f672349e1f04143edfdc2df8775f685372d
Diffstat (limited to 'src/backends/tosaReference/test')
-rw-r--r--src/backends/tosaReference/test/TosaRefEndToEndTests.cpp7
-rw-r--r--src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp42
2 files changed, 49 insertions, 0 deletions
diff --git a/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp b/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp
index 67b87ae8b9..e19462e986 100644
--- a/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp
+++ b/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp
@@ -14,6 +14,7 @@
#include "backendsCommon/test/SliceEndToEndTestImpl.hpp"
#include "backendsCommon/test/SubtractionEndToEndTestImpl.hpp"
#include "backendsCommon/test/TransposeConvolution2dEndToEndTestImpl.hpp"
+#include "backendsCommon/test/TransposeEndToEndTestImpl.hpp"
#include <doctest/doctest.h>
@@ -195,4 +196,10 @@ TEST_CASE("TosaRefSimpleTransposeConvolution2dEndToEndFloatNhwcTest")
tosaDefaultBackends, armnn::DataLayout::NHWC);
}
+// Transpose
+TEST_CASE("TosaRefTransposeEndtoEndTestFloat32")
+{
+ TransposeEndToEnd<armnn::DataType::Float32>(tosaDefaultBackends);
+}
+
} \ No newline at end of file
diff --git a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
index 9119b13557..66dfbe8dff 100644
--- a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
+++ b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
@@ -509,4 +509,46 @@ TEST_CASE("IsLayerSupportedTosaReferenceTransposeConv2dUnsupported")
CHECK(!supported);
}
+TEST_CASE("IsLayerSupportedTosaReferenceTranspose")
+{
+ TensorShape inShape = { 1, 1, 5, 3 };
+ TensorShape outShape = { 1, 5, 1, 3 };
+ TensorInfo in(inShape, DataType::Float32);
+ TensorInfo out(outShape, DataType::Float32);
+
+ TransposeDescriptor transposeDescriptor = TransposeDescriptor({ 0, 2, 1 ,3 });
+
+ TosaRefLayerSupport supportChecker;
+ std::string reasonIfNotSupported;
+ auto supported = supportChecker.IsLayerSupported(LayerType::Transpose,
+ {in, out},
+ transposeDescriptor,
+ EmptyOptional(),
+ EmptyOptional(),
+ reasonIfNotSupported);
+
+ CHECK(supported);
+}
+
+TEST_CASE("IsLayerSupportedTosaReferenceTransposeUnsupported")
+{
+ TensorShape inShape = { 1, 1, 5, 3 };
+ TensorShape outShape = { 1, 5, 1, 3 };
+ TensorInfo in(inShape, DataType::Signed64);
+ TensorInfo out(outShape, DataType::Signed64);
+
+ TransposeDescriptor transposeDescriptor = TransposeDescriptor({ 0, 2, 1 ,3 });
+
+ TosaRefLayerSupport supportChecker;
+ std::string reasonIfNotSupported;
+ auto supported = supportChecker.IsLayerSupported(LayerType::Transpose,
+ {in, out},
+ transposeDescriptor,
+ EmptyOptional(),
+ EmptyOptional(),
+ reasonIfNotSupported);
+
+ CHECK(!supported);
+}
+
}