1 // 2 // Copyright © 2017 Arm Ltd. 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 17 class DriverOptions 18 { 19 public: 20 DriverOptions(armnn::Compute computeDevice, bool fp16Enabled = false); 21 DriverOptions(const std::vector<armnn::BackendId>& backends, bool fp16Enabled); 22 DriverOptions(int argc, char** argv); 23 DriverOptions(DriverOptions&& other) = default; 24 GetBackends() const25 const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; } IsVerboseLoggingEnabled() const26 bool IsVerboseLoggingEnabled() const { return m_VerboseLogging; } GetRequestInputsAndOutputsDumpDir() const27 const std::string& GetRequestInputsAndOutputsDumpDir() const { return m_RequestInputsAndOutputsDumpDir; } GetServiceName() const28 const std::string& GetServiceName() const { return m_ServiceName; } GetForcedUnsupportedOperations() const29 const std::set<unsigned int>& GetForcedUnsupportedOperations() const { return m_ForcedUnsupportedOperations; } GetClTunedParametersFile() const30 const std::string& GetClTunedParametersFile() const { return m_ClTunedParametersFile; } GetClTunedParametersMode() const31 armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const { return m_ClTunedParametersMode; } GetClTuningLevel() const32 armnn::IGpuAccTunedParameters::TuningLevel GetClTuningLevel() const { return m_ClTuningLevel; } IsGpuProfilingEnabled() const33 bool IsGpuProfilingEnabled() const { return m_EnableGpuProfiling; } IsFastMathEnabled() const34 bool IsFastMathEnabled() const { return m_FastMathEnabled; } GetFp16Enabled() const35 bool GetFp16Enabled() const { return m_fp16Enabled; } SetBackends(const std::vector<armnn::BackendId> & backends)36 void SetBackends(const std::vector<armnn::BackendId>& backends) { m_Backends = backends; } ShouldExit() const37 bool ShouldExit() const { return m_ShouldExit; } GetExitCode() const38 int GetExitCode() const { return m_ExitCode; } 39 40 private: 41 std::vector<armnn::BackendId> m_Backends; 42 bool m_VerboseLogging; 43 std::string m_RequestInputsAndOutputsDumpDir; 44 std::string m_ServiceName; 45 std::set<unsigned int> m_ForcedUnsupportedOperations; 46 std::string m_ClTunedParametersFile; 47 armnn::IGpuAccTunedParameters::Mode m_ClTunedParametersMode; 48 armnn::IGpuAccTunedParameters::TuningLevel m_ClTuningLevel; 49 bool m_EnableGpuProfiling; 50 bool m_fp16Enabled; 51 bool m_FastMathEnabled; 52 bool m_ShouldExit; 53 int m_ExitCode; 54 }; 55 56 } // namespace armnn_driver 57