From 916237fd78ff690b56bf849df1d9b628613f70fd Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Sat, 22 Apr 2023 03:48:58 +0800 Subject: [PATCH] Code comment. --- src/data/iterative_dmatrix.cc | 4 ++-- src/data/iterative_dmatrix.cu | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/data/iterative_dmatrix.cc b/src/data/iterative_dmatrix.cc index 8b4ae524ef0f..799b1848bd15 100644 --- a/src/data/iterative_dmatrix.cc +++ b/src/data/iterative_dmatrix.cc @@ -301,8 +301,8 @@ BatchSet IterativeDMatrix::GetGradientIndex(Context const* ctx } else if (fmat_ctx_.IsCPU()) { ghist_ = std::make_shared(&fmat_ctx_, Info(), *ellpack_, param); } else { - // Can happen when QDM is initialized on GPU, but a CPU version is queried by to_csr - // or the predictor. + // Can happen when QDM is initialized on GPU, but a CPU version is queried by a different QDM + // for cut reference. auto cpu_ctx = ctx->MakeCPU(); ghist_ = std::make_shared(&cpu_ctx, Info(), *ellpack_, param); } diff --git a/src/data/iterative_dmatrix.cu b/src/data/iterative_dmatrix.cu index c96c1cc52104..f23bbd5a14f0 100644 --- a/src/data/iterative_dmatrix.cu +++ b/src/data/iterative_dmatrix.cu @@ -192,7 +192,8 @@ BatchSet IterativeDMatrix::GetEllpackBatches(Context const* ctx, *ellpack_->Impl() = EllpackPageImpl(&fmat_ctx_, *this->ghist_, this->Info().feature_types.ConstDeviceSpan()); } else { - // Can happen when QDM is initialized on CPU, but a GPU version is queried by the predictor. + // Can happen when QDM is initialized on CPU, but a GPU version is queried by a different QDM + // for cut reference. auto cuda_ctx = ctx->MakeCUDA(); this->Info().feature_types.SetDevice(cuda_ctx.gpu_id); *ellpack_->Impl() =