From 07a65aa376239da456e821151f1756001f1e3c4f Mon Sep 17 00:00:00 2001 From: Wilber Date: Mon, 29 Jun 2020 10:20:30 +0800 Subject: [PATCH] cherry-pick. test=develop test=release/1.8 (#25156) --- cmake/external/lite.cmake | 1 + paddle/fluid/operators/sync_batch_norm_op.cu.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/external/lite.cmake b/cmake/external/lite.cmake index 323a8ddc729..70c11d37f91 100644 --- a/cmake/external/lite.cmake +++ b/cmake/external/lite.cmake @@ -91,3 +91,4 @@ endfunction() external_lite_static_libs(lite_full_static ${LITE_BINARY_DIR}/inference_lite_lib/cxx/lib/libpaddle_full_api_shared.so) add_definitions(-DPADDLE_WITH_LITE) +add_definitions(-DLITE_WITH_LOG) diff --git a/paddle/fluid/operators/sync_batch_norm_op.cu.h b/paddle/fluid/operators/sync_batch_norm_op.cu.h index cfb9e16942c..7ccdb74a0f3 100644 --- a/paddle/fluid/operators/sync_batch_norm_op.cu.h +++ b/paddle/fluid/operators/sync_batch_norm_op.cu.h @@ -186,7 +186,7 @@ void SyncBatchNormFunctor(const framework::ExecutionContext &ctx, auto gplace = boost::get(ctx.GetPlace()); memory::Copy(platform::CPUPlace(), c_g_st_d, gplace, stats, bytes, 0); -#ifndef WIN32 +#ifdef PADDLE_WITH_NCCL auto *comm = dev_ctx.nccl_comm(); if (comm) { int dtype = platform::ToNCCLDataType(mean_out->type()); @@ -460,7 +460,7 @@ void SyncBatchNormGradFunctor( dy_d, x_d, saved_mean, N, fsize, C, stats); } -#ifndef WIN32 +#ifdef PADDLE_WITH_NCCL auto *comm = dev_ctx.nccl_comm(); if (comm) { int dtype = platform::ToNCCLDataType(scale->type()); -- GitLab