From 068d905e1e77cc05a3d2ea6c2ddefd6f8068aa7e Mon Sep 17 00:00:00 2001 From: wangchaochaohu Date: Fri, 18 Dec 2020 16:06:21 +0800 Subject: [PATCH] fix the shape choose of vectorize for cuda --- 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 91b6750c597..db5c6eca6e5 100644 --- a/paddle/fluid/operators/elementwise/elementwise_add_op.h +++ b/paddle/fluid/operators/elementwise/elementwise_add_op.h @@ -348,7 +348,7 @@ class ElementwiseAddGradKernel : public ElemwiseGradKernel { } else { size_t thread_nums = 1024; size_t block_nums = (width + thread_nums - 1) / thread_nums; - int vec_size = VectorizedSize(dx_data); + int vec_size = VectorizedSize(dout_data); if (vec_size == 4 && width % 4 == 0) { block_nums = (width / vec_size + thread_nums - 1) / thread_nums; VecMatrixReduceLongWidth