diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2023-03-16 17:01:56 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2023-03-31 13:44:19 +0100 |
commit | c4fb0dd4145e05123c546458ba5d281abfcc2b28 (patch) | |
tree | f4c6aebaaf4055ff1109a8e963c559aa7ba69945 /delegate/test | |
parent | 6d4e761f12b0ec34294bae1bfafacd8f468e7e0e (diff) | |
download | armnn-c4fb0dd4145e05123c546458ba5d281abfcc2b28.tar.gz |
IVGCVSW-7556 Introduce Opaque Delegate API
* Also added cmake for the new layers to reduce merge conflicts.
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Change-Id: Ieb59aa2b7e2a18c57c9357b8d5b5cd63d8211c85
Diffstat (limited to 'delegate/test')
-rw-r--r-- | delegate/test/ArmnnDelegateTest.cpp | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/delegate/test/ArmnnDelegateTest.cpp b/delegate/test/ArmnnDelegateTest.cpp index c23c702af8..4ef4ce9ed2 100644 --- a/delegate/test/ArmnnDelegateTest.cpp +++ b/delegate/test/ArmnnDelegateTest.cpp @@ -6,7 +6,9 @@ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include <doctest/doctest.h> -#include <armnn_delegate.hpp> +#include <classic/include/armnn_delegate.hpp> +#include <opaque/include/armnn_delegate.hpp> +#include <opaque/include/Version.hpp> #include <tensorflow/lite/kernels/builtin_op_kernels.h> #include <tensorflow/lite/interpreter.h> @@ -88,6 +90,42 @@ TEST_CASE ("ArmnnDelegateOptimizerOptionsRegistered") CHECK(tfLiteInterpreter != nullptr); } +TEST_CASE ("DelegateOptions_OpaqueDelegateDefault") +{ + // Check default options can be created + auto options = 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); +} + +TEST_CASE ("DelegateOptions_ClassicDelegateDefault") +{ + // Check default options can be created + auto options = TfLiteArmnnDelegateOptionsDefault(); + + // Check Classic delegate created + auto classicDelegate = armnnDelegate::TfLiteArmnnDelegateCreate(options); + CHECK(classicDelegate); + + // Check Classic Delegate can be deleted + CHECK(classicDelegate->data_); + armnnDelegate::TfLiteArmnnDelegateDelete(classicDelegate); +} + } } // namespace armnnDelegate |