LCOV - code coverage report
Current view: top level - legacy/ascend950/unified_platform/resource/buffer/aicpu - rmt_rma_buffer_lite.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 15 15
Test Date: 2026-07-28 12:11:00 Functions: 100.0 % 5 5

            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              : #include "rmt_rma_buffer_lite.h"
      11              : #include "string_util.h"
      12              : #include "log.h"
      13              : namespace Hccl {
      14            1 : RmtRmaBufferLite::RmtRmaBufferLite(u64 addr, u64 size) : type_(RmaType::IPC), addr_(addr), size_(size)
      15              : {
      16            3 :     HCCL_INFO("RmtRmaBufferLite::RmtRmaBufferLite:%s", Describe().c_str());
      17            1 : }
      18              : 
      19           82 : RmtRmaBufferLite::RmtRmaBufferLite(u64 addr, u64 size, u32 rkey)
      20           82 :     : type_(RmaType::RDMA), addr_(addr), size_(size), rkey_(rkey)
      21              : {
      22          246 :     HCCL_INFO("RmtRmaBufferLite::RmtRmaBufferLite:%s", Describe().c_str());
      23           82 : }
      24              : 
      25            1 : RmtRmaBufferLite::RmtRmaBufferLite(u64 addr, u64 size, u32 tokenId, u32 tokenValue)
      26            1 :     : type_(RmaType::UB), addr_(addr), size_(size), tokenId_(tokenId), tokenValue_(tokenValue)
      27              : {
      28            3 :     HCCL_INFO("RmtRmaBufferLite::RmtRmaBufferLite:%s", Describe().c_str());
      29            1 : }
      30              : 
      31            1 : RmtRmaBufSliceLite RmtRmaBufferLite::GetRmtRmaBufSliceLite(u64 offset, u64 sliceSize) const
      32              : {
      33            1 :     return RmtRmaBufSliceLite(addr_ + offset, sliceSize, rkey_, tokenId_, tokenValue_, UINT32_MAX);
      34              : }
      35              : 
      36          169 : std::string RmtRmaBufferLite::Describe() const
      37              : {
      38              :     return StringFormat("RmtRmaBufferLite[type=%s, addr=0x%llx, size=0x%x, rkey=%u]",
      39          169 :                         type_.Describe().c_str(), addr_, size_, rkey_);
      40              : }
      41              : } // namespace Hccl
        

Generated by: LCOV version 2.0-1