From 78b73c8a837ea0603e843a03464ceff234ccf695 Mon Sep 17 00:00:00 2001 From: wangchaochaohu Date: Tue, 23 Feb 2021 12:27:45 +0800 Subject: [PATCH 1/2] fix windows for optimization of elementwise_add Op (#31068) * fix windows for optimization of elementwise_add Op --- paddle/fluid/operators/elementwise/elementwise_add_op.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/elementwise/elementwise_add_op.h b/paddle/fluid/operators/elementwise/elementwise_add_op.h index 41e97a3946695..8c1279a579895 100644 --- a/paddle/fluid/operators/elementwise/elementwise_add_op.h +++ b/paddle/fluid/operators/elementwise/elementwise_add_op.h @@ -315,7 +315,9 @@ class ElementwiseAddGradKernel : public ElemwiseGradKernel { // skip out auto *out = dout; -#ifdef PADDLE_WITH_CUDA +// TODO(@wangchaochaohu, zhouwei35): Fix conv_transpose2d API(dataformat NHWC) +// error in Windows +#if defined(PADDLE_WITH_CUDA) && defined(_LINUX) #ifdef __NVCC__ int axis = ctx.Attr("axis"); From feacd8a55197ae71ef8b1a5ff8a2ce3ab98dd01a Mon Sep 17 00:00:00 2001 From: wangchaochaohu Date: Thu, 25 Feb 2021 11:50:20 +0800 Subject: [PATCH 2/2] fix the branch of code choose (#31200) --- paddle/fluid/operators/elementwise/elementwise_add_op.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/elementwise/elementwise_add_op.h b/paddle/fluid/operators/elementwise/elementwise_add_op.h index 8c1279a579895..c46184f5badbc 100644 --- a/paddle/fluid/operators/elementwise/elementwise_add_op.h +++ b/paddle/fluid/operators/elementwise/elementwise_add_op.h @@ -317,7 +317,7 @@ class ElementwiseAddGradKernel : public ElemwiseGradKernel { // TODO(@wangchaochaohu, zhouwei35): Fix conv_transpose2d API(dataformat NHWC) // error in Windows -#if defined(PADDLE_WITH_CUDA) && defined(_LINUX) +#if defined(PADDLE_WITH_CUDA) && !defined(_WIN32) #ifdef __NVCC__ int axis = ctx.Attr("axis");