Line data Source code
1 : /**
2 : * Copyright (c) 2026 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 PROTOCOL_UTILS_H
12 : #define PROTOCOL_UTILS_H
13 :
14 : #include <string>
15 : #include <unordered_map>
16 : #include "hcomm_res_defs.h"
17 : #include "comm_engine_utils.h"
18 :
19 0 : inline const std::unordered_map<CommProtocol, std::string>& GetCommProtocolStrMap()
20 : {
21 : static const std::unordered_map<CommProtocol, std::string> COMM_PROTOCOL_STR_MAP{
22 0 : {COMM_PROTOCOL_RESERVED, "RESERVED"}, {COMM_PROTOCOL_HCCS, "HCCS"}, {COMM_PROTOCOL_ROCE, "ROCE"},
23 0 : {COMM_PROTOCOL_PCIE, "PCIE"}, {COMM_PROTOCOL_SIO, "SIO"}, {COMM_PROTOCOL_UB_CTP, "UB_CTP"},
24 0 : {COMM_PROTOCOL_UBC_TP, "UBC_TP"}, {COMM_PROTOCOL_UB_MEM, "UB_MEM"}, {COMM_PROTOCOL_UBOE, "UBOE"},
25 0 : {COMM_PROTOCOL_HCCS_ONLY, "HCCS_ONLY"}, {COMM_PROTOCOL_UB_RTP, "UB_RTP"}};
26 0 : return COMM_PROTOCOL_STR_MAP;
27 0 : }
28 :
29 : #endif
|