ArmNN
 23.02
DriverOptions.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/ArmNN.hpp>
9 
10 #include <set>
11 #include <string>
12 #include <vector>
13 
14 namespace armnn_driver
15 {
16 
18 {
19 public:
20  DriverOptions(armnn::Compute computeDevice, bool fp16Enabled = false);
21  DriverOptions(const std::vector<armnn::BackendId>& backends, bool fp16Enabled = false);
22  DriverOptions();
23  DriverOptions(DriverOptions&& other) = default;
24 
25 
26  const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; }
27  bool IsVerboseLoggingEnabled() const { return m_VerboseLogging; }
28  const std::string& GetRequestInputsAndOutputsDumpDir() const { return m_RequestInputsAndOutputsDumpDir; }
29  const std::string& GetServiceName() const { return m_ServiceName; }
30  const std::set<unsigned int>& GetForcedUnsupportedOperations() const { return m_ForcedUnsupportedOperations; }
31  const std::string& GetClTunedParametersFile() const { return m_ClTunedParametersFile; }
32  const std::string& GetClMLGOTunedParametersFile() const { return m_ClMLGOTunedParametersFile; }
33  armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const { return m_ClTunedParametersMode; }
35  bool IsGpuProfilingEnabled() const { return m_EnableGpuProfiling; }
36  bool IsFastMathEnabled() const { return m_FastMathEnabled; }
37  bool GetFp16Enabled() const { return m_fp16Enabled; }
38  void SetBackends(const std::vector<armnn::BackendId>& backends) { m_Backends = backends; }
39  bool ShouldExit() const { return m_ShouldExit; }
40  int GetExitCode() const { return m_ExitCode; }
41  const std::string& GetCachedNetworkFilePath() const { return m_CachedNetworkFilePath; }
42  bool SaveCachedNetwork() const { return m_SaveCachedNetwork; }
43  unsigned int GetNumberOfThreads() const { return m_NumberOfThreads; }
44  bool isAsyncModelExecutionEnabled() const { return m_EnableAsyncModelExecution; };
45  unsigned int getNoOfArmnnThreads() const { return m_ArmnnNumberOfThreads; };
46 
47 private:
48  std::vector<armnn::BackendId> m_Backends;
49  bool m_VerboseLogging;
50  std::string m_RequestInputsAndOutputsDumpDir;
51  std::string m_ServiceName;
52  std::set<unsigned int> m_ForcedUnsupportedOperations;
53  std::string m_ClTunedParametersFile;
54  std::string m_ClMLGOTunedParametersFile;
55  armnn::IGpuAccTunedParameters::Mode m_ClTunedParametersMode;
57  bool m_EnableGpuProfiling;
58  bool m_fp16Enabled;
59  bool m_FastMathEnabled;
60  bool m_ShouldExit;
61  int m_ExitCode;
62  std::string m_CachedNetworkFilePath;
63  bool m_SaveCachedNetwork;
64  unsigned int m_NumberOfThreads;
65  bool m_EnableAsyncModelExecution;
66  unsigned int m_ArmnnNumberOfThreads;
67 };
68 
69 } // namespace armnn_driver
armnn_driver::DriverOptions::DriverOptions
DriverOptions()
Definition: DriverOptions.cpp:77
armnn_driver::DriverOptions::GetNumberOfThreads
unsigned int GetNumberOfThreads() const
Definition: DriverOptions.hpp:43
armnn_driver::DriverOptions::SaveCachedNetwork
bool SaveCachedNetwork() const
Definition: DriverOptions.hpp:42
armnn_driver::DriverOptions::GetBackends
const std::vector< armnn::BackendId > & GetBackends() const
Definition: DriverOptions.hpp:26
armnn_driver
Helper classes.
Definition: ArmnnDevice.cpp:37
armnn_driver::DriverOptions::GetForcedUnsupportedOperations
const std::set< unsigned int > & GetForcedUnsupportedOperations() const
Definition: DriverOptions.hpp:30
ArmNN.hpp
armnn_driver::DriverOptions::GetExitCode
int GetExitCode() const
Definition: DriverOptions.hpp:40
armnn_driver::DriverOptions::isAsyncModelExecutionEnabled
bool isAsyncModelExecutionEnabled() const
Definition: DriverOptions.hpp:44
armnn::Compute
Compute
The Compute enum is now deprecated and it is now being replaced by BackendId.
Definition: BackendId.hpp:21
armnn::IGpuAccTunedParameters::Mode
Mode
Definition: IRuntime.hpp:323
armnn_driver::DriverOptions::GetClMLGOTunedParametersFile
const std::string & GetClMLGOTunedParametersFile() const
Definition: DriverOptions.hpp:32
armnn_driver::DriverOptions::GetClTunedParametersMode
armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const
Definition: DriverOptions.hpp:33
armnn_driver::DriverOptions::GetClTuningLevel
armnn::IGpuAccTunedParameters::TuningLevel GetClTuningLevel() const
Definition: DriverOptions.hpp:34
armnn_driver::DriverOptions::GetCachedNetworkFilePath
const std::string & GetCachedNetworkFilePath() const
Definition: DriverOptions.hpp:41
armnn_driver::DriverOptions::GetFp16Enabled
bool GetFp16Enabled() const
Definition: DriverOptions.hpp:37
armnn_driver::DriverOptions::IsFastMathEnabled
bool IsFastMathEnabled() const
Definition: DriverOptions.hpp:36
armnn::IGpuAccTunedParameters::TuningLevel
TuningLevel
Definition: IRuntime.hpp:329
armnn_driver::DriverOptions::getNoOfArmnnThreads
unsigned int getNoOfArmnnThreads() const
Definition: DriverOptions.hpp:45
armnn_driver::DriverOptions::GetClTunedParametersFile
const std::string & GetClTunedParametersFile() const
Definition: DriverOptions.hpp:31
armnn_driver::DriverOptions
Definition: DriverOptions.hpp:17
armnn_driver::DriverOptions::SetBackends
void SetBackends(const std::vector< armnn::BackendId > &backends)
Definition: DriverOptions.hpp:38
armnn_driver::DriverOptions::IsGpuProfilingEnabled
bool IsGpuProfilingEnabled() const
Definition: DriverOptions.hpp:35
armnn_driver::DriverOptions::IsVerboseLoggingEnabled
bool IsVerboseLoggingEnabled() const
Definition: DriverOptions.hpp:27
armnn_driver::DriverOptions::GetRequestInputsAndOutputsDumpDir
const std::string & GetRequestInputsAndOutputsDumpDir() const
Definition: DriverOptions.hpp:28
armnn_driver::DriverOptions::ShouldExit
bool ShouldExit() const
Definition: DriverOptions.hpp:39
armnn_driver::DriverOptions::GetServiceName
const std::string & GetServiceName() const
Definition: DriverOptions.hpp:29