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