提交 4b2227e9 编写于 作者: Y Yiqun Liu 提交者: GitHub

Fix dismatch of std::max's arguments type on windows. (#22507)

test=develop
上级 870f4658
...@@ -167,7 +167,7 @@ class SequencePoolFunctor<platform::CUDADeviceContext, T> { ...@@ -167,7 +167,7 @@ class SequencePoolFunctor<platform::CUDADeviceContext, T> {
auto& lod = input.lod()[lod_level - 1]; auto& lod = input.lod()[lod_level - 1];
const size_t item_dim = output->numel() / output->dims()[0]; const size_t item_dim = output->numel() / output->dims()[0];
dim3 threads(1024, 1); dim3 threads(1024, 1);
dim3 grid(std::max(lod.size() - 1, 1UL), 1); dim3 grid(std::max(static_cast<int>(lod.size()) - 1, 1), 1);
if (pooltype == "MAX") { if (pooltype == "MAX") {
sequence_pool_kernel< sequence_pool_kernel<
T, MaxPoolFunctor<T>><<<grid, threads, 0, context.stream()>>>( T, MaxPoolFunctor<T>><<<grid, threads, 0, context.stream()>>>(
...@@ -331,7 +331,7 @@ class SequencePoolGradFunctor<platform::CUDADeviceContext, T> { ...@@ -331,7 +331,7 @@ class SequencePoolGradFunctor<platform::CUDADeviceContext, T> {
auto& lod = in_grad->lod()[lod_level - 1]; auto& lod = in_grad->lod()[lod_level - 1];
const size_t item_dim = in_grad->numel() / in_grad->dims()[0]; const size_t item_dim = in_grad->numel() / in_grad->dims()[0];
dim3 threads(1024, 1); dim3 threads(1024, 1);
dim3 grid(std::max(lod.size() - 1, 1UL), 1); dim3 grid(std::max(static_cast<int>(lod.size()) - 1, 1), 1);
if (pooltype == "MAX") { if (pooltype == "MAX") {
sequence_pool_grad_kernel< sequence_pool_grad_kernel<
T, MaxPoolGradFunctor<T>><<<grid, threads, 0, context.stream()>>>( T, MaxPoolGradFunctor<T>><<<grid, threads, 0, context.stream()>>>(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册