Skip to content

Commit 5fb7aeb

Browse files
committed
Fix.
1 parent 115dea7 commit 5fb7aeb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/data/iterative_dmatrix.cu

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,15 @@ BatchSet<EllpackPage> IterativeDMatrix::GetEllpackBatches(Context const* ctx,
110110
ellpack_.reset(new EllpackPage{&fmat_ctx_});
111111
if (ctx->IsCUDA()) {
112112
this->Info().feature_types.SetDevice(ctx->Device());
113-
*ellpack_->Impl() =
114-
EllpackPageImpl(ctx, *this->ghist_, this->Info().feature_types.ConstDeviceSpan());
115113
} else if (fmat_ctx_.IsCUDA()) {
116114
this->Info().feature_types.SetDevice(fmat_ctx_.Device());
117-
*ellpack_->Impl() =
118-
EllpackPageImpl(&fmat_ctx_, *this->ghist_, this->Info().feature_types.ConstDeviceSpan());
119115
} else {
120116
// Can happen when QDM is initialized on CPU, but a GPU version is queried by a different QDM
121117
// for cut reference.
122-
auto cuda_ctx = ctx->MakeCUDA();
123-
this->Info().feature_types.SetDevice(cuda_ctx.Device());
124-
*ellpack_->Impl() =
125-
EllpackPageImpl(&cuda_ctx, *this->ghist_, this->Info().feature_types.ConstDeviceSpan());
118+
this->Info().feature_types.SetDevice(ctx->MakeCUDA().Device());
126119
}
120+
*ellpack_->Impl() =
121+
EllpackPageImpl{&fmat_ctx_, *this->ghist_, this->Info().feature_types.ConstDeviceSpan()};
127122
}
128123
CHECK(ellpack_);
129124
auto begin_iter = BatchIterator<EllpackPage>(new SimpleBatchIteratorImpl<EllpackPage>(ellpack_));

0 commit comments

Comments
 (0)