From d223a24904cff0746ecc128111f3e0c6ba588c3e Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Sun, 5 Apr 2020 16:55:49 +0800 Subject: [PATCH] Fix inplace_abn compile error on Windows (#23464) * fix inplace_abn windows compile error. test=develop --- paddle/fluid/framework/ir/sync_batch_norm_pass.cc | 4 ++++ paddle/fluid/operators/CMakeLists.txt | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/ir/sync_batch_norm_pass.cc b/paddle/fluid/framework/ir/sync_batch_norm_pass.cc index 90c1b23fe4..222c73761b 100644 --- a/paddle/fluid/framework/ir/sync_batch_norm_pass.cc +++ b/paddle/fluid/framework/ir/sync_batch_norm_pass.cc @@ -24,6 +24,10 @@ namespace ir { class SyncBatchNormPass : public Pass { protected: void ApplyImpl(ir::Graph *graph) const override { +#if defined(_WIN32) + VLOG(3) << "Not use synchronize batch norm on windows"; + return; +#endif VLOG(3) << "Use synchronize batch norm"; for (const Node *n : graph->Nodes()) { if (n->IsOp() && n->Op()) { diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index ea0c0b82be..f59e73d142 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -68,12 +68,8 @@ if (WITH_GPU) else() op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale) endif() - if (NOT WIN32) - if (WITH_NCCL) - op_library(sync_batch_norm_op) - file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(sync_batch_norm);\n") - endif() - endif() + op_library(sync_batch_norm_op) + file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(sync_batch_norm);\n") else() op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale) endif() -- GitLab