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 : #ifndef HCCLV2_RMT_RMA_BUF_SLICE_LITE_H
11 : #define HCCLV2_RMT_RMA_BUF_SLICE_LITE_H
12 : #include "hccl/base.h"
13 :
14 : namespace Hccl {
15 : class RmtRmaBufSliceLite {
16 : public:
17 : RmtRmaBufSliceLite(u64 addr, u64 size, u32 rkey, u32 tokenId, u32 tokenValue, u32 notifyId);
18 :
19 248 : inline u64 GetAddr() const
20 : {
21 248 : return addr_;
22 : }
23 :
24 2 : inline u64 GetSize() const
25 : {
26 2 : return size_;
27 : }
28 :
29 25 : inline u32 GetRkey() const
30 : {
31 25 : return rkey_;
32 : }
33 :
34 105 : inline u32 GetTokenId() const
35 : {
36 105 : return tokenId_;
37 : }
38 :
39 119 : inline u32 GetTokenValue() const
40 : {
41 119 : return tokenValue_;
42 : }
43 :
44 5 : inline u32 GetNotifyId() const
45 : {
46 5 : return notifyId_;
47 : }
48 :
49 : std::string Describe() const;
50 :
51 : private:
52 : u64 addr_;
53 : u64 size_;
54 : u32 rkey_;
55 : u32 tokenId_;
56 : u32 tokenValue_;
57 : u32 notifyId_{UINT32_MAX};
58 : };
59 : } // namespace Hccl
60 : #endif
|