From ab2b94897ff762953ce8484095656f4853a8319f Mon Sep 17 00:00:00 2001 From: Allen Guo Date: Mon, 27 Sep 2021 19:49:04 +0800 Subject: [PATCH] clean cmake (#193) * clean cmake --- paddle/fluid/operators/CMakeLists.txt | 4 ---- python/paddle/fluid/tests/unittests/CMakeLists.txt | 4 ++++ python/paddle/fluid/tests/unittests/ipu/CMakeLists.txt | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 python/paddle/fluid/tests/unittests/ipu/CMakeLists.txt diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index e9aec460778d0..6e11c64afc4bd 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -133,10 +133,6 @@ if (WITH_ASCEND_CL) set(COMMON_OP_DEPS ${COMMON_OP_DEPS} npu_op_runner) endif() -if (WITH_IPU) - set(COMMON_OP_DEPS ${COMMON_OP_DEPS} ipu_backend) -endif() - # FIXME(typhoonzero): operator deps may not needed. # op_library(lod_tensor_to_array_op DEPS lod_rank_table_op) # op_library(array_to_lod_tensor_op DEPS lod_rank_table_op) diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 37bcac4957493..92bd5a0e6d006 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -654,6 +654,10 @@ if (WITH_MKLDNN) add_subdirectory(mkldnn) endif() +if (WITH_IPU) + add_subdirectory(ipu) +endif() + add_subdirectory(ir) if (WITH_TESTING) diff --git a/python/paddle/fluid/tests/unittests/ipu/CMakeLists.txt b/python/paddle/fluid/tests/unittests/ipu/CMakeLists.txt new file mode 100644 index 0000000000000..f71e04c09aa38 --- /dev/null +++ b/python/paddle/fluid/tests/unittests/ipu/CMakeLists.txt @@ -0,0 +1,6 @@ +file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py") +string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") + +foreach(TEST_OP ${TEST_OPS}) + py_test_modules(${TEST_OP} MODULES ${TEST_OP}) +endforeach(TEST_OP)