aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/ShapeTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'delegate/src/test/ShapeTest.cpp')
-rw-r--r--delegate/src/test/ShapeTest.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/delegate/src/test/ShapeTest.cpp b/delegate/src/test/ShapeTest.cpp
new file mode 100644
index 0000000000..b49910adf6
--- /dev/null
+++ b/delegate/src/test/ShapeTest.cpp
@@ -0,0 +1,45 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "ShapeTestHelper.hpp"
+
+#include <doctest/doctest.h>
+
+namespace armnnDelegate
+{
+
+void ShapeSimpleTest(std::vector<armnn::BackendId>& backends)
+{
+ std::vector<int32_t> inputShape{ 1, 3, 2, 3 };
+
+ std::vector<int32_t> inputValues{ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, };
+
+ std::vector<int32_t> expectedOutputShape{ 4 };
+ std::vector<int32_t> expectedOutputValues{ 1, 3, 2, 3 };
+
+ ShapeTest<int32_t, int32_t>(::tflite::TensorType_INT32,
+ ::tflite::TensorType_INT32,
+ backends,
+ inputShape,
+ inputValues,
+ expectedOutputValues,
+ expectedOutputShape);
+}
+
+// SHAPE Test Suite
+TEST_SUITE("SHAPE_CpuRefTests")
+{
+
+TEST_CASE("SHAPE_Simple_CpuRef_Test")
+{
+ std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
+ ShapeSimpleTest(backends);
+}
+
+}
+// End of SHAPE Test Suite
+
+} // namespace armnnDelegate \ No newline at end of file