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_LOOP_CALL_H
8 : #define HCOMM_CCU_REPRESENTATION_LOOP_CALL_H
9 :
10 : #include "ccu_rep_base_v1.h"
11 : #include "ccu_rep_loopblock_v1.h"
12 :
13 : namespace hcomm {
14 : namespace CcuRep {
15 :
16 : class CcuRepLoopCall : public CcuRepBase {
17 : public:
18 : explicit CcuRepLoopCall(CcuInsGeneraterBase* insGeneratorPtr, const std::string &label);
19 : bool Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep) override;
20 : std::string Describe() override;
21 : uint16_t InstrCount() override;
22 : const std::string &GetLabel() const;
23 :
24 : void Reference(std::shared_ptr<CcuRepLoopBlock> refRep);
25 :
26 : void SetInArg(const Variable &var);
27 : void SetInArg(const std::vector<Variable> &varList);
28 : void SetInArg(const Memory &mem);
29 : void SetInArg(const std::vector<Memory> &memList);
30 :
31 : void SetInArg(const LocalAddr &addr);
32 : void SetInArg(const RemoteAddr &addr);
33 : void SetInArg(const std::vector<LocalAddr> &addrList);
34 : void SetInArg(const std::vector<RemoteAddr> &addrList);
35 :
36 0 : std::shared_ptr<CcuRepLoopBlock> GetLoopBlock() {return loopBlock;}
37 0 : std::vector<CcuRepArg>& GetInArgs() {return inArgs;}
38 : uint32_t GetInArgCount() {return inArgCount;}
39 :
40 : private:
41 : CcuInsGeneraterBase* insGeneratorPtr_;
42 : std::string label;
43 : std::shared_ptr<CcuRepLoopBlock> loopBlock{nullptr};
44 :
45 : std::vector<CcuRepArg> inArgs;
46 : uint32_t inArgCount{0};
47 : uint32_t inArgInstrCount{0}; // 处理LoopCall的入参需要的指令数
48 :
49 : CcuInstr *instr{nullptr};
50 : };
51 :
52 : }; // namespace CcuRep
53 : }; // namespace hcomm
54 : #endif // HCOMM_CCU_REPRESENTATION_LOOP_CALL_H
|