aboutsummaryrefslogtreecommitdiff
path: root/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2023-04-04 12:06:14 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2023-04-07 18:23:12 +0100
commit65c21a1eeff32f3abf91c3a638252ceb1ae5c51e (patch)
tree9dfdf5727687c09a932f8d8dd2f2047e3b5690cd /delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp
parent40847fc1f8ae7b7f56ca16eec92d1b46929f53e3 (diff)
downloadarmnn-65c21a1eeff32f3abf91c3a638252ceb1ae5c51e.tar.gz
IVGCVSW-7563 Implement DelegateTestInterpreter for opaque delegate
* Added opaque delegate DelegateTestInterpreter implementation * Moved classic specific tests to ArmnnClassicDelegateTest.cpp * Moved opaque specific tests to ArmnnOpaqueDelegateTest.cpp * Removed ArmnnDelegateTest.cpp * Moved TfLiteStableDelegate implementation to armnn_delegate.cpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Ifc92b6fb38dc370f3fb88a4daca56d457e74bc2e
Diffstat (limited to 'delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp')
-rw-r--r--delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp b/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp
new file mode 100644
index 0000000000..1635b65809
--- /dev/null
+++ b/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp
@@ -0,0 +1,42 @@
+//
+// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
+#include <doctest/doctest.h>
+
+#include <opaque/include/armnn_delegate.hpp>
+#include <opaque/include/Version.hpp>
+
+namespace armnnOpaqueDelegate
+{
+
+TEST_SUITE("ArmnnOpaqueDelegate")
+{
+
+TEST_CASE ("DelegateOptions_OpaqueDelegateDefault")
+{
+ // Check default options can be created
+ auto options = armnnOpaqueDelegate::TfLiteArmnnDelegateOptionsDefault();
+ armnnOpaqueDelegate::ArmnnOpaqueDelegate delegate(options);
+
+ // Check version returns correctly
+ auto version = delegate.GetVersion();
+ CHECK_EQ(version, OPAQUE_DELEGATE_VERSION);
+
+ auto* builder = delegate.GetDelegateBuilder();
+ CHECK(builder);
+
+ // Check Opaque delegate created
+ auto opaqueDelegate = armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateCreate(&options);
+ CHECK(opaqueDelegate);
+
+ // Check Opaque Delegate can be deleted
+ CHECK(opaqueDelegate->opaque_delegate_builder->data);
+ armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateDelete(opaqueDelegate);
+}
+
+}
+
+} // namespace armnnDelegate