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,
103 TfLiteStatus
Prepare(TfLiteContext* tfLiteContext);
105 TfLiteStatus
Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode);
108 TfLiteContext* tfLiteContext,
109 TfLiteRegistration* tfLiteRegistration,
110 TfLiteNode* tfLiteNode,
116 std::vector<armnn::BindingPointInfo>& inputBindings,
117 std::vector<armnn::BindingPointInfo>& outputBindings)
118 : m_NetworkId(networkId), m_Runtime(runtime), m_InputBindings(inputBindings), m_OutputBindings(outputBindings)
121 static TfLiteStatus AddInputLayer(
DelegateData& delegateData,
122 TfLiteContext* tfLiteContext,
123 const TfLiteIntArray* inputs,
124 std::vector<armnn::BindingPointInfo>& inputBindings);
126 static TfLiteStatus AddOutputLayer(
DelegateData& delegateData,
127 TfLiteContext* tfLiteContext,
128 const TfLiteIntArray* outputs,
129 std::vector<armnn::BindingPointInfo>& outputBindings);
138 std::vector<armnn::BindingPointInfo> m_InputBindings;
139 std::vector<armnn::BindingPointInfo> m_OutputBindings;