* Copyright (c) 2026 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 HCCL_INS_RECV_EXECUTOR_H
#define HCCL_INS_RECV_EXECUTOR_H
#include "alg_param.h"
#include "topo_host.h"
#include "alg_v2_template_base.h"
#include "executor_v2_base.h"
#include "coll_alg_v2_exec_registry.h"
namespace ops_hccl {
template <typename InsAlgTemplate>
class InsRecvDpuExecutor : public InsCollAlgBase {
public:
std::string Describe() const override;
HcclResult Orchestrate(const OpParam ¶m, const AlgResourceCtxSerializable &resCtx) override;
HcclResult CalcAlgHierarchyInfo(HcclComm comm, TopoInfoWithNetLayerDetails *topoInfo,
AlgHierarchyInfoForAllLevel &algHierarchyInfo) override;
HcclResult CalcRes(
HcclComm comm, const OpParam ¶m, const TopoInfoWithNetLayerDetails *topoInfo,
const AlgHierarchyInfoForAllLevel &algHierarchyInfo, AlgResourceRequest &resourceRequest) override;
protected:
HcclResult InitCommInfo(
HcclComm comm, const OpParam ¶m, const TopoInfoWithNetLayerDetails *topoInfo,
const AlgHierarchyInfoForAllLevel &algHierarchyInfo);
OpMode opMode_;
u32 remoteRank_;
u32 myRank_;
std::vector<ThreadHandle> threads_;
u64 maxLoopTransSize_;
u64 maxLoopTransCount_;
AlgHierarchyInfoForAllLevel algHierarchyInfo_;
std::vector<std::map<u32, std::vector<ChannelInfo>>> remoteRankToChannelInfo_;
};
}
#endif