未验证 提交 0057c12d 编写于 作者: D danleifeng 提交者: GitHub

fix compile error when pslib use cpu branch;test=develop (#37248)

上级 1223238f
...@@ -1335,7 +1335,7 @@ void FleetWrapper::SaveModelOneTablePrefix(const uint64_t table_id, ...@@ -1335,7 +1335,7 @@ void FleetWrapper::SaveModelOneTablePrefix(const uint64_t table_id,
} }
void FleetWrapper::SetDate(const uint64_t table_id, const std::string& date) { 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); assert(date.size() == 8);
int year = std::stoi(date.substr(0, 4)); int year = std::stoi(date.substr(0, 4));
int month = std::stoi(date.substr(4, 2)); int month = std::stoi(date.substr(4, 2));
...@@ -1353,7 +1353,7 @@ void FleetWrapper::SetDate(const uint64_t table_id, const std::string& date) { ...@@ -1353,7 +1353,7 @@ void FleetWrapper::SetDate(const uint64_t table_id, const std::string& date) {
LOG(ERROR) << "setdate : " << date << " failed"; LOG(ERROR) << "setdate : " << date << " failed";
} }
#else #else
VLOG(0) << "FleetWrapper::SetDate does nothing when no pslib"; VLOG(0) << "FleetWrapper::SetDate does nothing when no pslib-gpu";
#endif #endif
} }
...@@ -1371,7 +1371,7 @@ void FleetWrapper::PrintTableStat(const uint64_t table_id) { ...@@ -1371,7 +1371,7 @@ void FleetWrapper::PrintTableStat(const uint64_t table_id) {
} }
void FleetWrapper::SetFileNumOneShard(const uint64_t table_id, int file_num) { 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 = auto ret =
pslib_ptr_->_worker_ptr->set_file_num_one_shard(table_id, file_num); pslib_ptr_->_worker_ptr->set_file_num_one_shard(table_id, file_num);
ret.wait(); ret.wait();
...@@ -1380,7 +1380,7 @@ void FleetWrapper::SetFileNumOneShard(const uint64_t table_id, int file_num) { ...@@ -1380,7 +1380,7 @@ void FleetWrapper::SetFileNumOneShard(const uint64_t table_id, int file_num) {
LOG(ERROR) << "set_file_num_one_shard failed"; LOG(ERROR) << "set_file_num_one_shard failed";
} }
#else #else
VLOG(0) << "FleetWrapper::SetFileNumOneShard does nothing when no pslib"; VLOG(0) << "FleetWrapper::SetFileNumOneShard does nothing when no pslib-gpu";
#endif #endif
} }
......
...@@ -191,7 +191,7 @@ void PSGPUWrapper::BuildPull(std::shared_ptr<HeterContext> gpu_task) { ...@@ -191,7 +191,7 @@ void PSGPUWrapper::BuildPull(std::shared_ptr<HeterContext> gpu_task) {
auto fleet_ptr = paddle::distributed::Communicator::GetInstance(); auto fleet_ptr = paddle::distributed::Communicator::GetInstance();
#endif #endif
#ifdef PADDLE_WITH_PSLIB #if (defined PADDLE_WITH_PSLIB) && (defined PADDLE_WITH_HETERPS)
// get day_id: day nums from 1970 // get day_id: day nums from 1970
struct std::tm b; struct std::tm b;
b.tm_year = year_ - 1900; b.tm_year = year_ - 1900;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册