ArmNN
 24.02
armnn_external_delegate.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <armnn_delegate.hpp>
7 
8 namespace {
9 
10  TfLiteOpaqueDelegate* ArmNNDelegateCreateFunc(const void* tflite_settings)
11  {
12  armnnDelegate::DelegateOptions opt = armnnOpaqueDelegate::ParseArmNNSettings(
13  static_cast<const tflite::TFLiteSettings*>(tflite_settings));
14 
16  return delegate;
17  }
18 
19  void ArmNNDelegateDestroyFunc(TfLiteOpaqueDelegate* armnnDelegate)
20  {
23  }
24 
25  int ArmNNDelegateErrnoFunc(TfLiteOpaqueDelegate* sample_stable_delegate)
26  {
27  return 0;
28  }
29 
30  const TfLiteOpaqueDelegatePlugin armnn_delegate_plugin = {
31  ArmNNDelegateCreateFunc, ArmNNDelegateDestroyFunc,
32  ArmNNDelegateErrnoFunc};
33 
34  const TfLiteStableDelegate armnn_delegate = {
35  /*delegate_abi_version=*/ TFL_STABLE_DELEGATE_ABI_VERSION,
36  /*delegate_name=*/ "armnn_delegate",
37  /*delegate_version=*/ OPAQUE_DELEGATE_VERSION,
38  /*delegate_plugin=*/ &armnn_delegate_plugin
39  };
40 
41 } // namespace
42 
43 /**
44  * The ArmNN delegate to be loaded dynamically
45  */
46 extern "C" const TfLiteStableDelegate TFL_TheStableDelegate = armnn_delegate;
armnnOpaqueDelegate::ParseArmNNSettings
armnnDelegate::DelegateOptions ParseArmNNSettings(const tflite::TFLiteSettings *tflite_settings)
armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateDelete
void TfLiteArmnnOpaqueDelegateDelete(TfLiteOpaqueDelegate *tfLiteDelegate)
armnnOpaqueDelegate::TfLiteArmnnOpaqueDelegateCreate
TfLiteOpaqueDelegate * TfLiteArmnnOpaqueDelegateCreate(armnnDelegate::DelegateOptions options)
OPAQUE_DELEGATE_VERSION
#define OPAQUE_DELEGATE_VERSION
DELEGATE_VERSION: "X.Y.Z" where: X = Major version number Y = Minor version number Z = Patch version ...
Definition: Version.hpp:25
TFL_TheStableDelegate
const TfLiteStableDelegate TFL_TheStableDelegate
The ArmNN delegate to be loaded dynamically.
Definition: armnn_external_delegate.cpp:46
armnnDelegate
Definition: armnn_delegate.hpp:28