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 MEM_TRANSPORT_COMMON_H
11 : #define MEM_TRANSPORT_COMMON_H
12 :
13 : #include "string_util.h"
14 : #include "reduce_in.h"
15 :
16 : namespace Hccl {
17 1394 : MAKE_ENUM(TransportType, P2P, UB, ROCE)
18 62 : MAKE_ENUM(TransportNotifyType, NORMAL, COUNT)
19 :
20 :
21 : struct WithNotifyIn {
22 : TransportNotifyType notifyType_{TransportNotifyType::NORMAL};
23 : u32 index_{0};
24 : u32 userData_{0};
25 17 : WithNotifyIn(TransportNotifyType notifyType, u32 index, u32 userData = 0)
26 17 : : notifyType_(notifyType), index_(index), userData_(userData)
27 : {
28 17 : }
29 2 : std::string Describe() const
30 : {
31 2 : return StringFormat("WithNotifyIn[notifyType=%s, index=%u, userData=%u]", notifyType_.Describe().c_str(), index_,
32 4 : userData_);
33 : }
34 : };
35 : } // namespace Hccl
36 :
37 : #endif
|