diff options
author | Ryan OShea <ryan.oshea3@arm.com> | 2023-05-11 20:37:53 +0100 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-05-18 16:06:23 +0000 |
commit | 59f8f65f047546e4a73966a988d087eeb6602cea (patch) | |
tree | ab72dbc5b4357801cbdd468b2800ccc043e3dfbe /delegate/opaque/src/armnn_delegate.cpp | |
parent | 34c1c38944b47b881febdfb9f98103dbdc949ed0 (diff) | |
download | armnn-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_delegate.cpp')
-rw-r--r-- | delegate/opaque/src/armnn_delegate.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/delegate/opaque/src/armnn_delegate.cpp b/delegate/opaque/src/armnn_delegate.cpp index 45aff85346..f32a6f43b8 100644 --- a/delegate/opaque/src/armnn_delegate.cpp +++ b/delegate/opaque/src/armnn_delegate.cpp @@ -6,8 +6,6 @@ #include <armnn_delegate.hpp> #include <OpaqueDelegateUtils.hpp> -#include <Version.hpp> - #include "Activation.hpp" #include "ArgMinMax.hpp" #include "BatchMatMul.hpp" @@ -50,7 +48,6 @@ #include <tensorflow/lite/context_util.h> #include <tensorflow/lite/schema/schema_generated.h> #include <tensorflow/lite/minimal_logging.h> -#include <tensorflow/lite/logger.h> #include <algorithm> #include <iostream> @@ -59,16 +56,8 @@ namespace armnnOpaqueDelegate { -const TfLiteStableDelegate TFL_TheStableDelegate = -{ - /*delegate_abi_version=*/ TFL_STABLE_DELEGATE_ABI_VERSION, - /*delegate_name=*/ "armnn_delegate", - /*delegate_version=*/ OPAQUE_DELEGATE_VERSION, - /*delegate_plugin=*/ GetArmnnDelegatePluginApi() -}; - static auto* g_delegate_plugin_ArmnnDelegatePlugin_ = - new tflite::delegates::DelegatePluginRegistry::Register(TFL_TheStableDelegate.delegate_name, + new tflite::delegates::DelegatePluginRegistry::Register("armnn_delegate", ArmnnDelegatePlugin::New); ArmnnOpaqueDelegate::ArmnnOpaqueDelegate(armnnDelegate::DelegateOptions options) @@ -126,7 +115,7 @@ TfLiteStatus DoPrepare(TfLiteOpaqueContext* tfLiteContext, TfLiteOpaqueDelegate* // ArmNN Opaque Delegate Registration TfLiteRegistrationExternal* kernelRegistration = TfLiteRegistrationExternalCreate(kTfLiteBuiltinDelegate, - TFL_TheStableDelegate.delegate_name, + "armnn_delegate", /*version=*/OPAQUE_DELEGATE_MAJOR_VERSION); if(kernelRegistration == nullptr) { @@ -227,13 +216,6 @@ void TfLiteArmnnOpaqueDelegateDelete(TfLiteOpaqueDelegate* tfLiteDelegate) } } -const TfLiteOpaqueDelegatePlugin* GetArmnnDelegatePluginApi() -{ - static constexpr TfLiteOpaqueDelegatePlugin armnnPlugin{ - TfLiteArmnnOpaqueDelegateCreate, TfLiteArmnnOpaqueDelegateDelete, TfLiteArmnnOpaqueDelegateErrno}; - return &armnnPlugin; -} - const std::string ArmnnOpaqueDelegate::GetVersion() { return OPAQUE_DELEGATE_VERSION; } @@ -776,6 +758,12 @@ TfLiteStatus ArmnnSubgraph::VisitNode(DelegateData& delegateData, tfLiteNode, nodeIndex, kTfLiteBuiltinExpandDims); + case kTfLiteBuiltinFill: + return VisitFillOperator(delegateData, + tfLiteContext, + tfLiteNode, + nodeIndex, + kTfLiteBuiltinFill); case kTfLiteBuiltinFloor: return VisitFloorOperator(delegateData, tfLiteContext, @@ -928,6 +916,12 @@ TfLiteStatus ArmnnSubgraph::VisitNode(DelegateData& delegateData, tfLiteNode, nodeIndex, kTfLiteBuiltinMinimum); + case kTfLiteBuiltinMirrorPad: + return VisitPadOperator(delegateData, + tfLiteContext, + tfLiteNode, + nodeIndex, + kTfLiteBuiltinMirrorPad); case kTfLiteBuiltinMul: return VisitElementwiseBinaryOperator(delegateData, tfLiteContext, |