LCOV - code coverage report
Current view: top level - legacy/ascend950/framework/env_config - env_config.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 32 32
Test Date: 2026-08-04 10:52:23 Functions: 100.0 % 11 11

            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         1366 : EnvConfig &EnvConfig::GetInstance()
      20              : {
      21         1366 :     static EnvConfig envConfig;
      22         1366 :     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          103 : const EnvHostNicConfig &EnvConfig::GetHostNicConfig()
      38              : {
      39          103 :     return hostNicCfg;
      40              : }
      41              : 
      42           70 : const EnvSocketConfig &EnvConfig::GetSocketConfig()
      43              : {
      44           70 :     return socketCfg;
      45              : }
      46              : 
      47          190 : const EnvRtsConfig &EnvConfig::GetRtsConfig()
      48              : {
      49          190 :     return rtsCfg;
      50              : }
      51              : 
      52          218 : const EnvRdmaConfig &EnvConfig::GetRdmaConfig()
      53              : {
      54          218 :     return rdmaCfg;
      55              : }
      56              : 
      57           34 : const EnvAlgoConfig &EnvConfig::GetAlgoConfig()
      58              : {
      59           34 :     return algoCfg;
      60              : }
      61              : 
      62          306 : const EnvLogConfig &EnvConfig::GetLogConfig()
      63              : {
      64          306 :     return logCfg;
      65              : }
      66              : 
      67          245 : const EnvDetourConfig &EnvConfig::GetDetourConfig()
      68              : {
      69          245 :     return detourCfg;
      70              : }
      71              : 
      72          109 : const EnvPlfDebugConfig &EnvConfig::GetPlfDebugConfig()
      73              : {
      74          109 :     return plfDebugCfg;
      75              : }
      76              : 
      77              : } // namespace Hccl
        

Generated by: LCOV version 2.0-1