LCOV - code coverage report
Current view: top level - base_comm/resources/ccu/ccu_representation/reps/data - ccu_rep_loccpy_v1.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 53.3 % 15 8
Test Date: 2026-08-04 10:52:23 Functions: 53.3 % 15 8

            Line data    Source code
       1              : /*
       2              :  * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved.
       3              :  * Description: ccu representation base header file
       4              :  * Create: 2025-02-18
       5              :  */
       6              : 
       7              : #ifndef HCOMM_CCU_REPRESENTATION_LOCCPY_H
       8              : #define HCOMM_CCU_REPRESENTATION_LOCCPY_H
       9              : 
      10              : #include "ccu_rep_base_v1.h"
      11              : #include "ccu_datatype_v1.h"
      12              : 
      13              : namespace hcomm {
      14              : namespace CcuRep {
      15              : 
      16              : class CcuRepLocCpy : public CcuRepBase {
      17              : public:
      18              :     CcuRepLocCpy(CcuInsGeneratorBase* insGenPtr, LocalAddr dst, LocalAddr src, Variable len, CompletedEvent sem, uint16_t mask);
      19              :     CcuRepLocCpy(CcuInsGeneratorBase* insGenPtr, LocalAddr dst, LocalAddr src, Variable len, uint16_t dataType, uint16_t opType, CompletedEvent sem,
      20              :                  uint16_t mask);
      21              : 
      22              :     // A6场景预埋
      23              :     CcuRepLocCpy(CcuInsGeneratorBase* insGenPtr, LocalAddr dst, LocalAddr src, Variable len,
      24              :                  const std::vector<CcuBuf> &bufs, CompletedEvent sem, uint16_t mask);
      25              : 
      26              :     bool        Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep) override;
      27              :     std::string Describe() override;
      28            0 :     uint16_t GetSrcAddrId() { return src.addr.Id(); }
      29            0 :     uint16_t GetSrcTokenId() { return src.token.Id(); }
      30            0 :     uint16_t GetDstAddrId() { return dst.addr.Id(); }
      31            0 :     uint16_t GetDstTokenId() { return dst.token.Id(); }
      32            0 :     uint16_t GetLenId() { return len.Id(); }
      33            0 :     uint16_t GetSemId() { return sem.Id(); }
      34            1 :     uint16_t GetDataType() { return dataType; }
      35            1 :     uint16_t GetOpType() { return opType; }
      36              :     const std::vector<CcuBuf>& GetBufs() { return bufs; }
      37              : 
      38            4 :     LocalAddr GetDst() { return dst; }
      39            4 :     LocalAddr GetSrc() { return src; }
      40            2 :     Variable GetLen() { return len; }
      41            2 :     CompletedEvent GetSem() { return sem; }
      42            3 :     uint16_t GetMask() { return mask; }
      43            3 :     uint16_t GetReduceFlag() { return reduceFlag; }
      44            0 :     bool GetUseCcuBuffer() { return useCcuBuffer; }
      45              : 
      46              :     uint16_t GetFirstBufId();
      47              :     uint16_t GetUsedBufNum();
      48              : private:
      49              :     void ValidateInsGeneratorForLocCpy();
      50              : 
      51              :     CcuInsGeneratorBase* insGenPtr{nullptr};
      52              :     LocalAddr   dst;
      53              :     LocalAddr   src;
      54              :     Variable len;
      55              : 
      56              :     // 用于A6场景locmem2locmem搬运
      57              :     std::vector<CcuBuf> bufs;
      58              : 
      59              :     CompletedEvent sem;
      60              :     uint16_t   mask{0};
      61              : 
      62              :     uint16_t dataType{0};
      63              :     uint16_t opType{0};
      64              :     uint16_t reduceFlag{0};
      65              : 
      66              :     bool useCcuBuffer = false;
      67              : };
      68              : 
      69              : };     // namespace CcuRep
      70              : };     // namespace hcomm
      71              : #endif // HCOMM_CCU_REPRESENTATION_LOCCPY_H
        

Generated by: LCOV version 2.0-1