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 : #ifndef HCCLV2_ONE_SIDED_COMPONENT_LITE
11 : #define HCCLV2_ONE_SIDED_COMPONENT_LITE
12 :
13 : #include "dev_type.h"
14 : #include "connected_link_mgr.h"
15 : #include "base_config.h"
16 : #include "coll_operator.h"
17 : #include "coll_alg_component.h"
18 : #include "rmt_data_buffer_mgr.h"
19 :
20 : namespace Hccl {
21 :
22 : class OneSidedComponentLite {
23 : public:
24 2 : OneSidedComponentLite(RankId myRank, u32 rankSize, DevType devType, u64 scratchBufferSize, ConnectedLinkMgr *linkMgr,
25 2 : RmtDataBufferMgr *rmaDataBufferMgr) : myRank_(myRank), rankSize_(rankSize), devType_(devType),
26 2 : scratchBufferSize_(scratchBufferSize), linkMgr_(linkMgr), rmaDataBufferMgr_(rmaDataBufferMgr)
27 : {
28 2 : }
29 2 : virtual ~OneSidedComponentLite() = default;
30 :
31 : virtual HcclResult Orchestrate(const HcclAicpuOpLite &op, InsQuePtr queue);
32 :
33 : protected:
34 : u32 myRank_ = INVALID_RANKID;
35 : u32 rankSize_ = 0;
36 : DevType devType_ = DevType::DEV_TYPE_NOSOC;
37 : u64 scratchBufferSize_ = 0;
38 : ConnectedLinkMgr *linkMgr_ = nullptr;
39 : RmtDataBufferMgr *rmaDataBufferMgr_{ nullptr };
40 : };
41 :
42 : using OneSidedComponentLitePtr = std::shared_ptr<OneSidedComponentLite>;
43 : } // namespace Hccl
44 : #endif
|