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_RMA_BUFFER_SLICE_LITE_H
11 : #define HCCLV2_RMA_BUFFER_SLICE_LITE_H
12 :
13 : #include <string>
14 : #include "hccl/base.h"
15 :
16 : namespace Hccl {
17 : class RmaBufSliceLite {
18 : public:
19 : RmaBufSliceLite(u64 addr, u64 size, u32 lkey, u32 tokenId);
20 :
21 206 : inline u64 GetAddr() const
22 : {
23 206 : return addr_;
24 : }
25 :
26 172 : inline u64 GetSize() const
27 : {
28 172 : return size_;
29 : }
30 :
31 38 : inline u32 GetLkey() const
32 : {
33 38 : return lkey_;
34 : }
35 :
36 86 : inline u32 GetTokenId() const
37 : {
38 86 : return tokenId_;
39 : }
40 :
41 : std::string Describe() const;
42 :
43 : private:
44 : u64 addr_;
45 : u64 size_;
46 : u32 lkey_;
47 : u32 tokenId_;
48 : };
49 : } // namespace Hccl
50 : #endif
|