* 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 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"
#include "topo_match_1d.h"
namespace ops_hccl {
class InsRecvExecutor : public InsCollAlgBase {
public:
std::string Describe() const 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;
HcclResult Orchestrate(const OpParam ¶m, const AlgResourceCtxSerializable &resCtx) override;
protected:
HcclResult InitRecvInfo(
const HcclComm comm, const OpParam ¶m, const TopoInfoWithNetLayerDetails *topoInfo,
const AlgHierarchyInfoForAllLevel &algHierarchyInfo);
HcclResult OrchestrateOffload(const OpParam ¶m, const AlgResourceCtxSerializable &resCtx, const ThreadHandle &thread, const ChannelInfo &channel);
HcclResult OrchestrateOpbase(const OpParam ¶m, const AlgResourceCtxSerializable &resCtx, const ThreadHandle &thread, const ChannelInfo &channel);
OpMode opMode_;
u32 remoteRank_;
u64 maxLoopTransSize_;
u64 maxLoopTransCount_;
bool isDmaRead_{false};
};
}
#endif