Skip to content

Commit 24447ec

Browse files
authored
flags (#13541)
1 parent 4fd5eb2 commit 24447ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

paddle/fluid/inference/api/demo_ci/simple_on_word2vec.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ limitations under the License. */
1818

1919
#include <gflags/gflags.h>
2020
#include <glog/logging.h>
21+
22+
#include <algorithm>
2123
#include <memory>
2224
#include <thread> //NOLINT
2325
#include "paddle/fluid/inference/paddle_inference_api.h"
@@ -67,7 +69,8 @@ void Main(bool use_gpu) {
6769
0.000932706};
6870
const size_t num_elements = outputs.front().data.length() / sizeof(float);
6971
// The outputs' buffers are in CPU memory.
70-
for (size_t i = 0; i < std::min(5UL, num_elements); i++) {
72+
for (size_t i = 0; i < std::min(static_cast<size_t>(5), num_elements);
73+
i++) {
7174
PADDLE_ENFORCE(static_cast<float*>(outputs.front().data.data())[i],
7275
result[i]);
7376
}
@@ -113,7 +116,8 @@ void MainThreads(int num_threads, bool use_gpu) {
113116
const size_t num_elements =
114117
outputs.front().data.length() / sizeof(float);
115118
// The outputs' buffers are in CPU memory.
116-
for (size_t i = 0; i < std::min(5UL, num_elements); i++) {
119+
for (size_t i = 0; i < std::min(static_cast<size_t>(5), num_elements);
120+
i++) {
117121
PADDLE_ENFORCE(static_cast<float*>(outputs.front().data.data())[i],
118122
result[i]);
119123
}

0 commit comments

Comments
 (0)