* 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 SEND_RECEIVE_PUB_H
#define SEND_RECEIVE_PUB_H
#include "alg_template_base_pub.h"
namespace hccl {
class SendReceive : public AlgTemplateBase {
public:
explicit SendReceive(const HcclDispatcher dispatcher,
const std::shared_ptr<Transport>& link,
const u32 peerRank = INVALID_VALUE_RANKID,
const u64 chunkNum = HCCL_CHUNK_SIZE,
bool retryEnable = false);
~SendReceive() override;
HcclResult SendPrepare(const DeviceMem& inputMem,
const u32 destRank,
const Stream& stream);
HcclResult ReceivePrepare(const DeviceMem& outputMem,
const u32 srcRank,
const Stream& stream);
HcclResult SendRunAsync();
HcclResult ReceiveRunAsync();
HcclResult BatchSendRunAsync();
HcclResult BatchReceiveRunAsync();
protected:
private:
const std::shared_ptr<Transport>& transLink_;
u32 peerRank_;
const u64 chunkSize_;
bool retryEnable_;
};
}
#endif