Skip to content

Commit 21ee305

Browse files
committed
clean some CMakeLists
test=develop
1 parent b31905c commit 21ee305

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

paddle/fluid/framework/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ if(WITH_DISTRIBUTE)
149149
set_source_files_properties(executor.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
150150
else()
151151
cc_library(executor SRCS executor.cc DEPS op_registry device_context scope framework_proto glog lod_rank_table feed_fetch_method graph_to_program_pass)
152-
cc_test(test_naive_executor SRCS naive_executor_test.cc DEPS naive_executor op_registry device_context scope framework_proto glog lod_rank_table feed_fetch_method graph_to_program_pass elementwise_add_op)
152+
cc_test(test_naive_executor SRCS naive_executor_test.cc DEPS naive_executor elementwise_add_op)
153153
endif()
154154

155155
if (NOT WIN32)

paddle/fluid/inference/analysis/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ cc_test(test_node SRCS node_tester.cc DEPS analysis)
2020
cc_test(test_dot SRCS dot_tester.cc DEPS analysis)
2121
cc_binary(inference_analyzer SRCS analyzer_main.cc DEPS analysis paddle_fluid)
2222

23-
set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests)
24-
2523
function (inference_analysis_test TARGET)
2624
if(WITH_TESTING)
2725
set(options "")

paddle/fluid/inference/api/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function(inference_api_test TARGET_NAME)
3131
set(multiValueArgs ARGS)
3232
cmake_parse_arguments(inference_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
3333

34-
set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests)
3534
cc_test(${TARGET_NAME}
3635
SRCS ${inference_test_SRC}
3736
DEPS "${inference_deps}"

paddle/fluid/inference/tests/api/analyzer_resnet50_tester.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ TEST(Analyzer_resnet50, fuse_statis) {
7474
AnalysisConfig cfg;
7575
SetConfig(&cfg);
7676
int num_ops;
77-
GetFuseStatis(cfg, &num_ops);
77+
auto predictor = CreatePaddlePredictor<AnalysisConfig>(cfg);
78+
auto fuse_statis = GetFuseStatis(
79+
static_cast<AnalysisPredictor *>(predictor.get()), &num_ops);
80+
ASSERT_TRUE(fuse_statis.count("fc_fuse"));
81+
EXPECT_EQ(fuse_statis.at("fc_fuse"), 1);
7882
}
7983

8084
// Compare result of NativeConfig and AnalysisConfig

paddle/fluid/inference/tests/api/analyzer_rnn1_tester.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,11 @@ TEST(Analyzer_rnn1, multi_thread) {
271271

272272
std::vector<std::vector<PaddleTensor>> input_slots_all;
273273
SetInput(&input_slots_all);
274-
TestPrediction(cfg, input_slots_all, &outputs, FLAGS_num_threads);
274+
TestPrediction(cfg, input_slots_all, &outputs, 4 /* multi_thread */);
275275
}
276276

277-
bool CompareTensors(framework::Scope &a_scope, framework::Scope &b_scope,
277+
bool CompareTensors(const framework::Scope &a_scope,
278+
const framework::Scope &b_scope,
278279
const std::vector<std::string> &tensors) {
279280
for (auto &x : tensors) {
280281
auto *a_var = a_scope.FindVar(x);

paddle/fluid/inference/tests/book/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ function(inference_test TARGET_NAME)
44
set(multiValueArgs ARGS)
55
cmake_parse_arguments(inference_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
66

7-
set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests)
87
set(arg_list "")
98
if(inference_test_ARGS)
109
foreach(arg ${inference_test_ARGS})

paddle/fluid/train/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ function(train_test TARGET_NAME)
44
set(multiValueArgs ARGS)
55
cmake_parse_arguments(train_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
66

7-
set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests)
87
set(arg_list "")
98
if(train_test_ARGS)
109
foreach(arg ${train_test_ARGS})

python/paddle/fluid/tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set(PYTHON_TESTS_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "python tests directory")
12
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
23
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
34

0 commit comments

Comments
 (0)