LCOV - code coverage report
Current view: top level - base_comm/resources/endpoint_pairs/channels/aiv - aiv_urma_channel.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 1 0
Test Date: 2026-08-04 10:52:23 Functions: 0.0 % 1 0

            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              : #ifndef AIV_URMA_CHANNEL_H
      11              : #define AIV_URMA_CHANNEL_H
      12              : 
      13              : #include "../channel.h"
      14              : 
      15              : // Orion
      16              : #include "aiv_urma_transport.h"
      17              : #include "buffer_key.h"
      18              : #include "resource/notify/ub_local_notify.h"
      19              : #include "resource/socket/socket.h"
      20              : #include "socket_mgr.h"
      21              : 
      22              : namespace hcomm {
      23              : 
      24              : class AivUrmaChannel : public Channel {
      25              : public:
      26              :     AivUrmaChannel(EndpointHandle endpointHandle, const HcommChannelDesc &channelDesc);
      27              :     ~AivUrmaChannel() override;
      28              : 
      29              :     HcclResult Init() override;
      30              :     ChannelStatus GetStatus() override;
      31              : 
      32              :     HcclResult Clean() override;
      33              :     HcclResult Resume() override;
      34              :     virtual HcclResult GetNotifyNum(uint32_t *notifyNum) const override;
      35              :     HcclResult GetRemoteMems(uint32_t *memNum, CommMem **remoteMem, char ***memInfos) override;
      36            0 :     const HcommChannelDesc& GetChannelDesc() const override { return channelDesc_; }
      37              :     HcclResult BuildChannelEntityToDevice(void **devChannelPtr);
      38              :     HcclResult PreAllocChannelEntityToDevice(void **devChannelPtr);
      39              :     HcclResult FillChannelEntityToDevice();
      40              : 
      41              :     HcclResult NotifyRecord(const uint32_t remoteNotifyIdx) override;
      42              :     HcclResult NotifyWait(const uint32_t localNotifyIdx, const uint32_t timeout) override;
      43              :     HcclResult WriteWithNotify(void *dst, const void *src, const uint64_t len, uint32_t remoteNotifyIdx) override;
      44              :     HcclResult Write(void *dst, const void *src, uint64_t len) override;
      45              :     HcclResult Read(void *dst, const void *src, uint64_t len) override;
      46              :     HcclResult ChannelFence() override;
      47              : 
      48              : private:
      49              :     HcclResult ParseInputParam();
      50              :     HcclResult StartListen();
      51              :     HcclResult BuildSocket();
      52              :     HcclResult BuildAttr();
      53              :     HcclResult BuildConnection();
      54              :     HcclResult BuildAivUrmaTransport();
      55              :     void PutSocketIfNeeded();
      56              :     void ReleaseDeviceChannelEntity();
      57              : 
      58              :     // --------------------- 转换参数 ---------------------
      59              :     EndpointDesc localEp_{};
      60              :     EndpointDesc remoteEp_{};
      61              :     uint32_t notifyNum_{0};
      62              : 
      63              :     // --------------------- 入参 ---------------------
      64              :     EndpointHandle endpointHandle_;
      65              :     CommEngine engine_{COMM_ENGINE_RESERVED};
      66              :     HcommChannelDesc channelDesc_;
      67              : 
      68              :     // --------------------- 具体成员 ---------------------
      69              :     Hccl::Socket *socket_{nullptr};
      70              :     std::unique_ptr<Hccl::AivUrmaTransport> transport_{nullptr};
      71              :     Hccl::BaseMemTransport::Attribution attr_{};
      72              :     Hccl::BaseMemTransport::CommonLocRes commonRes_{};
      73              :     std::vector<std::unique_ptr<Hccl::DevUbConnection>> connections_{};
      74              :     RdmaHandle rdmaHandle_{nullptr};
      75              :     void *devChannelEntity_{nullptr};
      76              :     void *devChannelEntitySlab_{nullptr};
      77              :     size_t devChannelEntitySlabSize_{0};
      78              :     std::vector<hccl::DeviceMem> deviceMemories_{};
      79              :     std::unique_ptr<Hccl::SocketConfig> socketConfigHolder_{nullptr};
      80              :     const Hccl::SocketConfig* socketConfig_{nullptr};
      81              :     uint32_t devicePhyId_{};
      82              : };
      83              : 
      84              : } // namespace hcomm
      85              : 
      86              : #endif // AIV_URMA_CHANNEL_H
        

Generated by: LCOV version 2.0-1