Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 : #include "env_config.h"
11 :
12 : namespace Hccl {
13 :
14 8 : EnvConfig::EnvConfig()
15 : {
16 8 : Parse();
17 8 : }
18 :
19 1239 : EnvConfig &EnvConfig::GetInstance()
20 : {
21 1239 : static EnvConfig envConfig;
22 1239 : return envConfig;
23 : }
24 :
25 15 : void EnvConfig::Parse()
26 : {
27 15 : hostNicCfg.Parse();
28 15 : socketCfg.Parse();
29 15 : rtsCfg.Parse();
30 15 : rdmaCfg.Parse();
31 15 : algoCfg.Parse();
32 15 : logCfg.Parse();
33 15 : detourCfg.Parse();
34 15 : plfDebugCfg.Parse();
35 15 : }
36 :
37 100 : const EnvHostNicConfig &EnvConfig::GetHostNicConfig()
38 : {
39 100 : return hostNicCfg;
40 : }
41 :
42 70 : const EnvSocketConfig &EnvConfig::GetSocketConfig()
43 : {
44 70 : return socketCfg;
45 : }
46 :
47 184 : const EnvRtsConfig &EnvConfig::GetRtsConfig()
48 : {
49 184 : return rtsCfg;
50 : }
51 :
52 112 : const EnvRdmaConfig &EnvConfig::GetRdmaConfig()
53 : {
54 112 : return rdmaCfg;
55 : }
56 :
57 34 : const EnvAlgoConfig &EnvConfig::GetAlgoConfig()
58 : {
59 34 : return algoCfg;
60 : }
61 :
62 300 : const EnvLogConfig &EnvConfig::GetLogConfig()
63 : {
64 300 : return logCfg;
65 : }
66 :
67 245 : const EnvDetourConfig &EnvConfig::GetDetourConfig()
68 : {
69 245 : return detourCfg;
70 : }
71 :
72 108 : const EnvPlfDebugConfig &EnvConfig::GetPlfDebugConfig()
73 : {
74 108 : return plfDebugCfg;
75 : }
76 :
77 : } // namespace Hccl
|