blob: 020dbdcced3271b00b7e295886a5db3f69ac0580 [file] [log] [blame]
Jan Eilers45274902020-10-15 18:34:43 +01001//
Teresa Charlin83b42912022-07-07 14:24:59 +01002// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
Jan Eilers45274902020-10-15 18:34:43 +01003// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <armnn/BackendId.hpp>
9#include <armnn/Tensor.hpp>
10
Colm Donelan3cff15a2021-10-12 15:06:19 +010011#if defined(ARMNN_TFLITE_DELEGATE)
12#include <DelegateOptions.hpp>
13#endif
14
Jan Eilers45274902020-10-15 18:34:43 +010015/// Holds all parameters necessary to execute a network
16/// Check ExecuteNetworkProgramOptions.cpp for a description of each parameter
17struct ExecuteNetworkParams
18{
Finn Williamsf806c4d2021-02-22 15:13:12 +000019 enum class TfLiteExecutor
20 {
21 ArmNNTfLiteParser,
22 ArmNNTfLiteDelegate,
23 TfliteInterpreter
24 };
25
Teresa Charlin83b42912022-07-07 14:24:59 +010026 bool m_AllowExpandedDims;
27 std::string m_CachedNetworkFilePath;
28 std::vector<armnn::BackendId> m_ComputeDevices;
29 bool m_Concurrent;
30 bool m_DequantizeOutput;
31 std::string m_DynamicBackendsPath;
32 bool m_EnableBf16TurboMode;
33 bool m_EnableFastMath = false;
34 bool m_EnableFp16TurboMode;
35 bool m_EnableLayerDetails = false;
36 bool m_EnableProfiling;
37 bool m_GenerateTensorData;
38 bool m_InferOutputShape = false;
39 bool m_EnableDelegate = false;
40 bool m_IsModelBinary;
41 std::vector<std::string> m_InputNames;
42 std::vector<std::string> m_InputTensorDataFilePaths;
43 std::vector<armnn::TensorShape> m_InputTensorShapes;
44 size_t m_Iterations;
45 std::string m_ModelPath;
46 unsigned int m_NumberOfThreads;
47 bool m_OutputDetailsToStdOut;
48 bool m_OutputDetailsOnlyToStdOut;
49 std::vector<std::string> m_OutputNames;
50 std::vector<std::string> m_OutputTensorFiles;
51 bool m_ParseUnsupported = false;
52 bool m_PrintIntermediate;
Keith Davis15f9c682022-10-14 15:50:33 +010053 bool m_PrintIntermediateOutputsToFile;
Teresa Charlin83b42912022-07-07 14:24:59 +010054 bool m_DontPrintOutputs;
55 bool m_QuantizeInput;
56 bool m_SaveCachedNetwork;
57 size_t m_SubgraphId;
58 double m_ThresholdTime;
59 int m_TuningLevel;
60 std::string m_TuningPath;
61 std::string m_MLGOTuningFilePath;
62 TfLiteExecutor m_TfLiteExecutor;
63 size_t m_ThreadPoolSize;
64 bool m_ImportInputsIfAligned;
65 bool m_ReuseBuffers;
66 std::string m_ComparisonFile;
67 std::vector<armnn::BackendId> m_ComparisonComputeDevices;
68 bool m_CompareWithTflite;
Jan Eilers45274902020-10-15 18:34:43 +010069 // Ensures that the parameters for ExecuteNetwork fit together
70 void ValidateParams();
Colm Donelan3cff15a2021-10-12 15:06:19 +010071
72#if defined(ARMNN_TFLITE_DELEGATE)
73 /// A utility method that populates a DelegateOptions object from this ExecuteNetworkParams.
74 armnnDelegate::DelegateOptions ToDelegateOptions() const;
75#endif
76
Jan Eilers45274902020-10-15 18:34:43 +010077};