From 2cf061f2d1b8f1184ed6d76ea0aeaac6acadafa4 Mon Sep 17 00:00:00 2001 From: Yan Chunwei Date: Sat, 1 Jun 2019 13:38:10 +0800 Subject: [PATCH] fix mobile compile (#17777) --- paddle/fluid/lite/api/CMakeLists.txt | 3 +++ paddle/fluid/lite/model_parser/CMakeLists.txt | 15 +++++++++------ paddle/fluid/lite/operators/CMakeLists.txt | 2 +- paddle/fluid/lite/operators/fc_op_test.cc | 6 +++++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/lite/api/CMakeLists.txt b/paddle/fluid/lite/api/CMakeLists.txt index c079c387aee..c95e7f65b86 100644 --- a/paddle/fluid/lite/api/CMakeLists.txt +++ b/paddle/fluid/lite/api/CMakeLists.txt @@ -31,6 +31,7 @@ set(LITE_DEMO_INSTALL_DIR "${THIRD_PARTY_PATH}/inference_demo" CACHE STRING # ${ops_lite} ${host_kernels} ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model # --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL) + if((NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) AND WITH_TESTING) lite_cc_test(test_cxx_api_lite SRCS cxx_api_test.cc DEPS cxx_api_lite model_parser_lite target_wrapper_host @@ -38,10 +39,12 @@ if((NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) AND WITH_TESTING) PROFILE_DEPS basic_profiler_lite ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL) + lite_download_and_uncompress(${LITE_MODEL_DIR} ${LITE_URL} "lite_naive_model.tar.gz") add_dependencies(test_cxx_api_lite extern_lite_download_lite_naive_model_tar_gz) endif() + lite_cc_binary(cxx_api_lite_bin SRCS cxx_api_bin.cc DEPS cxx_api_lite diff --git a/paddle/fluid/lite/model_parser/CMakeLists.txt b/paddle/fluid/lite/model_parser/CMakeLists.txt index 67b50f4f70b..9fe73c49c61 100644 --- a/paddle/fluid/lite/model_parser/CMakeLists.txt +++ b/paddle/fluid/lite/model_parser/CMakeLists.txt @@ -1,11 +1,14 @@ #cc_library(runtime_lite SRCS runtime.cc) -lite_cc_test(test_model_parser_lite SRCS model_parser_test.cc - DEPS model_parser_lite framework_proto_lite - ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model) -if(WITH_TESTING) -add_dependencies(test_model_parser_lite extern_lite_download_lite_naive_model_tar_gz) -endif(WITH_TESTING) +#TODO(Superjomn) enable it again. +if(NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) + lite_cc_test(test_model_parser_lite SRCS model_parser_test.cc + DEPS model_parser_lite framework_proto_lite + ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model) + if(WITH_TESTING) + add_dependencies(test_model_parser_lite extern_lite_download_lite_naive_model_tar_gz) + endif(WITH_TESTING) +endif() if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) diff --git a/paddle/fluid/lite/operators/CMakeLists.txt b/paddle/fluid/lite/operators/CMakeLists.txt index 13b1c9f7668..86bc014821c 100644 --- a/paddle/fluid/lite/operators/CMakeLists.txt +++ b/paddle/fluid/lite/operators/CMakeLists.txt @@ -32,5 +32,5 @@ set(ops_lite dropout_op_lite PARENT_SCOPE) -lite_cc_test(test_fc_op_lite SRCS fc_op_test.cc DEPS fc_op_lite memory_lite fc_compute_x86) +lite_cc_test(test_fc_op_lite SRCS fc_op_test.cc DEPS fc_op_lite memory_lite X86_DEPS fc_compute_x86) lite_cc_test(test_softmax_op_lite SRCS softmax_op_test.cc DEPS softmax_op_lite memory_lite) diff --git a/paddle/fluid/lite/operators/fc_op_test.cc b/paddle/fluid/lite/operators/fc_op_test.cc index 0d12024acab..9d8c4be0438 100644 --- a/paddle/fluid/lite/operators/fc_op_test.cc +++ b/paddle/fluid/lite/operators/fc_op_test.cc @@ -66,7 +66,11 @@ TEST(fc_op_lite, test) { } // namespace operators } // namespace lite } // namespace paddle -#ifdef LITE_WITH_X86 +#ifdef LITE_WITH_X86 USE_LITE_KERNEL(fc, kX86, kFloat, kNCHW, def); #endif + +#ifdef LITE_WITH_ARM +USE_LITE_KERNEL(fc, kARM, kFloat, kNCHW, def); +#endif -- GitLab