-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDriverOptions.hpp
72 lines (64 loc) · 3.02 KB
/
DriverOptions.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include <armnn/ArmNN.hpp>
#include <set>
#include <string>
#include <vector>
namespace armnn_driver
{
class DriverOptions
{
public:
DriverOptions(armnn::Compute computeDevice, bool fp16Enabled = false);
DriverOptions(const std::vector<armnn::BackendId>& backends, bool fp16Enabled);
DriverOptions(int argc, char** argv);
DriverOptions(DriverOptions&& other) = default;
const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; }
bool IsVerboseLoggingEnabled() const { return m_VerboseLogging; }
const std::string& GetRequestInputsAndOutputsDumpDir() const { return m_RequestInputsAndOutputsDumpDir; }
const std::string& GetServiceName() const { return m_ServiceName; }
const std::set<unsigned int>& GetForcedUnsupportedOperations() const { return m_ForcedUnsupportedOperations; }
const std::string& GetClTunedParametersFile() const { return m_ClTunedParametersFile; }
const std::string& GetClMLGOTunedParametersFile() const { return m_ClMLGOTunedParametersFile; }
armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const { return m_ClTunedParametersMode; }
armnn::IGpuAccTunedParameters::TuningLevel GetClTuningLevel() const { return m_ClTuningLevel; }
bool IsGpuProfilingEnabled() const { return m_EnableGpuProfiling; }
bool IsFastMathEnabled() const { return m_FastMathEnabled; }
bool GetFp16Enabled() const { return m_fp16Enabled; }
void SetBackends(const std::vector<armnn::BackendId>& backends) { m_Backends = backends; }
bool ShouldExit() const { return m_ShouldExit; }
int GetExitCode() const { return m_ExitCode; }
const std::string& GetCachedNetworkFilePath() const { return m_CachedNetworkFilePath; }
bool SaveCachedNetwork() const { return m_SaveCachedNetwork; }
unsigned int GetNumberOfThreads() const { return m_NumberOfThreads; }
bool isAsyncModelExecutionEnabled() const { return m_EnableAsyncModelExecution; };
unsigned int getNoOfArmnnThreads() const { return m_ArmnnNumberOfThreads; };
bool isImportEnabled() const { return m_EnableImport; };
bool isExportEnabled() const { return m_EnableExport; };
private:
std::vector<armnn::BackendId> m_Backends;
bool m_VerboseLogging;
std::string m_RequestInputsAndOutputsDumpDir;
std::string m_ServiceName;
std::set<unsigned int> m_ForcedUnsupportedOperations;
std::string m_ClTunedParametersFile;
std::string m_ClMLGOTunedParametersFile;
armnn::IGpuAccTunedParameters::Mode m_ClTunedParametersMode;
armnn::IGpuAccTunedParameters::TuningLevel m_ClTuningLevel;
bool m_EnableGpuProfiling;
bool m_fp16Enabled;
bool m_FastMathEnabled;
bool m_ShouldExit;
int m_ExitCode;
std::string m_CachedNetworkFilePath;
bool m_SaveCachedNetwork;
unsigned int m_NumberOfThreads;
bool m_EnableAsyncModelExecution;
unsigned int m_ArmnnNumberOfThreads;
bool m_EnableImport;
bool m_EnableExport;
};
} // namespace armnn_driver