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 : #include "host_device_sync_notify_lite_mgr.h"
11 : #include "binary_stream.h"
12 :
13 : namespace Hccl {
14 :
15 5 : NotifyLite *HostDeviceSyncNotifyLiteMgr::GetDeviceWaitNotify()
16 : {
17 5 : return notifys[0].get();
18 : }
19 :
20 5 : NotifyLite *HostDeviceSyncNotifyLiteMgr::GetHostWaitNotify()
21 : {
22 5 : return notifys[1].get();
23 : }
24 :
25 1 : void HostDeviceSyncNotifyLiteMgr::ParsePackedData(std::vector<char> &data)
26 : {
27 1 : BinaryStream binaryStream(data);
28 :
29 1 : std::vector<char> uniqueId0;
30 1 : std::vector<char> uniqueId1;
31 1 : binaryStream >> uniqueId0;
32 1 : binaryStream >> uniqueId1;
33 :
34 1 : if (!isReady) {
35 1 : notifys[0] = std::make_unique<NotifyLite>(uniqueId0);
36 1 : notifys[1] = std::make_unique<NotifyLite>(uniqueId1);
37 1 : isReady = true;
38 : }
39 1 : }
40 :
41 : } // namespace Hccl
|