LCOV - code coverage report
Current view: top level - base_comm/resources/endpoint_pairs/channels - makebufs_helper.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 10 10
Test Date: 2026-08-18 17:47:01 Functions: 100.0 % 1 1

            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 CHANNEL_MAKEBUFS_HELPER_H
      12              : #define CHANNEL_MAKEBUFS_HELPER_H
      13              : 
      14              : #include "buffer.h"
      15              : #include "local_rma_buffer.h"
      16              : #include "log.h"
      17              : #include "hcomm_c_adpt.h"
      18              : 
      19              : namespace hcomm {
      20              : 
      21           19 : inline HcclResult MakeRmaBufferVecFromMemHandles(
      22              :     HcommMemHandle* memHandles, uint32_t memHandleNum, std::vector<Hccl::LocalRmaBuffer*>& bufferVec,
      23              :     const char* channelName)
      24              : {
      25           19 :     bufferVec.clear();
      26           30 :     for (uint32_t i = 0; i < memHandleNum; ++i) {
      27           15 :         auto localRmaBuffer = reinterpret_cast<Hccl::LocalRmaBuffer*>(memHandles[i]);
      28           16 :         CHK_PTR_NULL(localRmaBuffer);
      29           12 :         auto buf = localRmaBuffer->GetBuf();
      30           12 :         CHK_PTR_NULL(buf);
      31           11 :         HCCL_INFO(
      32              :             "[%s][%s] addr[0x%llx], size[0x%llx], memType[%d], memInfo[%s]", channelName, __func__,
      33              :             static_cast<unsigned long long>(localRmaBuffer->GetAddr()),
      34              :             static_cast<unsigned long long>(localRmaBuffer->GetSize()), static_cast<int>(buf->GetMemType()),
      35              :             buf->GetMemInfo().c_str());
      36           11 :         bufferVec.push_back(localRmaBuffer);
      37              :     }
      38           15 :     return HCCL_SUCCESS;
      39              : }
      40              : 
      41              : } // namespace hcomm
      42              : 
      43              : #endif // CHANNEL_MAKEBUFS_HELPER_H
        

Generated by: LCOV version 2.0-1