aboutsummaryrefslogtreecommitdiff
path: root/DriverOptions.hpp
blob: f3b441cad25f3df09bd554a3351c93a65437f132 (plain)
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
//
// 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; }
    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; }

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;
    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;
};

} // namespace armnn_driver