Merged
feat(utest): Optimize the time consumption during the compilation phase #232
杨旭Add on Jan 7
feat(utest): Optimize the time consumption during the compilation phase #232
Merged
杨旭Add on Jan 7
Total: 28 files changed+144-394
MCMakeLists.txt+2-1File content is under review, please try again later
MOAT.xml+2-2File content is under review, please try again later
Mbuild_ci.py+11-3File content is under review, please try again later
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -56,7 +56,7 @@ function(PTO_Fwk_AnalysisTargetSymbols)
56 ${ARGN}56 ${ARGN}
57 )57 )
58 if (BUILD_OPEN_PROJECT58 if (BUILD_OPEN_PROJECT
59- AND (ENABLE_UTEST)59+ AND (ENABLE_COMPILE_DEPENDENCY_CHECK)
60 AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles")60 AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
61 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"))61 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"))
62 set(_file $<TARGET_FILE:${ARG_TARGET}>)62 set(_file $<TARGET_FILE:${ARG_TARGET}>)
@@ -68,12 +68,16 @@ function(PTO_Fwk_AnalysisTargetSymbols)
68 if (ARG_IGNORE_UDF_SELF)68 if (ARG_IGNORE_UDF_SELF)
69 list(APPEND _Args "--ignore_undefined_symbols_self")69 list(APPEND _Args "--ignore_undefined_symbols_self")
70 endif ()70 endif ()
71- if (NOT ARG_IGNORE_UDF_PASSED)71+ if (ARG_IGNORE_UDF_PASSED)
72 list(APPEND _Args "--ignore_undefined_symbols_pass")72 list(APPEND _Args "--ignore_undefined_symbols_pass")
73 endif ()73 endif ()
74+ set(_LdLibPathExt)
75+ if (ENABLE_COMPILE_DEPENDENCY_CHECK AND CMAKE_SKIP_RPATH)
76+ set(_LdLibPathExt ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
77+ endif ()
74 add_custom_command(78 add_custom_command(
75 TARGET ${ARG_TARGET} POST_BUILD79 TARGET ${ARG_TARGET} POST_BUILD
76- COMMAND ${Python3_EXECUTABLE} ${_PyScript} ARGS ${_Args}80+ COMMAND cmake -E env LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${_LdLibPathExt} ${Python3_EXECUTABLE} ${_PyScript} ARGS ${_Args}
77 COMMENT "Analysis symbol of ${ARG_TARGET}"81 COMMENT "Analysis symbol of ${ARG_TARGET}"
78 )82 )
79 endif ()83 endif ()
@@ -95,7 +99,7 @@ function(PTO_Fwk_AnalysisTargetHeaderFiles)
95 ${ARGN}99 ${ARGN}
96 )100 )
97 if (BUILD_OPEN_PROJECT101 if (BUILD_OPEN_PROJECT
98- AND (ENABLE_UTEST OR ENABLE_STEST OR ENABLE_STEST_DISTRIBUTED)102+ AND (ENABLE_COMPILE_DEPENDENCY_CHECK)
99 AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles")103 AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
100 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"))104 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"))
101 set(_TargetFile $<TARGET_FILE:${ARG_TARGET}>)105 set(_TargetFile $<TARGET_FILE:${ARG_TARGET}>)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -95,7 +95,7 @@ target_compile_options(tile_fwk_intf_pub
95 $<$<CXX_COMPILER_ID:Clang>:-Wno-return-type-c-linkage>95 $<$<CXX_COMPILER_ID:Clang>:-Wno-return-type-c-linkage>
96 -Werror96 -Werror
97 # 依赖分析选项97 # 依赖分析选项
98- $<$<CXX_COMPILER_ID:GNU>:$<$<OR:$<BOOL:${ENABLE_UTEST}>,$<BOOL:${ENABLE_STEST}>,$<BOOL:${ENABLE_STEST_DISTRIBUTED}>>:-MMD>>98+ $<$<CXX_COMPILER_ID:GNU>:$<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:-MMD>>
99)99)
100target_link_directories(tile_fwk_intf_pub100target_link_directories(tile_fwk_intf_pub
101 INTERFACE101 INTERFACE
@@ -96,26 +96,6 @@
96 ]96 ]
97 }97 }
98 },98 },
99- "libtile_fwk_executor.so": {
100- "Source-Header": {
101- "Self": [
102- "framework/src/execute/"
103- ],
104- "Area": [
105- "framework/src/interface/",
106- "framework/src/machine/",
107- "framework/src/passes/",
108- "third_party/metadef/inc/"
109- ],
110- "Include": [
111- "framework/include/"
112- ],
113- "WhiteList": [
114- ],
115- "BlackList": [
116- ]
117- }
118- },
119 "libtile_fwk_simulation.so": {99 "libtile_fwk_simulation.so": {
120 "Source-Header": {100 "Source-Header": {
121 "Self": [101 "Self": [
@@ -192,248 +172,5 @@
192 "framework/src/interface/tileop/"172 "framework/src/interface/tileop/"
193 ]173 ]
194 }174 }
195- },
196- "libtile_fwk_stest_operator.a": {
197- "Source-Header": {
198- "Self": [
199- "framework/tests/st/operator/"
200- ],
201- "Area": [
202- "framework/src/operator/",
203- "framework/src/interface/",
204- "framework/src/passes/",
205- "framework/src/machine/",
206- "framework/tests/runtime/",
207- "framework/tests/st/utils"
208- ],
209- "Include": [
210- "framework/include/"
211- ],
212- "WhiteList": [
213- "framework/src/cost_model/simulation/"
214- ],
215- "BlackList": [
216- "framework/src/interface/tileop/"
217- ]
218- }
219- },
220- "libtile_fwk_stest_operation.a": {
221- "Source-Header": {
222- "Self": [
223- "framework/tests/st/operation/"
224- ],
225- "Area": [
226- "framework/src/interface/",
227- "framework/src/passes/",
228- "framework/src/codegen/",
229- "framework/src/machine/",
230- "framework/tests/runtime/",
231- "framework/tests/st/utils"
232- ],
233- "Include": [
234- "framework/include/"
235- ],
236- "WhiteList": [
237- "framework/src/cost_model/simulation/"
238- ],
239- "BlackList": [
240- "framework/src/interface/tileop/"
241- ]
242- }
243- },
244- "libtile_fwk_stest_machine.a": {
245- "Source-Header": {
246- "Self": [
247- "framework/tests/st/machine/"
248- ],
249- "Area": [
250- "framework/src/operator/",
251- "framework/src/interface/",
252- "framework/src/passes/",
253- "framework/src/machine/",
254- "framework/tests/runtime/",
255- "framework/tests/st/utils"
256- ],
257- "Include": [
258- "framework/include/"
259- ],
260- "WhiteList": [
261- "framework/src/cost_model/simulation/"
262- ],
263- "BlackList": [
264- ]
265- }
266- },
267- "libtile_fwk_stest_simulation.a": {
268- "Source-Header": {
269- "Self": [
270- "framework/tests/st/simulation/"
271- ],
272- "Area": [
273- "framework/src/operator/",
274- "framework/src/interface/",
275- "framework/src/passes/",
276- "framework/src/machine/",
277- "framework/tests/runtime/",
278- "framework/tests/st/utils"
279- ],
280- "Include": [
281- "framework/include/"
282- ],
283- "WhiteList": [
284- "framework/src/cost_model/simulation/"
285- ],
286- "BlackList": [
287- "framework/src/interface/tileop/"
288- ]
289- }
290- },
291- "libtile_fwk_utest_codegen.a": {
292- "Source-Header": {
293- "Self": [
294- "framework/tests/ut/codegen/"
295- ],
296- "Area": [
297- "framework/src/operator/",
298- "framework/src/interface/",
299- "framework/src/passes/",
300- "framework/src/codegen/"
301- ],
302- "Include": [
303- "framework/include/"
304- ],
305- "WhiteList": [
306- ],
307- "BlackList": [
308- ]
309- }
310- },
311- "libtile_fwk_utest_interface.a": {
312- "Source-Header": {
313- "Self": [
314- "framework/tests/ut/interface/"
315- ],
316- "Area": [
317- "framework/src/interface/",
318- "framework/src/passes/"
319- ],
320- "Include": [
321- "framework/include/"
322- ],
323- "WhiteList": [
324- ],
325- "BlackList": [
326- "framework/src/interface/tileop/"
327- ]
328- }
329- },
330- "libtile_fwk_utest_operator.a": {
331- "Source-Header": {
332- "Self": [
333- "framework/tests/ut/operator/"
334- ],
335- "Area": [
336- "framework/src/operator/",
337- "framework/src/interface/",
338- "framework/src/passes/"
339- ],
340- "Include": [
341- "framework/include/"
342- ],
343- "WhiteList": [
344- ],
345- "BlackList": [
346- "framework/src/interface/tileop/"
347- ]
348- }
349- },
350- "libtile_fwk_utest_passes.a": {
351- "Source-Header": {
352- "Self": [
353- "framework/tests/ut/passes/"
354- ],
355- "Area": [
356- "framework/src/operator/",
357- "framework/src/interface/",
358- "framework/src/passes/"
359- ],
360- "Include": [
361- "framework/include/"
362- ],
363- "WhiteList": [
364- ],
365- "BlackList": [
366- "framework/src/interface/tileop/"
367- ]
368- }
369- },
370- "libtile_fwk_utest_machine.a": {
371- "Source-Header": {
372- "Self": [
373- "framework/tests/ut/machine/"
374- ],
375- "Area": [
376- "framework/src/operator/",
377- "framework/src/interface/",
378- "framework/src/passes/",
379- "framework/src/machine/",
380- "framework/tests/runtime/"
381- ],
382- "Include": [
383- "framework/include/",
384- "framework/src/cost_model/simulation/common/"
385- ],
386- "WhiteList": [
387- "framework/src/cost_model/simulation/"
388- ],
389- "BlackList": [
390- ]
391- }
392- },
393- "libtile_fwk_utest_execute.a": {
394- "Source-Header": {
395- "Self": [
396- "framework/tests/ut/execute/"
397- ],
398- "Area": [
399- "framework/src/execute/",
400- "framework/src/machine/",
401- "framework/src/passes/",
402- "framework/src/interface/",
403- "third_party/metadef/inc/"
404- ],
405- "Include": [
406- "framework/include/"
407- ],
408- "WhiteList": [
409- ],
410- "BlackList": [
411- ]
412- }
413- },
414- "libtile_fwk_utest_simulation.a": {
415- "Source-Header": {
416- "Self": [
417- "framework/tests/ut/simulation/"
418- ],
419- "Area": [
420- "framework/src/operator/",
421- "framework/src/interface/",
422- "framework/src/passes/",
423- "framework/src/codegen/",
424- "framework/src/cost_model/simulation/",
425- "framework/src/cost_model/simulation_ca/",
426- "framework/src/cost_model/simulation_pv/",
427- "framework/src/cost_model/simulation_platform/"
428- ],
429- "Include": [
430- "framework/include/"
431- ],
432- "WhiteList": [
433- ],
434- "BlackList": [
435- "framework/src/interface/tileop/"
436- ]
437- }
438 }175 }
439}176}
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -16,7 +16,7 @@ add_library(tile_fwk_codegen SHARED)
16target_sources(tile_fwk_codegen PRIVATE ${_CodeGen_Srcs})16target_sources(tile_fwk_codegen PRIVATE ${_CodeGen_Srcs})
17target_link_libraries(tile_fwk_codegen17target_link_libraries(tile_fwk_codegen
18 PUBLIC18 PUBLIC
19- $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_UTEST}>:tile_fwk_interface>>19+ $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_interface>>
20 $<BUILD_INTERFACE:json>20 $<BUILD_INTERFACE:json>
21 PRIVATE21 PRIVATE
22 intf_pub_cxx1722 intf_pub_cxx17
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -20,7 +20,7 @@ target_include_directories(tile_fwk_simulation
20target_link_libraries(tile_fwk_simulation20target_link_libraries(tile_fwk_simulation
21 PUBLIC21 PUBLIC
22 dl22 dl
23- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_interface>23+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_interface>
24 PRIVATE24 PRIVATE
25 intf_pub_cxx1725 intf_pub_cxx17
26 tile_fwk_intf_pub26 tile_fwk_intf_pub
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -20,8 +20,8 @@ target_include_directories(tile_fwk_simulation_ca
20)20)
21target_link_libraries(tile_fwk_simulation_ca21target_link_libraries(tile_fwk_simulation_ca
22 PUBLIC22 PUBLIC
23- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_codegen>23+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_codegen>
24- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_simulation>24+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_simulation>
25 PRIVATE25 PRIVATE
26 intf_pub_cxx1726 intf_pub_cxx17
27 tile_fwk_intf_pub27 tile_fwk_intf_pub
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -20,8 +20,8 @@ target_include_directories(tile_fwk_simulation_pv
20)20)
21target_link_libraries(tile_fwk_simulation_pv21target_link_libraries(tile_fwk_simulation_pv
22 PUBLIC22 PUBLIC
23- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_codegen>23+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_codegen>
24- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_simulation>24+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_simulation>
25 json25 json
26 PRIVATE26 PRIVATE
27 intf_pub_cxx1727 intf_pub_cxx17
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -48,8 +48,8 @@ target_link_directories(tile_fwk_compiler
48)48)
49target_link_libraries(tile_fwk_compiler49target_link_libraries(tile_fwk_compiler
50 PRIVATE50 PRIVATE
51- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_interface>51+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_interface>
52- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_codegen>52+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_codegen>
53 json53 json
54 PRIVATE54 PRIVATE
55 intf_pub_cxx1755 intf_pub_cxx17
@@ -57,6 +57,9 @@ target_link_libraries(tile_fwk_compiler
57 dl57 dl
58 c_sec58 c_sec
59)59)
60+if (BUILD_WITH_CANN)
61+ add_dependencies(tile_fwk_compiler pypto_ctrl_server)
62+endif ()
60 63 
61PTO_Fwk_AnalysisTargetHeaderFiles(TARGET tile_fwk_compiler)64PTO_Fwk_AnalysisTargetHeaderFiles(TARGET tile_fwk_compiler)
62PTO_Fwk_AnalysisTargetSymbols(TARGET tile_fwk_compiler)65PTO_Fwk_AnalysisTargetSymbols(TARGET tile_fwk_compiler)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -58,8 +58,8 @@ target_link_directories(tile_fwk_runtime
58)58)
59target_link_libraries(tile_fwk_runtime59target_link_libraries(tile_fwk_runtime
60 PUBLIC60 PUBLIC
61- $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_UTEST}>:tile_fwk_interface>>61+ $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_interface>>
62- $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_UTEST}>:tile_fwk_compiler>>62+ $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_compiler>>
63 $<BUILD_INTERFACE:json>63 $<BUILD_INTERFACE:json>
64 $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:ascendcl>>64 $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:ascendcl>>
65 $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:runtime>>65 $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:runtime>>
@@ -79,6 +79,9 @@ if ((BUILD_WITH_CANN) AND (NOT PRODUCT_SIDE STREQUAL "device"))
79 ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/kernel/kernel_host.o79 ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/kernel/kernel_host.o
80 )80 )
81endif ()81endif ()
82+if (BUILD_WITH_CANN)
83+ add_dependencies(tile_fwk_runtime tile_fwk_server)
84+endif ()
82 85 
83PTO_Fwk_AnalysisTargetHeaderFiles(TARGET tile_fwk_runtime)86PTO_Fwk_AnalysisTargetHeaderFiles(TARGET tile_fwk_runtime)
84PTO_Fwk_AnalysisTargetSymbols(TARGET tile_fwk_runtime)87PTO_Fwk_AnalysisTargetSymbols(TARGET tile_fwk_runtime)
@@ -96,8 +99,8 @@ target_compile_definitions(tile_fwk_runtime_stub
96)99)
97target_link_libraries(tile_fwk_runtime_stub100target_link_libraries(tile_fwk_runtime_stub
98 PUBLIC101 PUBLIC
99- $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_UTEST}>:tile_fwk_interface>>102+ $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_interface>>
100- $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_UTEST}>:tile_fwk_compiler>>103+ $<BUILD_INTERFACE:$<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_compiler>>
101 $<BUILD_INTERFACE:json>104 $<BUILD_INTERFACE:json>
102 PRIVATE105 PRIVATE
103 intf_pub_cxx17106 intf_pub_cxx17
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -21,7 +21,7 @@ target_link_libraries(tile_fwk_operator
21 PRIVATE21 PRIVATE
22 intf_pub_cxx1722 intf_pub_cxx17
23 tile_fwk_intf_pub23 tile_fwk_intf_pub
24- $<$<BOOL:${ENABLE_UTEST}>:tile_fwk_interface>24+ $<$<BOOL:${ENABLE_COMPILE_DEPENDENCY_CHECK}>:tile_fwk_interface>
25)25)
26PTO_Fwk_AnalysisTargetHeaderFiles(TARGET tile_fwk_operator)26PTO_Fwk_AnalysisTargetHeaderFiles(TARGET tile_fwk_operator)
27PTO_Fwk_AnalysisTargetSymbols(TARGET tile_fwk_operator)27PTO_Fwk_AnalysisTargetSymbols(TARGET tile_fwk_operator)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -9,7 +9,6 @@
9# -----------------------------------------------------------------------------------------------------------9# -----------------------------------------------------------------------------------------------------------
10 10 
11include(cmake/config.cmake)11include(cmake/config.cmake)
12-include(cmake/intf.cmake)
13include(cmake/func.cmake)12include(cmake/func.cmake)
14include(cmake/func_utest.cmake)13include(cmake/func_utest.cmake)
15include(cmake/func_stest.cmake)14include(cmake/func_stest.cmake)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -49,9 +49,6 @@ function(PTO_Fwk_STest_AddLib)
49 ${PTO_Fwk_STestNamePrefix}_utils49 ${PTO_Fwk_STestNamePrefix}_utils
50 GTest::gtest50 GTest::gtest
51 )51 )
52- # 后检查
53- PTO_Fwk_AnalysisTargetHeaderFiles(TARGET ${ARG_TARGET})
54- # STest 暂不支持并行执行
55 set(PTO_Fwk_STestCaseLibraries ${PTO_Fwk_STestCaseLibraries} ${ARG_TARGET} CACHE INTERNAL "" FORCE)52 set(PTO_Fwk_STestCaseLibraries ${PTO_Fwk_STestCaseLibraries} ${ARG_TARGET} CACHE INTERNAL "" FORCE)
56 set(PTO_Fwk_STestCaseLdLibrariesExt ${PTO_Fwk_STestCaseLdLibrariesExt} ${ARG_LD_LIBRARIES_EXT} CACHE INTERNAL "" FORCE)53 set(PTO_Fwk_STestCaseLdLibrariesExt ${PTO_Fwk_STestCaseLdLibrariesExt} ${ARG_LD_LIBRARIES_EXT} CACHE INTERNAL "" FORCE)
57 set(PTO_Fwk_STestCaseGoldenScriptPathList ${PTO_Fwk_STestCaseGoldenScriptPathList} ${ARG_GOLDEN_SCRIPT_DIR} CACHE INTERNAL "" FORCE)54 set(PTO_Fwk_STestCaseGoldenScriptPathList ${PTO_Fwk_STestCaseGoldenScriptPathList} ${ARG_GOLDEN_SCRIPT_DIR} CACHE INTERNAL "" FORCE)
@@ -178,7 +175,6 @@ function(PTO_Fwk_STest_RunExe_GenerateGolden)
178 set(_Args)175 set(_Args)
179 list(APPEND _Args "-o=${ENABLE_STEST_GOLDEN_PATH}")176 list(APPEND _Args "-o=${ENABLE_STEST_GOLDEN_PATH}")
180 177 
181- list(FILTER ARG_GTEST_FILTER_LIST EXCLUDE REGEX "PARALLEL_SEPARATOR")
182 string(REPLACE ";" ":" GTestFilterStr "${ARG_GTEST_FILTER_LIST}")178 string(REPLACE ";" ":" GTestFilterStr "${ARG_GTEST_FILTER_LIST}")
183 list(APPEND _Args "-c=${GTestFilterStr}")179 list(APPEND _Args "-c=${GTestFilterStr}")
184 list(REMOVE_DUPLICATES PTO_Fwk_STestCaseGoldenScriptPathList)180 list(REMOVE_DUPLICATES PTO_Fwk_STestCaseGoldenScriptPathList)
@@ -300,6 +296,7 @@ function(PTO_Fwk_STest_AddExe_RunExe)
300 execute_process(COMMAND touch ${_Sources})296 execute_process(COMMAND touch ${_Sources})
301 list(REMOVE_DUPLICATES PTO_Fwk_STestCaseLibraries)297 list(REMOVE_DUPLICATES PTO_Fwk_STestCaseLibraries)
302 set(PTO_Fwk_Libraries298 set(PTO_Fwk_Libraries
299+ tile_fwk_simulation_platform
303 tile_fwk_interface300 tile_fwk_interface
304 tile_fwk_codegen301 tile_fwk_codegen
305 tile_fwk_compiler302 tile_fwk_compiler
@@ -311,9 +308,11 @@ function(PTO_Fwk_STest_AddExe_RunExe)
311 PTO_Fwk_GTest_AddExe(308 PTO_Fwk_GTest_AddExe(
312 TARGET ${ARG_TARGET}309 TARGET ${ARG_TARGET}
313 SOURCES ${_Sources}310 SOURCES ${_Sources}
314- PRIVATE_LINK_LIBRARIES ${PTO_Fwk_STestNamePrefix}_intf_pub ${PTO_Fwk_Libraries} ${PTO_Fwk_STestCaseLibraries}311+ PRIVATE_LINK_LIBRARIES ${PTO_Fwk_STestNamePrefix}_utils ${PTO_Fwk_Libraries} ${PTO_Fwk_STestCaseLibraries}
315 )312 )
316- add_dependencies(${ARG_TARGET} tile_fwk_server)313+ if (ENABLE_TORCH_VERIFIER)
314+ add_dependencies(${ARG_TARGET} tile_fwk_calculator)
315+ endif()
317 316 
318 #317 #
319 # 执行318 # 执行
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -9,6 +9,7 @@
9# -----------------------------------------------------------------------------------------------------------9# -----------------------------------------------------------------------------------------------------------
10 10 
11set(PTO_Fwk_UTestCaseLibraries "" CACHE INTERNAL "" FORCE) # UTest 各模块 用例实现二进制11set(PTO_Fwk_UTestCaseLibraries "" CACHE INTERNAL "" FORCE) # UTest 各模块 用例实现二进制
12+set(PTO_Fwk_UTestCaseLkLibraries "" CACHE INTERNAL "" FORCE) # UTest 各模块 额外 Link 二进制
12set(PTO_Fwk_UTestCaseLdLibrariesExt "" CACHE INTERNAL "" FORCE) # UTest 各模块 额外 Load 二进制13set(PTO_Fwk_UTestCaseLdLibrariesExt "" CACHE INTERNAL "" FORCE) # UTest 各模块 额外 Load 二进制
13 14 
14# UTest 添加测试用例二进制库15# UTest 添加测试用例二进制库
@@ -19,7 +20,7 @@ Parameters:
19 multi_value_keywords:20 multi_value_keywords:
20 SOURCES : [Required] 编译源码21 SOURCES : [Required] 编译源码
21 PRIVATE_INCLUDE_DIRECTORIES : [Optional] 头文件搜索路径(PRIVATE)22 PRIVATE_INCLUDE_DIRECTORIES : [Optional] 头文件搜索路径(PRIVATE)
22- PUBLIC_LINK_LIBRARIES : [Optional] 链接库(PUBLIC)23+ LINK_LIBRARIES : [Optional] 链接库(PUBLIC), 仅会在最终编译出可执行文件时链接;
23 LD_LIBRARIES_EXT : [Optional] 需要在执行时将所在路径配置到环境变量 LD_LIBRARY_PATH 中的 Libraries24 LD_LIBRARIES_EXT : [Optional] 需要在执行时将所在路径配置到环境变量 LD_LIBRARY_PATH 中的 Libraries
24Attention:25Attention:
25 1. 一般 LD_LIBRARIES_EXT 内配置的二进制, 在正常 source CANN 包环境变量后, LD_LIBRARY_PATH 内也应包含其所在路径;26 1. 一般 LD_LIBRARIES_EXT 内配置的二进制, 在正常 source CANN 包环境变量后, LD_LIBRARY_PATH 内也应包含其所在路径;
@@ -29,7 +30,7 @@ function(PTO_Fwk_UTest_AddCaseLib)
29 ARG30 ARG
30 ""31 ""
31 "TARGET"32 "TARGET"
32- "SOURCES;PRIVATE_INCLUDE_DIRECTORIES;PUBLIC_LINK_LIBRARIES;LD_LIBRARIES_EXT"33+ "SOURCES;PRIVATE_INCLUDE_DIRECTORIES;LINK_LIBRARIES;LD_LIBRARIES_EXT"
33 ""34 ""
34 ${ARGN}35 ${ARGN}
35 )36 )
@@ -38,14 +39,13 @@ function(PTO_Fwk_UTest_AddCaseLib)
38 target_include_directories(${ARG_TARGET} PRIVATE ${ARG_PRIVATE_INCLUDE_DIRECTORIES})39 target_include_directories(${ARG_TARGET} PRIVATE ${ARG_PRIVATE_INCLUDE_DIRECTORIES})
39 target_link_libraries(${ARG_TARGET}40 target_link_libraries(${ARG_TARGET}
40 PRIVATE41 PRIVATE
41- ${ARG_PUBLIC_LINK_LIBRARIES}42+ ${PTO_Fwk_UTestNamePrefix}_utils
42- ${PTO_Fwk_UTestNamePrefix}_intf_pub
43 GTest::gtest43 GTest::gtest
44+ json
45+ c_sec
44 )46 )
45- # 后检查
46- PTO_Fwk_AnalysisTargetHeaderFiles(TARGET ${ARG_TARGET})
47- 
48 set(PTO_Fwk_UTestCaseLibraries ${PTO_Fwk_UTestCaseLibraries} ${ARG_TARGET} CACHE INTERNAL "" FORCE)47 set(PTO_Fwk_UTestCaseLibraries ${PTO_Fwk_UTestCaseLibraries} ${ARG_TARGET} CACHE INTERNAL "" FORCE)
48+ set(PTO_Fwk_UTestCaseLkLibrariesExt ${PTO_Fwk_UTestCaseLkLibrariesExt} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE)
49 set(PTO_Fwk_UTestCaseLdLibrariesExt ${PTO_Fwk_UTestCaseLdLibrariesExt} ${ARG_LD_LIBRARIES_EXT} CACHE INTERNAL "" FORCE)49 set(PTO_Fwk_UTestCaseLdLibrariesExt ${PTO_Fwk_UTestCaseLdLibrariesExt} ${ARG_LD_LIBRARIES_EXT} CACHE INTERNAL "" FORCE)
50endfunction()50endfunction()
51 51 
@@ -134,13 +134,6 @@ function(PTO_Fwk_UTest_AddExe_RunExe)
134 set(_Sources ${CMAKE_CURRENT_BINARY_DIR}/${PTO_Fwk_UTestNamePrefix}_main_stub.cpp)134 set(_Sources ${CMAKE_CURRENT_BINARY_DIR}/${PTO_Fwk_UTestNamePrefix}_main_stub.cpp)
135 execute_process(COMMAND touch ${_Sources})135 execute_process(COMMAND touch ${_Sources})
136 136 
137- set(_PrivateLinkLibraries
138- ${PTO_Fwk_UTestNamePrefix}_intf_pub
139- $<$<BOOL:${BUILD_WITH_CANN}>:${PTO_Fwk_UTestNamePrefix}_stubs>
140- # Interface 内 HostMachine 存在 dlopen 逻辑, 此处增加对应库连接, 触发相关 so 被添加到可执行程序依赖中
141- tile_fwk_compiler
142- )
143- 
144 # 默认全部执行137 # 默认全部执行
145 set(GTestFilterList "*")138 set(GTestFilterList "*")
146 # 支持由 ENABLE_UTEST 传入指定的 Filter139 # 支持由 ENABLE_UTEST 传入指定的 Filter
@@ -149,10 +142,8 @@ function(PTO_Fwk_UTest_AddExe_RunExe)
149 string(REPLACE ":" ";" GTestFilterList "${GTestFilterList}")142 string(REPLACE ":" ";" GTestFilterList "${GTestFilterList}")
150 endif ()143 endif ()
151 144 
152- list(FILTER PTO_Fwk_UTestCaseLibraries EXCLUDE REGEX "PARALLEL_SEPARATOR")
153- list(FILTER PTO_Fwk_UTestCaseLdLibrariesExt EXCLUDE REGEX "PARALLEL_SEPARATOR")
154- list(FILTER GTestFilterList EXCLUDE REGEX "PARALLEL_SEPARATOR")
155 list(REMOVE_DUPLICATES PTO_Fwk_UTestCaseLibraries)145 list(REMOVE_DUPLICATES PTO_Fwk_UTestCaseLibraries)
146+ list(REMOVE_DUPLICATES PTO_Fwk_UTestCaseLkLibrariesExt)
156 list(REMOVE_DUPLICATES PTO_Fwk_UTestCaseLdLibrariesExt)147 list(REMOVE_DUPLICATES PTO_Fwk_UTestCaseLdLibrariesExt)
157 list(REMOVE_DUPLICATES GTestFilterList)148 list(REMOVE_DUPLICATES GTestFilterList)
158 149 
@@ -163,11 +154,25 @@ function(PTO_Fwk_UTest_AddExe_RunExe)
163 endif ()154 endif ()
164 endif ()155 endif ()
165 156 
157+ set(_PrivateLinkLibraries
158+ ${PTO_Fwk_UTestNamePrefix}_utils
159+ $<$<BOOL:${BUILD_WITH_CANN}>:${PTO_Fwk_UTestNamePrefix}_stubs>
160+ # 基本依赖
161+ # Interface 内 HostMachine 存在 dlopen 逻辑, 此处增加对应库连接, 触发相关 so 被添加到可执行程序依赖中
162+ tile_fwk_simulation_platform
163+ tile_fwk_interface
164+ tile_fwk_codegen
165+ tile_fwk_compiler
166+ # 用例特殊依赖
167+ ${PTO_Fwk_UTestCaseLkLibrariesExt}
168+ ${PTO_Fwk_UTestCaseLibraries}
169+ )
170+ list(REMOVE_DUPLICATES _PrivateLinkLibraries)
166 PTO_Fwk_GTest_AddExe(171 PTO_Fwk_GTest_AddExe(
167 TARGET ${ARG_TARGET}172 TARGET ${ARG_TARGET}
168 SOURCES ${_Sources}173 SOURCES ${_Sources}
169 PRIVATE_INCLUDE_DIRECTORIES ${ARG_PRIVATE_INCLUDE_DIRECTORIES}174 PRIVATE_INCLUDE_DIRECTORIES ${ARG_PRIVATE_INCLUDE_DIRECTORIES}
170- PRIVATE_LINK_LIBRARIES ${_PrivateLinkLibraries} ${PTO_Fwk_UTestCaseLibraries}175+ PRIVATE_LINK_LIBRARIES ${_PrivateLinkLibraries}
171 )176 )
172 PTO_Fwk_UTest_RunExe(177 PTO_Fwk_UTest_RunExe(
173 TARGET ${ARG_TARGET}178 TARGET ${ARG_TARGET}
@@ -1,6 +1,6 @@
1#!/usr/bin/env python31#!/usr/bin/env python3
2# coding: utf-82# coding: utf-8
3-# Copyright (c) 2025 Huawei Technologies Co., Ltd.3+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of4# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
5# CANN Open Software License Agreement Version 2.0 (the "License").5# 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.
@@ -506,7 +506,7 @@ class GTestAccelerate(ABC):
506 ]506 ]
507 return pairs507 return pairs
508 508 
509- def _start_cntr_process_grp(self, delay: int = 5) -> List[Process]:509+ def _start_cntr_process_grp(self, delay: int = 2) -> List[Process]:
510 """启动 Cntr 进程组510 """启动 Cntr 进程组
511 511 
512 :param delay: 各 Cntr 启动后, 处理具体 Case 前延迟时长, 在多消费者模式下, 各消费者启动时增加一定延迟, 等待所有消费者启动完成512 :param delay: 各 Cntr 启动后, 处理具体 Case 前延迟时长, 在多消费者模式下, 各消费者启动时增加一定延迟, 等待所有消费者启动完成
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -23,7 +23,7 @@ target_include_directories(${_Target}
23)23)
24target_link_libraries(${_Target}24target_link_libraries(${_Target}
25 PRIVATE25 PRIVATE
26- ${PTO_Fwk_STestNamePrefix}_intf_pub26+ ${PTO_Fwk_STestNamePrefix}_utils
27 tile_fwk_compiler27 tile_fwk_compiler
28 tile_fwk_runtime28 tile_fwk_runtime
29)29)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -15,38 +15,24 @@ target_include_directories(${_Target}
15 include15 include
16 ${PTO_FWK_SRC_ROOT}/framework/src/machine/runtime16 ${PTO_FWK_SRC_ROOT}/framework/src/machine/runtime
17 ${PTO_FWK_SRC_ROOT}/framework/src/cost_model17 ${PTO_FWK_SRC_ROOT}/framework/src/cost_model
18- INTERFACE # 编译 CANN 场景依赖18+ INTERFACE
19- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/inc>>19+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/include>>
20- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/abl/msprof/inc/toolchain>>20+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc>>
21- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/abl/slog/inc/toolchain>>21+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/base>>
22- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/ace/npuruntime/inc>>22+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/runtime>>
23- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/ace/npuruntime/inc/runtime>>23+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/runtime/runtime>>
24- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/ace/npuruntime/acl/inc/external>>24+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/profiling>>
25- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/ace/comop/inc>>
26- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/ace/comop/inc/external>>
27- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_OPEN_PROJECT}>>:${TOP_DIR}/ace/comop/hccl/open_source/pkg_inc>>
28- INTERFACE # 使用 CANN 场景依赖
29- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_OPEN_PROJECT}>:${ASCEND_CANN_PACKAGE_PATH}/include>>
30- INTERFACE # 使用 CANN 整包
31- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_OPEN_PROJECT}>:${ASCEND_CANN_PACKAGE_PATH}/include/base>>
32- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment>>
33- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment/hccl>>
34- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment/ascend_hal>>
35- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment/runtime>>
36- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment/runtime/runtime>>
37- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment/msprof>>
38- $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${BUILD_WITH_CANN_SUB}>>:${ASCEND_CANN_PACKAGE_PATH}/include/experiment/msprof/toolchain>>
39- INTERFACE # 使用 CANN 分包
40- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN_SUB}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc>>
41- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN_SUB}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/base>>
42- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN_SUB}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/runtime>>
43- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN_SUB}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/runtime/runtime>>
44- $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN_SUB}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/profiling>>
45)25)
46target_compile_definitions(${_Target}26target_compile_definitions(${_Target}
47 INTERFACE27 INTERFACE
48 $<$<BOOL:${BUILD_WITH_CANN}>:BUILD_WITH_CANN>28 $<$<BOOL:${BUILD_WITH_CANN}>:BUILD_WITH_CANN>
49 $<$<BOOL:${ENABLE_STEST_INTERPRETER_CONFIG}>:ENABLE_STEST_INTERPRETER_CONFIG>29 $<$<BOOL:${ENABLE_STEST_INTERPRETER_CONFIG}>:ENABLE_STEST_INTERPRETER_CONFIG>
30+ $<$<BOOL:${ENABLE_STEST_BINARY_CACHE}>:ENABLE_STEST_BINARY_CACHE>
31+ $<$<BOOL:${ENABLE_STEST_DUMP_JSON}>:ENABLE_STEST_DUMP_JSON>
32+)
33+target_compile_options(${_Target}
34+ INTERFACE
35+ -fno-access-control
50)36)
51target_link_directories(${_Target}37target_link_directories(${_Target}
52 INTERFACE38 INTERFACE
@@ -56,7 +42,8 @@ target_link_directories(${_Target}
56)42)
57target_link_libraries(${_Target}43target_link_libraries(${_Target}
58 INTERFACE44 INTERFACE
59- ${PTO_Fwk_STestNamePrefix}_intf_pub45+ intf_pub_cxx17
46+ tile_fwk_intf_pub
60 $<$<BOOL:${BUILD_WITH_CANN}>:ascendcl>47 $<$<BOOL:${BUILD_WITH_CANN}>:ascendcl>
61 $<$<BOOL:${BUILD_WITH_CANN}>:runtime>48 $<$<BOOL:${BUILD_WITH_CANN}>:runtime>
62 $<$<BOOL:${BUILD_WITH_CANN}>:hccl>49 $<$<BOOL:${BUILD_WITH_CANN}>:hccl>
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -9,6 +9,7 @@
9# -----------------------------------------------------------------------------------------------------------9# -----------------------------------------------------------------------------------------------------------
10 10 
11if (ENABLE_UTEST)11if (ENABLE_UTEST)
12+ add_subdirectory(utils)
12 add_subdirectory(stubs)13 add_subdirectory(stubs)
13 14 
14 PTO_Fwk_UTest_AddModuleDir(DIR operator)15 PTO_Fwk_UTest_AddModuleDir(DIR operator)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -17,5 +17,5 @@ PTO_Fwk_UTest_AddCaseLib(
17 TARGET ${_Target}17 TARGET ${_Target}
18 SOURCES ${_Sources}18 SOURCES ${_Sources}
19 PRIVATE_INCLUDE_DIRECTORIES ${_Include}19 PRIVATE_INCLUDE_DIRECTORIES ${_Include}
20- PUBLIC_LINK_LIBRARIES tile_fwk_interface tile_fwk_codegen tile_fwk_operator20+ LINK_LIBRARIES tile_fwk_operator
21)21)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -14,8 +14,13 @@ file(GLOB_RECURSE _Sources
14 src/*.cpp14 src/*.cpp
15)15)
16 16 
17+set(LinkLibraries)
18+if (TARGET tile_fwk_calculator)
19+ list(APPEND LinkLibraries tile_fwk_calculator)
20+endif ()
21+ 
17PTO_Fwk_UTest_AddCaseLib(22PTO_Fwk_UTest_AddCaseLib(
18 TARGET ${_Target}23 TARGET ${_Target}
19 SOURCES ${_Sources}24 SOURCES ${_Sources}
20- PUBLIC_LINK_LIBRARIES tile_fwk_interface25+ LINK_LIBRARIES ${LinkLibraries}
21)26)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -21,7 +21,7 @@ PTO_Fwk_UTest_AddCaseLib(
21 TARGET ${_Target}21 TARGET ${_Target}
22 SOURCES ${_Sources}22 SOURCES ${_Sources}
23 PRIVATE_INCLUDE_DIRECTORIES ${_Include}23 PRIVATE_INCLUDE_DIRECTORIES ${_Include}
24- PUBLIC_LINK_LIBRARIES tile_fwk_interface tile_fwk_compiler tile_fwk_runtime tile_fwk_operator dl24+ LINK_LIBRARIES tile_fwk_runtime tile_fwk_operator dl
25)25)
26target_compile_definitions(${_Target}26target_compile_definitions(${_Target}
27 PRIVATE27 PRIVATE
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -12,8 +12,13 @@ set(_Target ${PTO_Fwk_UTestNamePrefix}_operator)
12 12 
13file(GLOB_RECURSE _Sources src/*.cpp)13file(GLOB_RECURSE _Sources src/*.cpp)
14 14 
15+set(LinkLibraries tile_fwk_operator)
16+if (TARGET tile_fwk_calculator)
17+ list(APPEND LinkLibraries tile_fwk_calculator)
18+endif ()
19+ 
15PTO_Fwk_UTest_AddCaseLib(20PTO_Fwk_UTest_AddCaseLib(
16 TARGET ${_Target}21 TARGET ${_Target}
17 SOURCES ${_Sources}22 SOURCES ${_Sources}
18- PUBLIC_LINK_LIBRARIES tile_fwk_interface tile_fwk_operator23+ LINK_LIBRARIES ${LinkLibraries}
19)24)
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -15,7 +15,7 @@ file(GLOB_RECURSE _Sources src/*.cpp)
15PTO_Fwk_UTest_AddCaseLib(15PTO_Fwk_UTest_AddCaseLib(
16 TARGET ${_Target}16 TARGET ${_Target}
17 SOURCES ${_Sources}17 SOURCES ${_Sources}
18- PUBLIC_LINK_LIBRARIES tile_fwk_interface tile_fwk_operator18+ LINK_LIBRARIES tile_fwk_operator
19)19)
20add_custom_command(20add_custom_command(
21 TARGET ${_Target} PRE_BUILD21 TARGET ${_Target} PRE_BUILD
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.2+# Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3# This program is free software, you can redistribute it and/or modify it under the terms and conditions of3# 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.
@@ -16,7 +16,7 @@ PTO_Fwk_UTest_AddCaseLib(
16 TARGET ${_Target}16 TARGET ${_Target}
17 SOURCES ${_Sources}17 SOURCES ${_Sources}
18 PRIVATE_INCLUDE_DIRECTORIES ${PTO_FWK_SRC_ROOT}/framework/src/cost_model18 PRIVATE_INCLUDE_DIRECTORIES ${PTO_FWK_SRC_ROOT}/framework/src/cost_model
19- PUBLIC_LINK_LIBRARIES tile_fwk_interface tile_fwk_operator tile_fwk_simulation dl19+ LINK_LIBRARIES tile_fwk_operator tile_fwk_simulation dl
20)20)
21add_dependencies(${_Target} tile_fwk_simulation_ca tile_fwk_simulation_pv)21add_dependencies(${_Target} tile_fwk_simulation_ca tile_fwk_simulation_pv)
22 22 
Rframework/tests/cmake/intf.cmake→framework/tests/ut/utils/CMakeLists.txt+16-23
@@ -1,5 +1,5 @@
1# -----------------------------------------------------------------------------------------------------------1# -----------------------------------------------------------------------------------------------------------
2-# Copyright (c) 2025 Huawei Technologies Co., Ltd.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 of3# 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.
@@ -8,31 +8,24 @@
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# -----------------------------------------------------------------------------------------------------------
10 10 
11-set(_Target ${PTO_Fwk_UTestNamePrefix}_intf_pub)11+set(_Target ${PTO_Fwk_UTestNamePrefix}_utils)
12add_library(${_Target} INTERFACE)12add_library(${_Target} INTERFACE)
13+target_include_directories(${_Target}
14+ INTERFACE
15+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/include>>
16+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc>>
17+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/base>>
18+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/runtime>>
19+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/runtime/runtime>>
20+ $<BUILD_INTERFACE:$<$<BOOL:${BUILD_WITH_CANN}>:${ASCEND_CANN_PACKAGE_PATH}/pkg_inc/profiling>>
21+)
22+target_compile_definitions(${_Target}
23+ INTERFACE
24+ $<$<BOOL:${BUILD_WITH_CANN}>:BUILD_WITH_CANN>
25+)
13target_compile_options(${_Target}26target_compile_options(${_Target}
14 INTERFACE27 INTERFACE
15- -fno-access-control28+ -fno-access-control
16-)
17-target_link_libraries(${_Target}
18- INTERFACE
19- intf_pub_cxx17
20- tile_fwk_intf_pub
21-)
22- 
23-set(_Target ${PTO_Fwk_STestNamePrefix}_intf_pub)
24-add_library(${_Target} INTERFACE)
25-target_compile_options(${_Target}
26- INTERFACE
27- -fno-access-control
28-)
29-target_compile_definitions(${_Target}
30- INTERFACE
31- $<$<BOOL:${ENABLE_STEST_BINARY_CACHE}>:ENABLE_STEST_BINARY_CACHE>
32-)
33-target_compile_definitions(${_Target}
34- INTERFACE
35- $<$<BOOL:${ENABLE_STEST_DUMP_JSON}>:ENABLE_STEST_DUMP_JSON>
36)29)
37target_link_libraries(${_Target}30target_link_libraries(${_Target}
38 INTERFACE31 INTERFACE