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 "notify_pool.h"
12 : #include "notify_pool_impl.h"
13 :
14 : namespace hccl {
15 544 : NotifyPool::NotifyPool()
16 : {
17 544 : }
18 :
19 544 : NotifyPool::~NotifyPool()
20 : {
21 544 : pimpl_ = nullptr;
22 544 : }
23 :
24 :
25 524 : HcclResult NotifyPool::Init(const s32 devicePhyId)
26 : {
27 524 : pimpl_.reset((new (std::nothrow) NotifyPoolImpl(devicePhyId)));
28 524 : CHK_SMART_PTR_NULL(pimpl_);
29 524 : return pimpl_->Init();
30 : }
31 :
32 0 : HcclResult NotifyPool::Destroy()
33 : {
34 0 : CHK_SMART_PTR_NULL(pimpl_);
35 0 : return pimpl_->Destroy();
36 : }
37 :
38 56 : HcclResult NotifyPool::RegisterOp(const std::string &tag)
39 : {
40 56 : CHK_SMART_PTR_NULL(pimpl_);
41 56 : return pimpl_->RegisterOp(tag);
42 : }
43 :
44 1 : HcclResult NotifyPool::UnregisterOp(const std::string &tag)
45 : {
46 1 : CHK_SMART_PTR_NULL(pimpl_);
47 1 : return pimpl_->UnregisterOp(tag);
48 : }
49 :
50 1 : HcclResult NotifyPool::Alloc(const std::string &tag, const RemoteRankInfo &info,
51 : std::shared_ptr<LocalIpcNotify> &localNotify, const NotifyLoadType type, u32 offsetAlignSize)
52 : {
53 1 : CHK_SMART_PTR_NULL(pimpl_);
54 1 : return pimpl_->Alloc(tag, info, type, localNotify, offsetAlignSize);
55 : }
56 :
57 0 : HcclResult NotifyPool::ResetNotify()
58 : {
59 0 : CHK_SMART_PTR_NULL(pimpl_);
60 0 : return pimpl_->ResetNotify();
61 : }
62 :
63 0 : HcclResult NotifyPool::ResetNotifyForDestRank(s64 destRank)
64 : {
65 0 : CHK_SMART_PTR_NULL(pimpl_);
66 0 : return pimpl_->ResetNotifyForDestRank(destRank);
67 : }
68 : } // namespace hccl
|