未验证 提交 6d067860 编写于 作者: O Ouyang Chao 提交者: GitHub

【PFCC算子性能优化】为Paddle优化adaptive_pooling_op性能 (#45959)

* optimize adaptive_pooling_op (forward)

* fix bug of AdaptiveKernelMaxPool2dWithIdx

* fix bug of AdaptiveKernelPool2D
上级 3ad6994d
此差异已折叠。
...@@ -92,12 +92,12 @@ class AvgPoolGrad { ...@@ -92,12 +92,12 @@ class AvgPoolGrad {
*/ */
HOSTDEVICE inline int AdaptStartIndex(int ph, int input_size, int output_size) { HOSTDEVICE inline int AdaptStartIndex(int ph, int input_size, int output_size) {
return static_cast<int>( return static_cast<int>(
floor(static_cast<double>(ph * input_size) / output_size)); floor(static_cast<float>(ph * input_size) / output_size));
} }
HOSTDEVICE inline int AdaptEndIndex(int ph, int input_size, int output_size) { HOSTDEVICE inline int AdaptEndIndex(int ph, int input_size, int output_size) {
return static_cast<int>( return static_cast<int>(
ceil(static_cast<double>((ph + 1) * input_size) / output_size)); ceil(static_cast<float>((ph + 1) * input_size) / output_size));
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册