blob: 5101ac018232c2600b82198eaed128206e7d8303 [file] [log] [blame]
Teresa Charlin83b42912022-07-07 14:24:59 +01001//
Colm Donelan35a06892023-02-06 15:01:57 +00002// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved.
Teresa Charlin83b42912022-07-07 14:24:59 +01003// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include "IExecutor.hpp"
8#include "NetworkExecutionUtils/NetworkExecutionUtils.hpp"
9#include "ExecuteNetworkProgramOptions.hpp"
10#include "armnn/utility/NumericCast.hpp"
11#include "armnn/utility/Timer.hpp"
12
13#include <armnn_delegate.hpp>
14#include <DelegateOptions.hpp>
15
16#include <tensorflow/lite/c/common.h>
17#include <tensorflow/lite/interpreter.h>
18#include <tensorflow/lite/kernels/register.h>
19
20using namespace tflite;
21class TfLiteExecutor : public IExecutor
22{
23public:
Colm Donelan35a06892023-02-06 15:01:57 +000024 TfLiteExecutor(const ExecuteNetworkParams& m_Params, armnn::IRuntime::CreationOptions runtimeOptions);
Teresa Charlin83b42912022-07-07 14:24:59 +010025
26 std::vector<const void*> Execute() override;
27 void PrintNetworkInfo() override{};
28 void CompareAndPrintResult(std::vector<const void*> otherOutput) override;
29
30private:
31 std::unique_ptr<tflite::FlatBufferModel> m_Model;
32 const ExecuteNetworkParams& m_Params;
33 std::unique_ptr<Interpreter> m_TfLiteInterpreter;
34};
35