diff --git a/src/common/column_matrix.h b/src/common/column_matrix.h index 2a8fc2d69ca2..f16d1252f9a1 100644 --- a/src/common/column_matrix.h +++ b/src/common/column_matrix.h @@ -152,7 +152,8 @@ class ColumnMatrix { if (!any_missing_) { missing_flags_.resize(feature_offsets_[n_features], false); // row index is compressed, we need to dispatch it. - DispatchBinType(gmat.index.GetBinTypeSize(), [&, size = batch.Size()](auto t) { + DispatchBinType(gmat.index.GetBinTypeSize(), [&, size = batch.Size(), n_features = n_features, + n_threads = n_threads](auto t) { using RowBinIdxT = decltype(t); SetIndexNoMissing(base_rowid, gmat.index.data(), size, n_features, n_threads); });