From 0eb4d990c4402a4aeff091028ef08a77401deb66 Mon Sep 17 00:00:00 2001 From: xujiaqi01 <173596896@qq.com> Date: Wed, 18 Dec 2019 12:56:52 +0800 Subject: [PATCH] fix compiled error when with_pslib=on (#21769) * fix compiled error of butil when with_pslib=on and with_testing=on * test=develop --- paddle/fluid/framework/async_executor.h | 3 ++- paddle/fluid/framework/device_worker.h | 3 ++- paddle/fluid/framework/dist_multi_trainer.cc | 1 + paddle/fluid/framework/downpour_worker.cc | 1 + paddle/fluid/framework/pull_dense_worker.cc | 1 + paddle/fluid/pybind/fleet_wrapper_py.cc | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/async_executor.h b/paddle/fluid/framework/async_executor.h index 7b59e1b11c..b0c6c8a016 100644 --- a/paddle/fluid/framework/async_executor.h +++ b/paddle/fluid/framework/async_executor.h @@ -28,13 +28,14 @@ limitations under the License. */ #include "paddle/fluid/framework/data_set.h" #include "paddle/fluid/framework/executor.h" #include "paddle/fluid/framework/executor_thread_worker.h" -#include "paddle/fluid/framework/fleet/fleet_wrapper.h" #include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/scope.h" namespace paddle { namespace framework { +class FleetWrapper; + inline double current_realtime() { #if !defined(_WIN32) struct timespec tp; diff --git a/paddle/fluid/framework/device_worker.h b/paddle/fluid/framework/device_worker.h index 2ee09a7b83..a7ee0fd26b 100644 --- a/paddle/fluid/framework/device_worker.h +++ b/paddle/fluid/framework/device_worker.h @@ -27,7 +27,6 @@ limitations under the License. */ #include #include "paddle/fluid/framework/data_feed.h" -#include "paddle/fluid/framework/fleet/fleet_wrapper.h" #include "paddle/fluid/framework/lod_tensor.h" #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/program_desc.h" @@ -46,6 +45,8 @@ limitations under the License. */ namespace paddle { namespace framework { +class FleetWrapper; + #define SEC_LOG \ VLOG(3) << "[s" << section_id_ << "p" << pipeline_id_ << "t" << thread_id_ \ << "]: " diff --git a/paddle/fluid/framework/dist_multi_trainer.cc b/paddle/fluid/framework/dist_multi_trainer.cc index 9057549ed5..879382e3f1 100644 --- a/paddle/fluid/framework/dist_multi_trainer.cc +++ b/paddle/fluid/framework/dist_multi_trainer.cc @@ -18,6 +18,7 @@ limitations under the License. */ #include "paddle/fluid/framework/data_feed_factory.h" #include "paddle/fluid/framework/data_set.h" #include "paddle/fluid/framework/device_worker_factory.h" +#include "paddle/fluid/framework/fleet/fleet_wrapper.h" #include "paddle/fluid/framework/trainer.h" namespace paddle { diff --git a/paddle/fluid/framework/downpour_worker.cc b/paddle/fluid/framework/downpour_worker.cc index 135667cc06..dd56b58c10 100644 --- a/paddle/fluid/framework/downpour_worker.cc +++ b/paddle/fluid/framework/downpour_worker.cc @@ -14,6 +14,7 @@ limitations under the License. */ #include "paddle/fluid/framework/device_worker.h" #include "paddle/fluid/framework/device_worker_factory.h" +#include "paddle/fluid/framework/fleet/fleet_wrapper.h" #include "paddle/fluid/platform/cpu_helper.h" #include "paddle/fluid/string/string_helper.h" diff --git a/paddle/fluid/framework/pull_dense_worker.cc b/paddle/fluid/framework/pull_dense_worker.cc index 1956885d66..ecf0afb68e 100644 --- a/paddle/fluid/framework/pull_dense_worker.cc +++ b/paddle/fluid/framework/pull_dense_worker.cc @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include #include "paddle/fluid/framework/device_worker.h" +#include "paddle/fluid/framework/fleet/fleet_wrapper.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/pybind/fleet_wrapper_py.cc b/paddle/fluid/pybind/fleet_wrapper_py.cc index 780fa99d2c..746f2bbea6 100644 --- a/paddle/fluid/pybind/fleet_wrapper_py.cc +++ b/paddle/fluid/pybind/fleet_wrapper_py.cc @@ -29,6 +29,7 @@ limitations under the License. */ #include "paddle/fluid/framework/async_executor.h" #include "paddle/fluid/framework/data_feed.h" #include "paddle/fluid/framework/data_feed.pb.h" +#include "paddle/fluid/framework/fleet/fleet_wrapper.h" #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/inference/io.h" #include "paddle/fluid/platform/place.h" -- GitLab