aboutsummaryrefslogtreecommitdiff
path: root/delegate/opaque/src/armnn_external_delegate.cpp
diff options
context:
space:
mode:
authorRyan OShea <ryan.oshea3@arm.com>2023-05-11 20:37:53 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2023-05-18 16:06:23 +0000
commit59f8f65f047546e4a73966a988d087eeb6602cea (patch)
treeab72dbc5b4357801cbdd468b2800ccc043e3dfbe /delegate/opaque/src/armnn_external_delegate.cpp
parent34c1c38944b47b881febdfb9f98103dbdc949ed0 (diff)
downloadarmnn-59f8f65f047546e4a73966a988d087eeb6602cea.tar.gz
IVGCVSW-7735 Opaque Delegate Cleanup
* Move TFL_TheStableDelegate to opaque/armnn_delegate_external.cpp * Change TFL_TheStableDelegate to extern variable * Remove duplicated opaque test sources * Add support for missing Fill operator * Enable support for Mirror Pad * Fix failing Split tests Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I7f8d8b4269bb4fbe27b6f47709cbd828554d37d8
Diffstat (limited to 'delegate/opaque/src/armnn_external_delegate.cpp')
-rw-r--r--delegate/opaque/src/armnn_external_delegate.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/delegate/opaque/src/armnn_external_delegate.cpp b/delegate/opaque/src/armnn_external_delegate.cpp
index e16969768e..6cc29f3fe1 100644
--- a/delegate/opaque/src/armnn_external_delegate.cpp
+++ b/delegate/opaque/src/armnn_external_delegate.cpp
@@ -2,3 +2,42 @@
// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
+
+#include <armnn_delegate.hpp>
+
+namespace {
+
+ TfLiteOpaqueDelegate* ArmNNDelegateCreateFunc(const void* tflite_settings)
+ {
+ auto delegate = armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateCreate(tflite_settings);
+ return delegate;
+ }
+
+ void ArmNNDelegateDestroyFunc(TfLiteOpaqueDelegate* armnnDelegate)
+ {
+ armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateDelete(
+ armnnDelegate);
+ }
+
+ int ArmNNDelegateErrnoFunc(TfLiteOpaqueDelegate* sample_stable_delegate)
+ {
+ return 0;
+ }
+
+ const TfLiteOpaqueDelegatePlugin armnn_delegate_plugin = {
+ ArmNNDelegateCreateFunc, ArmNNDelegateDestroyFunc,
+ ArmNNDelegateErrnoFunc};
+
+ const TfLiteStableDelegate armnn_delegate = {
+ /*delegate_abi_version=*/ TFL_STABLE_DELEGATE_ABI_VERSION,
+ /*delegate_name=*/ "armnn_delegate",
+ /*delegate_version=*/ OPAQUE_DELEGATE_VERSION,
+ /*delegate_plugin=*/ &armnn_delegate_plugin
+ };
+
+} // namespace
+
+/**
+ * The ArmNN delegate to be loaded dynamically
+ */
+extern "C" const TfLiteStableDelegate TFL_TheStableDelegate = armnn_delegate; \ No newline at end of file