/*! * Copyright 2021 XGBoost contributors */ #include #include #include "../helpers.h" #include "../../../src/data/gradient_index.h" namespace xgboost { namespace data { TEST(GradientIndex, ExternalMemory) { std::unique_ptr dmat = CreateSparsePageDMatrix(10000); std::vector base_rowids; std::vector hessian(dmat->Info().num_row_, 1); for (auto const& page : dmat->GetBatches({0, 64, hessian})) { base_rowids.push_back(page.base_rowid); } size_t i = 0; for (auto const& page : dmat->GetBatches()) { ASSERT_EQ(base_rowids[i], page.base_rowid); ++i; } } } // namespace data } // namespace xgboost