Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 22, 2024
1 parent cfe5777 commit fee2665
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/cpp/tree/gpu_hist/test_gradient_based_sampler.cu
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ TEST(GradientBasedSampler, NoSamplingExternalMemory) {

auto param = BatchParam{256, tree::TrainParam::DftSparseThreshold()};

GradientBasedSampler sampler(&ctx, kRows, param, kSubsample, TrainParam::kUniform, true);
auto sample = sampler.Sample(&ctx, gpair.DeviceSpan(), dmat.get());
auto p_fmat = sample.p_fmat;
ASSERT_EQ(p_fmat, dmat.get());
ASSERT_THAT(
[&] {
GradientBasedSampler sampler(&ctx, kRows, param, kSubsample, TrainParam::kUniform, true);
},
GMockThrow("external_memory_concat_pages"));
}

TEST(GradientBasedSampler, UniformSampling) {
Expand Down Expand Up @@ -120,4 +121,4 @@ TEST(GradientBasedSampler, GradientBasedSamplingExternalMemory) {
constexpr bool kFixedSizeSampling = false;
VerifySampling(kPageSize, kSubsample, kSamplingMethod, kFixedSizeSampling);
}
}; // namespace xgboost::tree
} // namespace xgboost::tree

0 comments on commit fee2665

Please sign in to comment.