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

test=develop
revert-22710-feature/integrated_ps_api
Yiqun Liu 5 years ago committed by GitHub
parent 870f465887
commit 4b2227e958

@ -167,7 +167,7 @@ class SequencePoolFunctor<platform::CUDADeviceContext, T> {
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<int>(lod.size()) - 1, 1), 1);
if (pooltype == "MAX") {
sequence_pool_kernel<
T, MaxPoolFunctor<T>><<<grid, threads, 0, context.stream()>>>(
@ -331,7 +331,7 @@ class SequencePoolGradFunctor<platform::CUDADeviceContext, T> {
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<int>(lod.size()) - 1, 1), 1);
if (pooltype == "MAX") {
sequence_pool_grad_kernel<
T, MaxPoolGradFunctor<T>><<<grid, threads, 0, context.stream()>>>(

Loading…
Cancel
Save