已合并
add ascend350 config #92
dongfei创建于 9月3日
add ascend350 config #92
已合并
共 3 个文件变更+20-23
| @@ -96,7 +96,7 @@ set(ASCEND_COMPUTE_UNIT | |||
| 96 | "ascend910b" | 96 | "ascend910b" |
| 97 | CACHE STRING "soc that need to be compiled") | 97 | CACHE STRING "soc that need to be compiled") |
| 98 | set(ASCEND_ALL_COMPUTE_UNIT | 98 | set(ASCEND_ALL_COMPUTE_UNIT |
| 99 | - "ascend310p;ascend910;ascend910b;ascend910_93;ascend950;ascend031;ascend035;ascend310b;ascend910_55;mc62cm12a;kirinx90;kirin9030" | 99 | + "ascend310p;ascend910;ascend910b;ascend910_93;ascend350;ascend950;ascend031;ascend035;ascend310b;ascend910_55;mc62cm12a;kirinx90;kirin9030" |
| 100 | CACHE STRING "all soc list") | 100 | CACHE STRING "all soc list") |
| 101 | set(VENDOR_NAME | 101 | set(VENDOR_NAME |
| 102 | "custom" | 102 | "custom" |
| @@ -11,7 +11,7 @@ | |||
| 11 | set -e | 11 | set -e |
| 12 | RELEASE_TARGETS=("ophost" "opapi" "onnxplugin" "opgraph" "tfplugin") | 12 | RELEASE_TARGETS=("ophost" "opapi" "onnxplugin" "opgraph" "tfplugin") |
| 13 | 13 | ||
| 14 | -SUPPORT_COMPUTE_UNIT_SHORT=("ascend031" "ascend035" "ascend310b" "ascend310p" "ascend910_93" "ascend950" "ascend350" "ascend910b" "ascend910" "kirinx90" "kirin9030" "mc62") | 14 | +SUPPORT_COMPUTE_UNIT_SHORT=("ascend031" "ascend035" "ascend310b" "ascend310p" "ascend910_93" "ascend350" "ascend950" "ascend350" "ascend910b" "ascend910" "kirinx90" "kirin9030" "mc62") |
| 15 | # 对SUPPORT_COMPUTE_UNIT_SHORT按字符串长度从长到短排序,避免前缀匹配时出错 | 15 | # 对SUPPORT_COMPUTE_UNIT_SHORT按字符串长度从长到短排序,避免前缀匹配时出错 |
| 16 | SUPPORT_COMPUTE_UNIT_SHORT=($(printf '%s\n' "${SUPPORT_COMPUTE_UNIT_SHORT[@]}" | awk '{print length($0) " " $0}' | sort -rn | cut -d ' ' -f2-)) | 16 | SUPPORT_COMPUTE_UNIT_SHORT=($(printf '%s\n' "${SUPPORT_COMPUTE_UNIT_SHORT[@]}" | awk '{print length($0) " " $0}' | sort -rn | cut -d ' ' -f2-)) |
| 17 | TRIGER_UTS=() | 17 | TRIGER_UTS=() |
| @@ -1294,7 +1294,7 @@ build_example() { | |||
| 1294 | 1294 | ||
| 1295 | OLDIFS=$IFS | 1295 | OLDIFS=$IFS |
| 1296 | IFS=$'\n' | 1296 | IFS=$'\n' |
| 1297 | - { | 1297 | + { |
| 1298 | files=($(find ../ -path "*/${OP_NAME}/examples/${pattern}*.cpp" -not -path "*/opgen/template/*" | grep ${grep_word} "experimental")) | 1298 | files=($(find ../ -path "*/${OP_NAME}/examples/${pattern}*.cpp" -not -path "*/opgen/template/*" | grep ${grep_word} "experimental")) |
| 1299 | } || { | 1299 | } || { |
| 1300 | files=() | 1300 | files=() |
| @@ -1303,6 +1303,9 @@ build_example() { | |||
| 1303 | if [[ "$COMPUTE_UNIT" == "ascend950" ]]; then | 1303 | if [[ "$COMPUTE_UNIT" == "ascend950" ]]; then |
| 1304 | files=($(find ../ -path "*/${OP_NAME}/examples/arch35/${pattern}*.cpp" | grep ${grep_word} "experimental")) | 1304 | files=($(find ../ -path "*/${OP_NAME}/examples/arch35/${pattern}*.cpp" | grep ${grep_word} "experimental")) |
| 1305 | fi | 1305 | fi |
| 1306 | + if [[ "$COMPUTE_UNIT" == "ascend350" ]]; then | ||
| 1307 | + files=($(find ../ -path "*/${OP_NAME}/examples/arch35/${pattern}*.cpp" | grep ${grep_word} "experimental")) | ||
| 1308 | + fi | ||
| 1306 | if [[ "$COMPUTE_UNIT" == "ascend310p" ]]; then | 1309 | if [[ "$COMPUTE_UNIT" == "ascend310p" ]]; then |
| 1307 | files=($(find ../ -path "*/${OP_NAME}/examples/arch20/${pattern}*.cpp" | grep ${grep_word} "experimental")) | 1310 | files=($(find ../ -path "*/${OP_NAME}/examples/arch20/${pattern}*.cpp" | grep ${grep_word} "experimental")) |
| 1308 | fi | 1311 | fi |
| @@ -4,8 +4,9 @@ | |||
| 4 | * This file is a part of the CANN Open Software. | 4 | * This file is a part of the CANN Open Software. |
| 5 | * Licensed under CANN Open Software License Agreement Version 2.0 (the "License"). | 5 | * Licensed under CANN Open Software License Agreement Version 2.0 (the "License"). |
| 6 | * Please refer to the License for details. You may not use this file except in compliance with the License. | 6 | * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 7 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. See LICENSE in the root of |
| 9 | + * the software repository for the full text of the License. | ||
| 9 | */ | 10 | */ |
| 10 | 11 | ||
| 11 | 12 | ||
| @@ -21,6 +22,7 @@ enum class SocVersion { | |||
| 21 | ASCEND910B, | 22 | ASCEND910B, |
| 22 | ASCEND910_93, | 23 | ASCEND910_93, |
| 23 | ASCEND950, | 24 | ASCEND950, |
| 25 | + ASCEND350, | ||
| 24 | ASCEND910E, | 26 | ASCEND910E, |
| 25 | ASCEND310, | 27 | ASCEND310, |
| 26 | ASCEND310P, | 28 | ASCEND310P, |
| @@ -32,15 +34,7 @@ enum class SocVersion { | |||
| 32 | RESERVED_VERSION = 99999 | 34 | RESERVED_VERSION = 99999 |
| 33 | }; | 35 | }; |
| 34 | 36 | ||
| 35 | -enum class NpuArch { | 37 | +enum class NpuArch { DAV_1001 = 0, DAV_2002, DAV_2201, DAV_3002, DAV_3102, DAV_3510, RESERVED_VERSION = 99999 }; |
| 36 | - DAV_1001 = 0, | ||
| 37 | - DAV_2002, | ||
| 38 | - DAV_2201, | ||
| 39 | - DAV_3002, | ||
| 40 | - DAV_3102, | ||
| 41 | - DAV_3510, | ||
| 42 | - RESERVED_VERSION = 99999 | ||
| 43 | -}; | ||
| 44 | 38 | ||
| 45 | enum class SocSpec { INST_MMAD = 0, RESERVED_SPEC = 99999 }; | 39 | enum class SocSpec { INST_MMAD = 0, RESERVED_SPEC = 99999 }; |
| 46 | 40 | ||
| @@ -72,7 +66,7 @@ class PlatformInfo { | |||
| 72 | public: | 66 | public: |
| 73 | PlatformInfo() {}; | 67 | PlatformInfo() {}; |
| 74 | 68 | ||
| 75 | - PlatformInfo(int32_t deviceId) : deviceId_(deviceId){}; | 69 | + PlatformInfo(int32_t deviceId) : deviceId_(deviceId) {}; |
| 76 | 70 | ||
| 77 | SocVersion GetSocVersion() const; | 71 | SocVersion GetSocVersion() const; |
| 78 | 72 | ||
| @@ -94,24 +88,24 @@ public: | |||
| 94 | 88 | ||
| 95 | bool GetFftsPlusMode() const; | 89 | bool GetFftsPlusMode() const; |
| 96 | 90 | ||
| 97 | - fe::PlatFormInfos *GetPlatformInfos() const; | 91 | + fe::PlatFormInfos* GetPlatformInfos() const; |
| 98 | 92 | ||
| 99 | uint32_t coreNum_ = 0; | 93 | uint32_t coreNum_ = 0; |
| 100 | 94 | ||
| 101 | private: | 95 | private: |
| 102 | - PlatformInfo &operator=(const PlatformInfo &other) = delete; | 96 | + PlatformInfo& operator=(const PlatformInfo& other) = delete; |
| 103 | 97 | ||
| 104 | - PlatformInfo &operator=(const PlatformInfo &&other) = delete; | 98 | + PlatformInfo& operator=(const PlatformInfo&& other) = delete; |
| 105 | 99 | ||
| 106 | - PlatformInfo(const PlatformInfo &other) = delete; | 100 | + PlatformInfo(const PlatformInfo& other) = delete; |
| 107 | 101 | ||
| 108 | - PlatformInfo(const PlatformInfo &&other) = delete; | 102 | + PlatformInfo(const PlatformInfo&& other) = delete; |
| 109 | 103 | ||
| 110 | - void SetPlatformImpl(PlatformInfoImpl *impl); | 104 | + void SetPlatformImpl(PlatformInfoImpl* impl); |
| 111 | 105 | ||
| 112 | bool valid_ = false; | 106 | bool valid_ = false; |
| 113 | int32_t deviceId_{-1}; | 107 | int32_t deviceId_{-1}; |
| 114 | - PlatformInfoImpl *impl_ = nullptr; | 108 | + PlatformInfoImpl* impl_ = nullptr; |
| 115 | 109 | ||
| 116 | ~PlatformInfo(); | 110 | ~PlatformInfo(); |
| 117 | }; | 111 | }; |
| @@ -129,7 +123,7 @@ public: | |||
| 129 | ~SocVersionManager(); | 123 | ~SocVersionManager(); |
| 130 | 124 | ||
| 131 | private: | 125 | private: |
| 132 | - SocVersion originalVersion_; //保存原始的Soc版本 | 126 | + SocVersion originalVersion_; // 保存原始的Soc版本 |
| 133 | 127 | ||
| 134 | SocVersionManager(const SocVersionManager&) = delete; | 128 | SocVersionManager(const SocVersionManager&) = delete; |
| 135 | SocVersionManager(const SocVersionManager&&) = delete; | 129 | SocVersionManager(const SocVersionManager&&) = delete; |