Avoid regenerating the gradient index for approx. (#7591)

This commit is contained in:
Jiaming Yuan
2022-01-26 21:41:30 +08:00
committed by GitHub
parent 5d7818e75d
commit e060519d4f
7 changed files with 40 additions and 18 deletions

View File

@@ -17,8 +17,7 @@ void GHistIndexMatrix::PushBatch(SparsePage const &batch,
// block is parallelized on anything other than the batch/block size,
// it should be reassigned
const size_t batch_threads =
std::max(size_t(1), std::min(batch.Size(),
static_cast<size_t>(n_threads)));
std::max(static_cast<size_t>(1), std::min(batch.Size(), static_cast<size_t>(n_threads)));
auto page = batch.GetView();
common::MemStackAllocator<size_t, 128> partial_sums(batch_threads);
size_t *p_part = partial_sums.Get();