From 24447ec5178ad2b81144ee51d6e9bb78844a0923 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Tue, 25 Sep 2018 10:32:19 +0800 Subject: [PATCH] flags (#13541) --- paddle/fluid/inference/api/demo_ci/simple_on_word2vec.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/inference/api/demo_ci/simple_on_word2vec.cc b/paddle/fluid/inference/api/demo_ci/simple_on_word2vec.cc index 03ac79e9edf..360f924810a 100644 --- a/paddle/fluid/inference/api/demo_ci/simple_on_word2vec.cc +++ b/paddle/fluid/inference/api/demo_ci/simple_on_word2vec.cc @@ -18,6 +18,8 @@ limitations under the License. */ #include #include + +#include #include #include //NOLINT #include "paddle/fluid/inference/paddle_inference_api.h" @@ -67,7 +69,8 @@ void Main(bool use_gpu) { 0.000932706}; const size_t num_elements = outputs.front().data.length() / sizeof(float); // The outputs' buffers are in CPU memory. - for (size_t i = 0; i < std::min(5UL, num_elements); i++) { + for (size_t i = 0; i < std::min(static_cast(5), num_elements); + i++) { PADDLE_ENFORCE(static_cast(outputs.front().data.data())[i], result[i]); } @@ -113,7 +116,8 @@ void MainThreads(int num_threads, bool use_gpu) { const size_t num_elements = outputs.front().data.length() / sizeof(float); // The outputs' buffers are in CPU memory. - for (size_t i = 0; i < std::min(5UL, num_elements); i++) { + for (size_t i = 0; i < std::min(static_cast(5), num_elements); + i++) { PADDLE_ENFORCE(static_cast(outputs.front().data.data())[i], result[i]); } -- GitLab