From 59f8f65f047546e4a73966a988d087eeb6602cea Mon Sep 17 00:00:00 2001 From: Ryan OShea Date: Thu, 11 May 2023 20:37:53 +0100 Subject: 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 Signed-off-by: Matthew Sloyan Change-Id: I7f8d8b4269bb4fbe27b6f47709cbd828554d37d8 --- delegate/opaque/src/armnn_delegate.cpp | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'delegate/opaque/src/armnn_delegate.cpp') 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 #include -#include - #include "Activation.hpp" #include "ArgMinMax.hpp" #include "BatchMatMul.hpp" @@ -50,7 +48,6 @@ #include #include #include -#include #include #include @@ -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, -- cgit v1.2.1