LCOV - code coverage report
Current view: top level - legacy/ascend950/service/collective/alg/coll_alg_factory/alg_ccu_context/reduce_scatter - ccu_context_reduce_scatter_mesh1d_2die.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 1 0
Test Date: 2026-07-28 12:11:00 Functions: 0.0 % 2 0

            Line data    Source code
       1              : /**
       2              :  * Copyright (c) 2026 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              : 
      12              : #ifndef HCCLV2_CCU_CONTEXT_REDUCE_SCATTER_MESH_1D_2Die_H_
      13              : #define HCCLV2_CCU_CONTEXT_REDUCE_SCATTER_MESH_1D_2Die_H_
      14              : 
      15              : #include <vector>
      16              : #include <ios>
      17              : #include "log.h"
      18              : #include "ccu_context_alg_base.h"
      19              : #include "ccu_datatype.h"
      20              : 
      21              : namespace Hccl {
      22              : 
      23              : class CcuContextReduceScatterMesh1D2Die : public CcuContextAlgBase {
      24              : public:
      25              :     CcuContextReduceScatterMesh1D2Die(const CcuCtxArg &arg, const std::vector<CcuTransport*> &transports,
      26              :                               const CcuTransportGroup &group);
      27            0 :     ~CcuContextReduceScatterMesh1D2Die() override {}
      28              : 
      29              :     void Algorithm() override;
      30              :     std::vector<uint64_t> GeneArgs(const CcuTaskArg &arg) override;
      31              : private:
      32              :     void InitResources();
      33              :     void LoadArgs();
      34              :     void PreSync();
      35              :     void PostSync(uint32_t signalIndex);
      36              :     void MissionSync(uint32_t signalIndex);
      37              :     void RmtReduce();
      38              :     std::string GetLoopBlockTag(std::string loopType, int32_t index) const;
      39              :     void CreateReduceLoop(uint32_t size, DataType dataType, DataType outputDataType,
      40              :         ReduceOp opType);
      41              :     void ReduceLoopGroup(CcuRep::Memory &outDstOrg, std::vector<CcuRep::Memory> &srcOrg,
      42              :         GroupOpSize goSize, DataType dataType, DataType outputDataType,
      43              :         ReduceOp opType);
      44              :     void DoLocalReduce();
      45              : 
      46              : private:
      47              :     bool rmtReduceWithMyRank_{true};
      48              : 
      49              :     uint32_t myRankId_{0};
      50              : 
      51              :     uint32_t rmtReduceRankNum_{0};
      52              :     uint32_t rmtSyncMyBit_{0};
      53              :     uint32_t rmtSyncWaitBit_{0};
      54              : 
      55              :     DataType dataType_;
      56              :     DataType outputDataType_;
      57              : 
      58              :     std::string ctxName_ = "";;
      59              : 
      60              :     uint32_t missionSyncMybit_{0};
      61              :     uint32_t missionSyncWaitBit_{0};
      62              : 
      63              :     std::string myMissionSignalName_ = "";
      64              :     std::string otherMissionSignalName_ = "";
      65              : 
      66              :     CcuRep::Variable myInput_;
      67              :     CcuRep::Variable myOutput_;
      68              :     CcuRep::Variable myScratch_;
      69              :     CcuRep::Variable myToken_;
      70              :     std::vector<CcuRep::Variable> peerInput_;
      71              :     std::vector<CcuRep::Variable> peerToken_;
      72              : 
      73              :     CcuRep::Variable sliceSize_;
      74              : 
      75              :     CcuRep::Variable rmtReduceSliceOffset_;
      76              : 
      77              :     GroupOpSize rmtReduceGoSize_;
      78              : 
      79              :     CcuRep::MaskSignal myMissionSignal_;
      80              :     CcuRep::MaskSignal otherMissionSignal_;
      81              : };
      82              : } // namespace Hccl
      83              : 
      84              : #endif // HCCLV2_CCU_CONTEXT_REDUCE_SCATTER_MESH_1D_2Die_H_
        

Generated by: LCOV version 2.0-1