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 : #ifndef HCOMM_CCU_REPRESENTATION_BUFREAD_H
12 : #define HCOMM_CCU_REPRESENTATION_BUFREAD_H
13 :
14 : #include "ccu_rep_base_v1.h"
15 : #include "ccu_datatype_v1.h"
16 :
17 : namespace hcomm {
18 : namespace CcuRep {
19 :
20 : class CcuRepBufRead : public CcuRepBase {
21 : public:
22 : CcuRepBufRead(
23 : CcuInsGeneratorBase* insGenPtr, const ChannelHandle channel, RemoteAddr src, CcuBuf dst, Variable len,
24 : CompletedEvent sem, uint32_t mask);
25 : bool Translate(CcuKernel* ccuKernel, CcuInstr*& instr, uint16_t& instrId, const TransDep& dep) override;
26 : std::string Describe() override;
27 :
28 1 : uint16_t GetSrcAddrId() { return src.addr.Id(); }
29 1 : uint16_t GetSrcTokenId() { return src.token.Id(); }
30 1 : uint16_t GetDstAddrId() { return dst.Id(); }
31 1 : uint16_t GetLenId() { return len.Id(); }
32 1 : uint16_t GetSemId() { return sem.Id(); }
33 : uint32_t GetChannelId() { return channelId; }
34 2 : RemoteAddr GetSrc() { return src; }
35 1 : CcuBuf GetDst() { return dst; }
36 1 : Variable GetLen() { return len; }
37 1 : CompletedEvent GetSem() { return sem; }
38 3 : uint32_t GetMask() { return mask; }
39 2 : ChannelHandle GetChannel() { return channel; }
40 :
41 : private:
42 : CcuInsGeneratorBase* insGenPtr{nullptr};
43 : ChannelHandle channel;
44 : uint32_t channelId{0};
45 :
46 : RemoteAddr src;
47 : CcuBuf dst;
48 : Variable len;
49 :
50 : CompletedEvent sem;
51 : uint32_t mask{0};
52 : };
53 :
54 : }; // namespace CcuRep
55 : }; // namespace hcomm
56 : #endif // HCOMM_CCU_REPRESENTATION_BUFREAD_H
|