From 0057c12de62846af0885ecf58fe9c251ae7e0524 Mon Sep 17 00:00:00 2001 From: danleifeng <52735331+danleifeng@users.noreply.github.com> Date: Wed, 17 Nov 2021 14:36:39 +0800 Subject: [PATCH] fix compile error when pslib use cpu branch;test=develop (#37248) --- paddle/fluid/framework/fleet/fleet_wrapper.cc | 8 ++++---- paddle/fluid/framework/fleet/ps_gpu_wrapper.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/framework/fleet/fleet_wrapper.cc b/paddle/fluid/framework/fleet/fleet_wrapper.cc index 7aeb9eaf3f..66c043e137 100644 --- a/paddle/fluid/framework/fleet/fleet_wrapper.cc +++ b/paddle/fluid/framework/fleet/fleet_wrapper.cc @@ -1335,7 +1335,7 @@ void FleetWrapper::SaveModelOneTablePrefix(const uint64_t table_id, } void FleetWrapper::SetDate(const uint64_t table_id, const std::string& date) { -#ifdef PADDLE_WITH_PSLIB +#if (defined PADDLE_WITH_PSLIB) && (defined PADDLE_WITH_HETERPS) assert(date.size() == 8); int year = std::stoi(date.substr(0, 4)); int month = std::stoi(date.substr(4, 2)); @@ -1353,7 +1353,7 @@ void FleetWrapper::SetDate(const uint64_t table_id, const std::string& date) { LOG(ERROR) << "setdate : " << date << " failed"; } #else - VLOG(0) << "FleetWrapper::SetDate does nothing when no pslib"; + VLOG(0) << "FleetWrapper::SetDate does nothing when no pslib-gpu"; #endif } @@ -1371,7 +1371,7 @@ void FleetWrapper::PrintTableStat(const uint64_t table_id) { } void FleetWrapper::SetFileNumOneShard(const uint64_t table_id, int file_num) { -#ifdef PADDLE_WITH_PSLIB +#if (defined PADDLE_WITH_PSLIB) && (defined PADDLE_WITH_HETERPS) auto ret = pslib_ptr_->_worker_ptr->set_file_num_one_shard(table_id, file_num); ret.wait(); @@ -1380,7 +1380,7 @@ void FleetWrapper::SetFileNumOneShard(const uint64_t table_id, int file_num) { LOG(ERROR) << "set_file_num_one_shard failed"; } #else - VLOG(0) << "FleetWrapper::SetFileNumOneShard does nothing when no pslib"; + VLOG(0) << "FleetWrapper::SetFileNumOneShard does nothing when no pslib-gpu"; #endif } diff --git a/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc b/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc index 0d0c9048d0..7ed35467c5 100644 --- a/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc +++ b/paddle/fluid/framework/fleet/ps_gpu_wrapper.cc @@ -191,7 +191,7 @@ void PSGPUWrapper::BuildPull(std::shared_ptr gpu_task) { auto fleet_ptr = paddle::distributed::Communicator::GetInstance(); #endif -#ifdef PADDLE_WITH_PSLIB +#if (defined PADDLE_WITH_PSLIB) && (defined PADDLE_WITH_HETERPS) // get day_id: day nums from 1970 struct std::tm b; b.tm_year = year_ - 1900; -- GitLab