File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ function(cc_test)
6969 PRIVATE ${CC_TEST_LINKOPTS}
7070 )
7171
72+ if (USE_NPU)
73+ set (COMMON_LIBS Python::Python torch_npu torch_python)
74+ endif ()
75+
76+ if (USE_NPU AND DEFINED COMMON_LIBS)
77+ target_link_libraries (${CC_TEST_NAME} PRIVATE ${COMMON_LIBS} )
78+ endif ()
79+
7280 add_dependencies (all_tests ${CC_TEST_NAME} )
7381
7482 gtest_add_tests(
Original file line number Diff line number Diff line change 1717from setuptools .command .bdist_wheel import bdist_wheel
1818from setuptools .command .build_ext import build_ext
1919
20- BUILD_TEST_FILE = False
20+ BUILD_TEST_FILE = True
2121BUILD_EXPORT = True
2222
2323# get cpu architecture
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ cc_library(
4343 torch
4444)
4545
46+ if (NOT USE_NPU)
4647# Add test for DenseMLP
4748cc_test(
4849 NAME
@@ -76,3 +77,4 @@ cc_test(
7677 torch
7778 GTest::gtest_main
7879)
80+ endif ()
You can’t perform that action at this time.
0 commit comments