From 26c0ecc873b6db636c501c8889c14b761454922e Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Mon, 21 Sep 2020 14:42:41 +0800 Subject: [PATCH] [BUG FIX] Fix the issue that light_api_shared.so can not work on full_publish compiling (#4359) --- lite/api/CMakeLists.txt | 1 - lite/api/benchmark.cc | 2 -- lite/api/light_api_impl.cc | 4 ++++ lite/api/model_test.cc | 2 -- lite/api/paddle_api_test.cc | 2 -- lite/core/mir/subgraph/subgraph_pass_test.cc | 2 -- 6 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index fb8784cb20..b3c243b63c 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -15,7 +15,6 @@ if ((NOT LITE_ON_TINY_PUBLISH) AND (LITE_WITH_CUDA OR LITE_WITH_X86 OR LITE_WITH #full api dynamic library lite_cc_library(paddle_full_api_shared SHARED SRCS paddle_api.cc light_api.cc cxx_api.cc cxx_api_impl.cc light_api_impl.cc DEPS paddle_api paddle_api_light paddle_api_full) - target_sources(paddle_full_api_shared PUBLIC ${__lite_cc_files}) add_dependencies(paddle_full_api_shared op_list_h kernel_list_h framework_proto op_registry fbs_headers) target_link_libraries(paddle_full_api_shared framework_proto op_registry) if(LITE_WITH_X86) diff --git a/lite/api/benchmark.cc b/lite/api/benchmark.cc index 1dccbb49a4..b72a6e6bdb 100644 --- a/lite/api/benchmark.cc +++ b/lite/api/benchmark.cc @@ -30,8 +30,6 @@ #include #include #include "lite/api/paddle_api.h" -#include "lite/api/paddle_use_kernels.h" -#include "lite/api/paddle_use_ops.h" #include "lite/core/device_info.h" #include "lite/utils/cp_logging.h" #include "lite/utils/string.h" diff --git a/lite/api/light_api_impl.cc b/lite/api/light_api_impl.cc index c9c34377e2..3c5be7b9cd 100644 --- a/lite/api/light_api_impl.cc +++ b/lite/api/light_api_impl.cc @@ -17,6 +17,10 @@ #include "lite/api/paddle_api.h" #include "lite/core/version.h" #include "lite/model_parser/model_parser.h" +#ifndef LITE_ON_TINY_PUBLISH +#include "lite/api/paddle_use_kernels.h" +#include "lite/api/paddle_use_ops.h" +#endif namespace paddle { namespace lite { diff --git a/lite/api/model_test.cc b/lite/api/model_test.cc index 9057528087..3cce247750 100644 --- a/lite/api/model_test.cc +++ b/lite/api/model_test.cc @@ -25,8 +25,6 @@ #include "lite/core/profile/basic_profiler.h" #endif // LITE_WITH_PROFILE #include -#include "lite/api/paddle_use_kernels.h" -#include "lite/api/paddle_use_ops.h" using paddle::lite::profile::Timer; diff --git a/lite/api/paddle_api_test.cc b/lite/api/paddle_api_test.cc index c381546dfb..9176ce0eb1 100644 --- a/lite/api/paddle_api_test.cc +++ b/lite/api/paddle_api_test.cc @@ -15,8 +15,6 @@ #include "lite/api/paddle_api.h" #include #include -#include "lite/api/paddle_use_kernels.h" -#include "lite/api/paddle_use_ops.h" #include "lite/utils/cp_logging.h" #include "lite/utils/io.h" diff --git a/lite/core/mir/subgraph/subgraph_pass_test.cc b/lite/core/mir/subgraph/subgraph_pass_test.cc index 5a57623b0c..1a615838e3 100644 --- a/lite/core/mir/subgraph/subgraph_pass_test.cc +++ b/lite/core/mir/subgraph/subgraph_pass_test.cc @@ -17,8 +17,6 @@ #include #include "lite/api/paddle_api.h" -#include "lite/api/paddle_use_kernels.h" -#include "lite/api/paddle_use_ops.h" #include "lite/api/test_helper.h" #include "lite/utils/cp_logging.h" #include "lite/utils/string.h" -- GitLab