Merge branch 'master' into sync-2024Jan24

This commit is contained in:
Hui Liu
2024-02-01 14:41:48 -08:00
99 changed files with 2476 additions and 283 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2023 by XGBoost Contributors
* Copyright 2023-2024 by XGBoost Contributors
*/
#ifndef XGBOOST_TREE_HIST_HIST_CACHE_H_
#define XGBOOST_TREE_HIST_HIST_CACHE_H_
@@ -48,11 +48,13 @@ class BoundedHistCollection {
BoundedHistCollection() = default;
common::GHistRow operator[](std::size_t idx) {
auto offset = node_map_.at(idx);
return common::Span{data_->data(), data_->size()}.subspan(offset, n_total_bins_);
return common::Span{data_->data(), static_cast<size_t>(data_->size())}.subspan(
offset, n_total_bins_);
}
common::ConstGHistRow operator[](std::size_t idx) const {
auto offset = node_map_.at(idx);
return common::Span{data_->data(), data_->size()}.subspan(offset, n_total_bins_);
return common::Span{data_->data(), static_cast<size_t>(data_->size())}.subspan(
offset, n_total_bins_);
}
void Reset(bst_bin_t n_total_bins, std::size_t n_cached_nodes) {
n_total_bins_ = n_total_bins;