LCOV - code coverage report
Current view: top level - legacy/ascend950/unified_platform/resource/buffer - local_rdma_rma_buffer.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 7 7
Test Date: 2026-08-04 10:52:23 Functions: 100.0 % 4 4

            Line data    Source code
       1              : 
       2              : /**
       3              :  * Copyright (c) 2025 Huawei Technologies Co., Ltd.
       4              :  * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
       5              :  * CANN Open Software License Agreement Version 2.0 (the "License").
       6              :  * Please refer to the License for details. You may not use this file except in compliance with the License.
       7              :  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
       8              :  * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
       9              :  * See LICENSE in the root of the software repository for the full text of the License.
      10              :  */
      11              : 
      12              : #ifndef HCCLV2_LOCAL_RDMA_RMA_BUFFER_H
      13              : #define HCCLV2_LOCAL_RDMA_RMA_BUFFER_H
      14              : 
      15              : #include "local_rma_buffer.h"
      16              : #include "orion_adapter_hccp.h"
      17              : 
      18              : namespace Hccl {
      19              : 
      20              : class LocalRdmaRmaBuffer : public LocalRmaBuffer {
      21              : public:
      22              :     LocalRdmaRmaBuffer(std::shared_ptr<Buffer> buf, RdmaHandle rdmaHandle);
      23              : 
      24              :     // 别名构造函数:共享父buffer的RDMA注册资源,不调用RaRegisterMr
      25              :     LocalRdmaRmaBuffer(std::shared_ptr<Buffer> buf, RdmaHandle rdmaHandle, u32 lkey, u32 rkey, MrHandle mrHandle);
      26              : 
      27              :     ~LocalRdmaRmaBuffer() override;
      28              : 
      29              :     LocalRdmaRmaBuffer(const LocalRdmaRmaBuffer &that) = delete;
      30              : 
      31              :     LocalRdmaRmaBuffer &operator=(const LocalRdmaRmaBuffer &that) = delete;
      32              : 
      33              :     std::string Describe() const override;
      34              : 
      35              :     std::unique_ptr<Serializable> GetExchangeDto() override;
      36              : 
      37           40 :     u32 GetLkey() const
      38              :     {
      39           40 :         return lkey;
      40              :     }
      41            9 :     u32 GetRkey() const
      42              :     {
      43            9 :         return rkey;
      44              :     }
      45            9 :     MrHandle GetMrHandle() const
      46              :     {
      47            9 :         return mrHandle;
      48              :     }
      49           29 :     std::pair<uintptr_t, u64> GetBufferInfo() {return make_pair(buf->GetAddr(), buf->GetSize());}
      50              : 
      51              :     std::vector<char> Desc;
      52              :     
      53              : private:
      54              :     RdmaHandle rdmaHandle;
      55              :     u8         key[RDMA_MEM_KEY_MAX_LEN]{0};
      56              :     u32        lkey{0};
      57              :     u32        rkey{0};
      58              :     MrHandle   mrHandle{nullptr};
      59              : };
      60              : 
      61              : } // namespace Hccl
      62              : #endif // HCCLV2_LOCAL_RDMA_RMA_BUFFER_H
        

Generated by: LCOV version 2.0-1