Line data Source code
1 : /**
2 : * Copyright (c) 2025 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 : #include "send_operator.h"
12 :
13 : namespace hccl {
14 0 : SendOperator::SendOperator(
15 : AlgConfigurator* algConfigurator, CCLBufferManager& cclBufferManager, HcclDispatcher dispatcher,
16 0 : std::unique_ptr<TopoMatcher>& topoMatcher)
17 0 : : CollAlgOperator(algConfigurator, cclBufferManager, dispatcher, topoMatcher, HcclCMDType::HCCL_CMD_SEND)
18 0 : {}
19 :
20 0 : SendOperator::~SendOperator() {}
21 :
22 : HcclResult
23 0 : SendOperator::SelectAlg(const std::string& tag, const OpParam& param, std::string& algName, std::string& newTag)
24 : {
25 0 : algName = "SendExecutor";
26 0 : if (GetWorkflowMode() != HcclWorkflowMode::HCCL_WORKFLOW_MODE_OP_BASE) {
27 0 : newTag = tag;
28 : } else {
29 0 : newTag = tag + algName;
30 : }
31 0 : newTag += (param.aicpuUnfoldMode ? "_device" : "_host");
32 0 : HCCL_INFO("[SelectAlg] Send newTag is [%s]", newTag.c_str());
33 0 : return HCCL_SUCCESS;
34 : }
35 :
36 : REGISTER_OP(HcclCMDType::HCCL_CMD_SEND, Send, SendOperator);
37 : } // namespace hccl
|