Skip to content

Commit 8b2ab8e

Browse files
committed
Move the event.
1 parent 3ab7d43 commit 8b2ab8e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tree/updater_gpu_hist.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ struct GPUHistMakerDevice {
526526
monitor.Start("Partition-BuildHist");
527527

528528
std::int32_t k{0};
529-
for (auto const& page : p_fmat->GetBatches<EllpackPage>(ctx_, StaticBatch(prefetch_copy))) {
530-
curt::Event e;
529+
curt::Event e;
531530

531+
for (auto const& page : p_fmat->GetBatches<EllpackPage>(ctx_, StaticBatch(prefetch_copy))) {
532532
page.Impl()->Visit(ctx_, {}, [&](auto&& d_matrix) {
533533
using Acc = std::remove_reference_t<decltype(d_matrix)>;
534534
auto go_left = GoLeftOp<Acc>{d_matrix};
@@ -552,9 +552,8 @@ struct GPUHistMakerDevice {
552552
}
553553
});
554554
++k;
555-
556-
this->ctx_->CUDACtx()->Stream().Wait(e);
557555
}
556+
this->ctx_->CUDACtx()->Stream().Wait(e);
558557

559558
monitor.Stop("Partition-BuildHist");
560559

0 commit comments

Comments
 (0)