| 456 | } |
| 457 | |
| 458 | auto MakeExtMemForTest(bst_idx_t n_samples, bst_feature_t n_features, Json dconfig) { |
| 459 | std::size_t n_batches{4}; |
| 460 | NumpyArrayIterForTest iter_0{0.0f, n_samples, n_features, n_batches}; |
| 461 | std::string s_dconfig; |
| 462 | dconfig["cache_prefix"] = String{"cache"}; |
| 463 | Json::Dump(dconfig, &s_dconfig); |
| 464 | DMatrixHandle p_fmat; |
| 465 | CHECK_EQ(XGDMatrixCreateFromCallback(static_cast<DataIterHandle>(&iter_0), iter_0.Proxy(), Reset, |
| 466 | Next, s_dconfig.c_str(), &p_fmat), |
| 467 | 0); |
| 468 | |
| 469 | NumpyArrayIterForTest iter_1{0.0f, n_samples, n_features, n_batches}; |
| 470 | auto config = ExtMemConfig{"", |
| 471 | false, |
| 472 | cuda_impl::AutoHostRatio(), |
| 473 | cuda_impl::MatchingPageBytes(), |
| 474 | std::numeric_limits<float>::quiet_NaN(), |
| 475 | 0}; |
| 476 | auto Xy = std::make_shared<data::SparsePageDMatrix>(&iter_1, iter_1.Proxy(), Reset, Next, config); |
| 477 | MakeLabelForTest(Xy, p_fmat); |
| 478 | return std::pair{p_fmat, Xy}; |
| 479 | } |
| 480 | |
| 481 | template <typename Page> |
| 482 | void CheckResult(Context const *ctx, bst_feature_t n_features, std::shared_ptr<DMatrix> Xy, |
no test coverage detected