Skip to content

Commit

Permalink
Use div roundup instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jun 1, 2021
1 parent dab1750 commit 9701e60
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/predictor/cpu_predictor.cc
Expand Up @@ -187,9 +187,7 @@ void PredictBatchByBlockOfRowsKernel(
// parallel over local batch
const auto nsize = static_cast<bst_omp_uint>(batch.Size());
const int num_feature = model.learner_model_param->num_feature;
const bst_omp_uint n_blocks =
(nsize) / block_of_rows_size + !!((nsize) % block_of_rows_size);
CHECK_EQ(common::DivRoundUp(nsize, block_of_rows_size), n_blocks);
omp_ulong n_blocks = common::DivRoundUp(nsize, block_of_rows_size);

common::ParallelFor(n_blocks, [&](bst_omp_uint block_id) {
const size_t batch_offset = block_id * block_of_rows_size;
Expand Down

0 comments on commit 9701e60

Please sign in to comment.