Merged
fix(cmake): 修复 examples 下 AddOpTestCase 未注册并补齐 add_example UT 的 SOC #13839
fix(cmake): 修复 examples 下 AddOpTestCase 未注册并补齐 add_example UT 的 SOC #13839
Merged
HuangRZzzzAdd on 15 days ago
Total: 2 files changed+8-4
@@ -481,6 +481,10 @@ macro(add_category_subdirectory)
481 481 
482 if("${ASCEND_OP_NAME}" STREQUAL "add_example" OR "${ASCEND_OP_NAME}" STREQUAL "add_example_aicpu"482 if("${ASCEND_OP_NAME}" STREQUAL "add_example" OR "${ASCEND_OP_NAME}" STREQUAL "add_example_aicpu"
483 OR "${ASCEND_OP_NAME}" STREQUAL "add_example_pypto")483 OR "${ASCEND_OP_NAME}" STREQUAL "add_example_pypto")
484+ # examples 在算子循环外单独加载,此时 OP_DIR/OP_NAME 仍残留循环最后一次的算子目录,
485+ # 会导致 examples 下 AddOpTestCase 误用该目录并在 --ops 过滤时提前 return(UT 用例不注册)。
486+ unset(OP_DIR)
487+ unset(OP_NAME)
484 add_subdirectory(examples)488 add_subdirectory(examples)
485 endif()489 endif()
486endmacro()490endmacro()
@@ -1,9 +1,9 @@
1# ----------------------------------------------------------------------------1# ----------------------------------------------------------------------------
2# Copyright (c) 2025 Huawei Technologies Co., Ltd.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 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").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.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, 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.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.8# See LICENSE in the root of the software repository for the full text of the License.
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
@@ -14,5 +14,5 @@
14# param3:自定义编译选项,一般填写测试的一种典型数据类型组合,不需要则传入空字符串,例如:"-DDTYPE_X=float",多个使用空格分隔,例如:"-DDTYPE_X=float -DDTYPE_Y=float"14# param3:自定义编译选项,一般填写测试的一种典型数据类型组合,不需要则传入空字符串,例如:"-DDTYPE_X=float",多个使用空格分隔,例如:"-DDTYPE_X=float -DDTYPE_Y=float"
15# param4:该算子依赖的所有tiling源码文件15# param4:该算子依赖的所有tiling源码文件
16if ((UT_TEST_ALL OR OP_KERNEL_UT) AND NOT UT_DONE)16if ((UT_TEST_ALL OR OP_KERNEL_UT) AND NOT UT_DONE)
17- AddOpTestCase(add_example "ascend910B1" "")17+ AddOpTestCase(add_example "ascend910B1;Ascend910_9391;ascend950pr_9599" "")
18-endif()18+endif()