diff options
Diffstat (limited to 'delegate/opaque/include/armnn_delegate.hpp')
-rw-r--r-- | delegate/opaque/include/armnn_delegate.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/delegate/opaque/include/armnn_delegate.hpp b/delegate/opaque/include/armnn_delegate.hpp index 653015a63c..bb6451f649 100644 --- a/delegate/opaque/include/armnn_delegate.hpp +++ b/delegate/opaque/include/armnn_delegate.hpp @@ -10,6 +10,7 @@ #include <tensorflow/core/public/version.h> #include <tensorflow/lite/c/c_api_opaque.h> #include <tensorflow/lite/core/experimental/acceleration/configuration/c/stable_delegate.h> +#include <tensorflow/lite/experimental/acceleration/configuration/delegate_registry.h> #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5) #define ARMNN_POST_TFLITE_2_5 @@ -87,6 +88,35 @@ const TfLiteOpaqueDelegatePlugin* GetArmnnDelegatePluginApi(); extern const TfLiteStableDelegate TFL_TheStableDelegate; +using tflite::delegates::DelegatePluginInterface; +using TfLiteOpaqueDelegatePtr = tflite::delegates::TfLiteDelegatePtr; + +class ArmnnDelegatePlugin : public DelegatePluginInterface +{ +public: + static std::unique_ptr<ArmnnDelegatePlugin> New(const tflite::TFLiteSettings& tflite_settings) + { + return std::make_unique<ArmnnDelegatePlugin>(tflite_settings); + } + + tflite::delegates::TfLiteDelegatePtr Create() override + { + // Use default settings until options have been enabled. + return tflite::delegates::TfLiteDelegatePtr( + TfLiteArmnnOpaqueDelegateCreate(nullptr), TfLiteArmnnOpaqueDelegateDelete); + } + + int GetDelegateErrno(TfLiteOpaqueDelegate* from_delegate) override + { + return 0; + } + + explicit ArmnnDelegatePlugin(const tflite::TFLiteSettings& tfliteSettings) + { + // Use default settings until options have been enabled. + } +}; + /// ArmnnSubgraph class where parsing the nodes to ArmNN format and creating the ArmNN Graph class ArmnnSubgraph { |