LCOV - code coverage report
Current view: top level - legacy/ascend950/unified_platform/common - dev_capability.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 18 18
Test Date: 2026-07-28 12:11:00 Functions: 100.0 % 9 9

            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              : 
      11              : #ifndef HCCLV2_DEV_CAPABILITY_H
      12              : #define HCCLV2_DEV_CAPABILITY_H
      13              : 
      14              : #include "dev_capability.h"
      15              : #include <map>
      16              : #include "dev_type.h"
      17              : #include "reduce_op.h"
      18              : #include "data_type.h"
      19              : 
      20              : namespace Hccl {
      21              : 
      22              : class DevCapability {
      23              : public:
      24              :     DevCapability(const DevCapability &that) = delete;
      25              : 
      26              :     DevCapability &operator=(const DevCapability &that) = delete;
      27              : 
      28              :     static DevCapability &GetInstance();
      29              : 
      30              :     void Init(DevType givenDevType);
      31              : 
      32              :     void Reset(); // LLT 使用
      33              : 
      34           17 :     const std::map<DataType, bool> &GetInlineReduceDataTypeMap() const
      35              :     {
      36           17 :         return inlineReduceDataTypeMap;
      37              :     }
      38              : 
      39           17 :     const std::map<ReduceOp, bool> &GetInlineReduceOpMap() const
      40              :     {
      41           17 :         return inlineReduceOpMap;
      42              :     }
      43              : 
      44            1 :     u32 GetSdmaInlineReduceAlignBytes() const
      45              :     {
      46            1 :         return sdmaInlineReduceAlignBytes;
      47              :     }
      48              : 
      49          123 :     u32 GetNotifySize() const
      50              :     {
      51          123 :         return notifySize;
      52              :     }
      53              : 
      54            1 :     u64 GetSdmaSendMaxSize() const
      55              :     {
      56            1 :         return sdmaSendMaxSize;
      57              :     }
      58              : 
      59            1 :     u64 GetRdmaSendMaxSize() const
      60              :     {
      61            1 :         return rdmaSendMaxSize;
      62              :     }
      63              : 
      64            7 :     bool IsSupportDevNetInlineReduce() const
      65              :     {
      66            7 :         return isSupportDevNetInlineReduce;
      67              :     }
      68              : 
      69            5 :     bool IsSupportWriteWithNotify() const
      70              :     {
      71            5 :         return isSupportWriteWithNotify;
      72              :     }
      73              : 
      74           11 :     bool IsSupportStarsPollNetCq() const
      75              :     {
      76           11 :         return isSupportStarsPollNetCq;
      77              :     }
      78              : 
      79              : private:
      80              :     DevCapability();
      81              : 
      82              :     void Load910ACap();
      83              :     void Load910A3Cap();
      84              :     void LoadV82Cap();
      85              : 
      86              :     void Load910A910A3CommonCap();
      87              : 
      88              :     DevType devType;
      89              :     bool    isInit{false};
      90              : 
      91              :     std::map<DataType, bool> inlineReduceDataTypeMap;
      92              :     std::map<ReduceOp, bool> inlineReduceOpMap;
      93              : 
      94              :     u32 sdmaInlineReduceAlignBytes{0};
      95              :     u32 notifySize{0};
      96              : 
      97              :     u64 sdmaSendMaxSize{0}; // 节点内单个SDMA任务发送数据支持的最大数据量
      98              :     u64 rdmaSendMaxSize{0}; // 节点间RDMA发送数据单个WQE支持的最大数据量
      99              : 
     100              :     bool isSupportDevNetInlineReduce{false};
     101              :     bool isSupportWriteWithNotify{false};
     102              :     bool isSupportStarsPollNetCq{false};
     103              : };
     104              : 
     105              : } // namespace Hccl
     106              : #endif
        

Generated by: LCOV version 2.0-1