8 #include <DelegateOptions.hpp>
10 #include <tensorflow/lite/builtin_ops.h>
11 #include <tensorflow/lite/c/builtin_op_data.h>
12 #include <tensorflow/lite/c/common.h>
13 #include <tensorflow/lite/minimal_logging.h>
14 #include <tensorflow/lite/version.h>
16 #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 3)
17 #define ARMNN_POST_TFLITE_2_3
20 #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 4)
21 #define ARMNN_POST_TFLITE_2_4
24 #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5)
25 #define ARMNN_POST_TFLITE_2_5
50 TfLiteStatus
DoPrepare(TfLiteContext* context, TfLiteDelegate* delegate);
57 explicit Delegate(armnnDelegate::DelegateOptions options);
74 return instance.get();
77 TfLiteDelegate m_Delegate = {
78 reinterpret_cast<void*
>(
this),
83 kTfLiteDelegateFlagsNone,
90 armnnDelegate::DelegateOptions m_Options;
98 const TfLiteDelegateParams* parameters,
101 TfLiteStatus
Prepare(TfLiteContext* tfLiteContext);
103 TfLiteStatus
Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode);
106 TfLiteContext* tfLiteContext,
107 TfLiteRegistration* tfLiteRegistration,
108 TfLiteNode* tfLiteNode,
114 std::vector<armnn::BindingPointInfo>& inputBindings,
115 std::vector<armnn::BindingPointInfo>& outputBindings)
116 : m_NetworkId(networkId), m_Runtime(runtime), m_InputBindings(inputBindings), m_OutputBindings(outputBindings)
119 static TfLiteStatus AddInputLayer(
DelegateData& delegateData,
120 TfLiteContext* tfLiteContext,
121 const TfLiteIntArray* inputs,
122 std::vector<armnn::BindingPointInfo>& inputBindings);
124 static TfLiteStatus AddOutputLayer(
DelegateData& delegateData,
125 TfLiteContext* tfLiteContext,
126 const TfLiteIntArray* outputs,
127 std::vector<armnn::BindingPointInfo>& outputBindings);
136 std::vector<armnn::BindingPointInfo> m_InputBindings;
137 std::vector<armnn::BindingPointInfo> m_OutputBindings;