* Copyright (c) 2025 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
#ifndef REMOTE_ACCESS_H
#define REMOTE_ACCESS_H
#include <memory>
#include <vector>
#include "hccl/base.h"
#include "hccl_common.h"
namespace hccl {
class RemoteAccessImpl;
using RmaRankTable = struct tagRmaRankTable {
u32 serverNum { 0 };
u32 rankNum { 0 };
s32 devicePhyId { 0 };
std::vector<std::vector<HcclIpAddress>> deviceIps;
};
class RemoteAccess {
public:
explicit RemoteAccess();
virtual ~RemoteAccess();
HcclResult Init(u32 rank, const std::vector<MemRegisterAddr>& addrInfos, const RmaRankTable &rankTable);
HcclResult RemoteRead(const std::vector<HcomRemoteAccessAddrInfo>& addrInfos, HcclRtStream stream);
HcclResult RemoteWrite(const std::vector<HcomRemoteAccessAddrInfo>& addrInfos, HcclRtStream stream);
private:
std::unique_ptr<RemoteAccessImpl> impl_;
};
}
#endif