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