From 4b2227e95803932e33a0de707e38e0e4c49a7c8e Mon Sep 17 00:00:00 2001 From: Yiqun Liu Date: Mon, 10 Feb 2020 14:42:09 +0800 Subject: [PATCH] Fix dismatch of std::max's arguments type on windows. (#22507) test=develop --- paddle/fluid/operators/math/sequence_pooling.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/math/sequence_pooling.cu b/paddle/fluid/operators/math/sequence_pooling.cu index 124028ee1bc..422b06c70eb 100644 --- a/paddle/fluid/operators/math/sequence_pooling.cu +++ b/paddle/fluid/operators/math/sequence_pooling.cu @@ -167,7 +167,7 @@ class SequencePoolFunctor { auto& lod = input.lod()[lod_level - 1]; const size_t item_dim = output->numel() / output->dims()[0]; dim3 threads(1024, 1); - dim3 grid(std::max(lod.size() - 1, 1UL), 1); + dim3 grid(std::max(static_cast(lod.size()) - 1, 1), 1); if (pooltype == "MAX") { sequence_pool_kernel< T, MaxPoolFunctor><<>>( @@ -331,7 +331,7 @@ class SequencePoolGradFunctor { auto& lod = in_grad->lod()[lod_level - 1]; const size_t item_dim = in_grad->numel() / in_grad->dims()[0]; dim3 threads(1024, 1); - dim3 grid(std::max(lod.size() - 1, 1UL), 1); + dim3 grid(std::max(static_cast(lod.size()) - 1, 1), 1); if (pooltype == "MAX") { sequence_pool_grad_kernel< T, MaxPoolGradFunctor><<>>( -- GitLab