blob: a19eaa93466808a2565758abeed6bbd7731afaf7 [file] [log] [blame]
Jan Eilers45274902020-10-15 18:34:43 +01001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <armnn/BackendId.hpp>
9#include <armnn/Tensor.hpp>
10
11/// Holds all parameters necessary to execute a network
12/// Check ExecuteNetworkProgramOptions.cpp for a description of each parameter
13struct ExecuteNetworkParams
14{
15 using TensorShapePtr = std::unique_ptr<armnn::TensorShape>;
16
Finn Williamsf806c4d2021-02-22 15:13:12 +000017 enum class TfLiteExecutor
18 {
19 ArmNNTfLiteParser,
20 ArmNNTfLiteDelegate,
21 TfliteInterpreter
22 };
23
Matthew Sloyan42432112021-01-08 10:30:51 +000024 std::string m_CachedNetworkFilePath;
Jan Eilers45274902020-10-15 18:34:43 +010025 std::vector<armnn::BackendId> m_ComputeDevices;
26 bool m_DequantizeOutput;
27 std::string m_DynamicBackendsPath;
28 bool m_EnableBf16TurboMode;
29 bool m_EnableFastMath = false;
30 bool m_EnableFp16TurboMode;
31 bool m_EnableLayerDetails = false;
32 bool m_EnableProfiling;
33 bool m_GenerateTensorData;
34 bool m_InferOutputShape = false;
Sadik Armagan5d03e312020-11-17 16:43:56 +000035 bool m_EnableDelegate = false;
Jan Eilers45274902020-10-15 18:34:43 +010036 std::vector<std::string> m_InputNames;
37 std::vector<std::string> m_InputTensorDataFilePaths;
38 std::vector<TensorShapePtr> m_InputTensorShapes;
39 std::vector<std::string> m_InputTypes;
40 bool m_IsModelBinary;
41 size_t m_Iterations;
42 std::string m_ModelFormat;
43 std::string m_ModelPath;
Matthew Sloyan0a7dc6b2021-02-10 16:50:53 +000044 unsigned int m_NumberOfThreads;
Jan Eilers45274902020-10-15 18:34:43 +010045 std::vector<std::string> m_OutputNames;
46 std::vector<std::string> m_OutputTensorFiles;
47 std::vector<std::string> m_OutputTypes;
48 bool m_ParseUnsupported = false;
49 bool m_PrintIntermediate;
50 bool m_QuantizeInput;
Matthew Sloyan42432112021-01-08 10:30:51 +000051 bool m_SaveCachedNetwork;
Jan Eilers45274902020-10-15 18:34:43 +010052 size_t m_SubgraphId;
53 double m_ThresholdTime;
54 int m_TuningLevel;
55 std::string m_TuningPath;
Finn Williams40646322021-02-11 16:16:42 +000056 std::string m_MLGOTuningFilePath;
Finn Williamsf806c4d2021-02-22 15:13:12 +000057 TfLiteExecutor m_TfLiteExecutor;
Jan Eilers45274902020-10-15 18:34:43 +010058
59 // Ensures that the parameters for ExecuteNetwork fit together
60 void ValidateParams();
61};