From 8754cbd1f24b1e639653f56f23563d001cf444fc Mon Sep 17 00:00:00 2001 From: WangXi Date: Sun, 15 Dec 2019 16:37:18 +0800 Subject: [PATCH] fix std::min type in nan_inf, test=develop (#21725) --- paddle/fluid/framework/details/nan_inf_utils_detail.cu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/nan_inf_utils_detail.cu b/paddle/fluid/framework/details/nan_inf_utils_detail.cu index 0317e55909..44668e491e 100644 --- a/paddle/fluid/framework/details/nan_inf_utils_detail.cu +++ b/paddle/fluid/framework/details/nan_inf_utils_detail.cu @@ -167,7 +167,9 @@ void TensorCheckerVisitor::apply( } const size_t threads = 1024; - size_t blocks = std::min(128ul, (tensor_.numel() + threads - 1) / threads); + size_t blocks = + std::min(static_cast(128), + static_cast((tensor_.numel() + threads - 1) / threads)); CheckNanInfKernel<<stream()>>>( tensor_.data(), tensor_.numel(), print_num, gpu_str_ptr); } -- GitLab