LCOV - code coverage report
Current view: top level - legacy/ascend950/service/collective/alg/coll_alg_factory/alg_ccu_context/all_reduce - ccu_context_all_reduce_mesh2d_one_shot.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) 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_CCU_CONTEXT_ALL_REDUCE_MESH_2D_ONE_SHOT_H_
      12              : #define HCCLV2_CCU_CONTEXT_ALL_REDUCE_MESH_2D_ONE_SHOT_H_
      13              : 
      14              : #include <vector>
      15              : #include <ios>
      16              : #include "log.h"
      17              : #include "ccu_context_alg_base.h"
      18              : #include "ccu_datatype.h"
      19              : 
      20              : namespace Hccl {
      21              : 
      22              : class CcuContextAllReduceMesh2DOneShot : public CcuContextAlgBase {
      23              : public:
      24              :     CcuContextAllReduceMesh2DOneShot(const CcuCtxArg &arg, const std::vector<CcuTransport*> &transports,
      25              :                               const CcuTransportGroup &group);
      26            0 :     ~CcuContextAllReduceMesh2DOneShot() override {}
      27              : 
      28              :     void Algorithm() override;
      29              :     std::vector<uint64_t> GeneArgs(const CcuTaskArg &arg) override;
      30              : private:
      31              :     void InitVariables();
      32              :     void LoadArgs();
      33              :     void DoAxisSync(uint32_t signalIdx);
      34              :     void DoGroupSync(int ckeIdx, uint16_t selfBit, uint16_t allBit);
      35              :     void DoGroupReduce(std::vector<CcuRep::Variable> &srcBase, CcuRep::Variable &dstBase,
      36              :         CcuRep::Variable &offset, GroupOpSize &goSize);
      37              :     std::vector<uint64_t> dimSize_;
      38              :     std::vector<uint64_t> myRankIdxInAxis_;
      39              :     uint64_t myRankIdxInCurrentAxis_{0};
      40              :     uint64_t currentAxisRankSize_{0};
      41              : 
      42              :     uint32_t axisId_{0};
      43              :     DataType dataType_;
      44              :     DataType outputDataType_;
      45              : 
      46              :     std::vector<CcuRep::Variable> inputAddr_;
      47              :     std::vector<CcuRep::Variable> outputAddr_;
      48              :     std::vector<CcuRep::Variable> scratchAddr_;
      49              :     std::vector<CcuRep::Variable> token_;
      50              :     CcuRep::Variable xSliceOffset_;
      51              :     CcuRep::Variable ySliceOffset_;
      52              :     GroupOpSize xGoSize_;
      53              :     GroupOpSize yGoSize_;
      54              : 
      55              :     std::string currAxisSignalName_;
      56              :     std::string otherAxisSignalName_;
      57              :     CcuRep::MaskSignal currAxisSignal_;
      58              :     CcuRep::MaskSignal otherAxisSignal_;
      59              : };
      60              : } // namespace Hccl
      61              : 
      62              : #endif // HCCLV2_CCU_CONTEXT_ALL_REDUCE_MESH_2D_ONE_SHOT_H_
        

Generated by: LCOV version 2.0-1