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(
25 : RankId myRank, u32 rankSize, DevType devType, u64 scratchBufferSize, ConnectedLinkMgr* linkMgr,
26 : RmtDataBufferMgr* rmaDataBufferMgr)
27 2 : : myRank_(myRank),
28 2 : rankSize_(rankSize),
29 2 : devType_(devType),
30 2 : scratchBufferSize_(scratchBufferSize),
31 2 : linkMgr_(linkMgr),
32 2 : rmaDataBufferMgr_(rmaDataBufferMgr)
33 2 : {}
34 2 : virtual ~OneSidedComponentLite() = default;
35 :
36 : virtual HcclResult Orchestrate(const HcclAicpuOpLite& op, InsQuePtr queue);
37 :
38 : protected:
39 : u32 myRank_ = INVALID_RANKID;
40 : u32 rankSize_ = 0;
41 : DevType devType_ = DevType::DEV_TYPE_NOSOC;
42 : u64 scratchBufferSize_ = 0;
43 : ConnectedLinkMgr* linkMgr_ = nullptr;
44 : RmtDataBufferMgr* rmaDataBufferMgr_{nullptr};
45 : };
46 :
47 : using OneSidedComponentLitePtr = std::shared_ptr<OneSidedComponentLite>;
48 : } // namespace Hccl
49 : #endif
|