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_WRITE_H
8 : #define HCOMM_CCU_REPRESENTATION_WRITE_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 CcuRepWrite : public CcuRepBase {
17 : public:
18 : CcuRepWrite(CcuInsGeneratorBase* insGenPtr, const ChannelHandle channel, RemoteAddr rem, LocalAddr loc, Variable len, CompletedEvent sem, uint16_t mask);
19 : CcuRepWrite(CcuInsGeneratorBase* insGenPtr, const ChannelHandle channel, RemoteAddr rem, LocalAddr loc, Variable len, uint16_t dataType, uint16_t opType,
20 : CompletedEvent sem, uint16_t mask);
21 : bool Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep) override;
22 : std::string Describe() override;
23 :
24 1 : uint16_t GetLocAddrId() { return loc.addr.Id(); }
25 1 : uint16_t GetLocTokenId() { return loc.token.Id(); }
26 1 : uint16_t GetRemAddrId() { return rem.addr.Id(); }
27 1 : uint16_t GetRemTokenId() { return rem.token.Id(); }
28 1 : uint16_t GetLenId() { return len.Id(); }
29 1 : uint16_t GetSemId() { return sem.Id(); }
30 : uint32_t GetChannelId() { return channelId; }
31 4 : ChannelHandle GetChannel() { return channel; }
32 6 : LocalAddr GetLoc() { return loc; }
33 6 : RemoteAddr GetRem() { return rem; }
34 3 : Variable GetLen() { return len; }
35 3 : CompletedEvent GetSem() { return sem; }
36 5 : uint16_t GetMask() { return mask; }
37 3 : uint16_t GetDataType() { return dataType; }
38 3 : uint16_t GetOpType() { return opType; }
39 3 : uint16_t GetReduceFlag() { return reduceFlag; }
40 :
41 : private:
42 : CcuInsGeneratorBase* insGenPtr{nullptr};
43 : ChannelHandle channel;
44 : uint32_t channelId{0};
45 : RemoteAddr rem;
46 : LocalAddr loc;
47 : Variable len;
48 :
49 : CompletedEvent sem;
50 : uint16_t mask{0};
51 :
52 : uint16_t dataType{0};
53 : uint16_t opType{0};
54 : uint16_t reduceFlag{0};
55 : };
56 :
57 : }; // namespace CcuRep
58 : }; // namespace hcomm
59 : #endif // HCOMM_CCU_REPRESENTATION_WRITE_H
|