aboutsummaryrefslogtreecommitdiff
path: root/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
diff options
context:
space:
mode:
authorCathal Corbett <cathal.corbett@arm.com>2022-12-09 12:17:27 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2022-12-13 12:13:20 +0000
commit3b9acd515918ac1af5498b3e7501c0b16a88a8e0 (patch)
treea537cbdd7c45fea1772cbb34f8a23ecc7dbd6e1a /src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
parent8107ccce5167f160b9c98a6042878dd0408220b5 (diff)
downloadarmnn-3b9acd515918ac1af5498b3e7501c0b16a88a8e0.tar.gz
IVGCVSW-7342 Add Slice support to TOSA Reference Backend
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I8be286b69bebd4cd36033e3145632bb043938d16
Diffstat (limited to 'src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp')
-rw-r--r--src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
index 86b01d8d0c..a1bab83e72 100644
--- a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
+++ b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
@@ -329,4 +329,56 @@ TEST_CASE("IsLayerSupportedTosaReferenceReshapeUnsupported")
"has an unsupported data type: DType_UNKNOWN") != std::string::npos);
}
+TEST_CASE("IsLayerSupportedTosaReferenceSlice")
+{
+ TensorShape inShape = {3,2,3};
+ TensorShape outShape = {2,1,3};
+ TensorInfo in(inShape, DataType::Float32);
+ TensorInfo out(outShape, DataType::Float32);
+
+ SliceDescriptor descriptor;
+ descriptor.m_Begin = {1,0,0 };
+ descriptor.m_Size = {2,1,3 };
+
+ TosaRefLayerSupport supportChecker;
+ std::string reasonIfNotSupported;
+ auto supported = supportChecker.IsLayerSupported(LayerType::Slice,
+ {in, out},
+ descriptor,
+ EmptyOptional(),
+ EmptyOptional(),
+ reasonIfNotSupported);
+
+ CHECK(supported);
+}
+
+TEST_CASE("IsLayerSupportedTosaReferenceSliceUnsupported")
+{
+ TensorShape inShape = {3,2,3};
+ TensorShape outShape = {2,1,3};
+ TensorInfo in(inShape, DataType::Signed64);
+ TensorInfo out(outShape, DataType::Signed64);
+
+ SliceDescriptor descriptor;
+ descriptor.m_Begin = {1,0,0};
+ descriptor.m_Size = {2,1,3};
+
+ TosaRefLayerSupport supportChecker;
+ std::string reasonIfNotSupported;
+ auto supported = supportChecker.IsLayerSupported(LayerType::Slice,
+ {in, out},
+ descriptor,
+ EmptyOptional(),
+ EmptyOptional(),
+ reasonIfNotSupported);
+
+ CHECK(!supported);
+ REQUIRE(reasonIfNotSupported.find(
+ "TOSA Reference Operator: Op_SLICE for input: input0_") != std::string::npos);
+ REQUIRE(reasonIfNotSupported.find(
+ "TOSA Reference Operator: Op_SLICE for output: output0_") != std::string::npos);
+ REQUIRE(reasonIfNotSupported.find(
+ "has an unsupported data type: DType_UNKNOWN") != std::string::npos);
+}
+
}