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 "aicpusd_util.h"
11 : namespace AicpuSchedule {
12 : const std::map<ge::DataType, std::string> DTYPE_NAMES {
13 : {ge::DataType::DT_FLOAT, "DT_FLOAT"},
14 : {ge::DataType::DT_FLOAT16, "DT_FLOAT16"},
15 : {ge::DataType::DT_INT8, "DT_INT8"},
16 : {ge::DataType::DT_INT16, "DT_INT16"},
17 : {ge::DataType::DT_UINT16, "DT_UINT16"},
18 : {ge::DataType::DT_UINT8, "DT_UINT8"},
19 : {ge::DataType::DT_INT32, "DT_INT32"},
20 : {ge::DataType::DT_INT64, "DT_INT64"},
21 : {ge::DataType::DT_UINT32, "DT_UINT32"},
22 : {ge::DataType::DT_UINT64, "DT_UINT64"},
23 : {ge::DataType::DT_BOOL, "DT_BOOL"},
24 : {ge::DataType::DT_DOUBLE, "DT_DOUBLE"},
25 : {ge::DataType::DT_STRING, "DT_STRING"},
26 : {ge::DataType::DT_DUAL_SUB_INT8, "DT_DUAL_SUB_INT8"},
27 : {ge::DataType::DT_DUAL_SUB_UINT8, "DT_DUAL_SUB_UINT8"},
28 : {ge::DataType::DT_COMPLEX64, "DT_COMPLEX64"},
29 : {ge::DataType::DT_COMPLEX128, "DT_COMPLEX128"},
30 : {ge::DataType::DT_QINT8, "DT_QINT8"},
31 : {ge::DataType::DT_QINT16, "DT_QINT16"},
32 : {ge::DataType::DT_QINT32, "DT_QINT32"},
33 : {ge::DataType::DT_QUINT8, "DT_QUINT8"},
34 : {ge::DataType::DT_QUINT16, "DT_QUINT16"},
35 : {ge::DataType::DT_RESOURCE, "DT_RESOURCE"},
36 : {ge::DataType::DT_STRING_REF, "DT_STRING_REF"},
37 : {ge::DataType::DT_DUAL, "DT_DUAL"},
38 : {ge::DataType::DT_VARIANT, "DT_VARIANT"},
39 : {ge::DataType::DT_BF16, "DT_BF16"},
40 : {ge::DataType::DT_UNDEFINED, "DT_UNDEFINED"},
41 : {ge::DataType::DT_INT4, "DT_INT4"},
42 : {ge::DataType::DT_UINT1, "DT_UINT1"},
43 : {ge::DataType::DT_INT2, "DT_INT2"},
44 : {ge::DataType::DT_UINT2, "DT_UINT2"},
45 : {ge::DataType::DT_COMPLEX32, "DT_COMPLEX32"}};
46 :
47 5 : std::string AicpuUtil::GetDTypeString(const ge::DataType curDtype)
48 : {
49 5 : auto iter = DTYPE_NAMES.find(curDtype);
50 5 : if (iter != DTYPE_NAMES.end()) {
51 4 : return iter->second;
52 : }
53 2 : return "DT_UNDEFINED";
54 : }
55 : }
|