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 : #ifndef REMOTE_NOTIFY_H
12 : #define REMOTE_NOTIFY_H
13 :
14 : #include "stream_pub.h"
15 : #include "dispatcher.h"
16 :
17 : namespace hccl {
18 : class RemoteNotifyImpl;
19 : class RemoteNotify {
20 : public:
21 : RemoteNotify();
22 : ~RemoteNotify();
23 : HcclResult Init(const std::vector<u8>& byteVector);
24 : HcclResult Init(const HcclSignalInfo ¬ifyInfo,
25 : const NotifyLoadType type = NotifyLoadType::DEVICE_NOTIFY);
26 :
27 : HcclResult Open();
28 : HcclResult Close();
29 : HcclResult Post(Stream& stream, HcclDispatcher dispatcher, s32 stage = INVALID_VALUE_STAGE);
30 : HcclResult GetNotifyData(HcclSignalInfo ¬ifyInfo);
31 : HcclResult SetNotifyData(HcclSignalInfo ¬ifyInfo);
32 :
33 : // 仅限dispatcher使用,使用时需判空
34 1 : inline HcclRtNotify ptr()
35 : {
36 1 : return notifyPtr;
37 : }
38 : // 获取offset
39 : HcclResult GetNotifyOffset(u64 ¬ifyOffset);
40 :
41 : private:
42 : std::unique_ptr<RemoteNotifyImpl> pimpl_;
43 : HcclRtNotify notifyPtr;
44 : };
45 :
46 : }
47 :
48 : #endif // REMOTE_NOTIFY_H
|