Small cleanups to various data types. (#8086)

- Use `bst_bin_t` in batch param constructor.
- Use `StringView` to avoid `std::string` when appropriate.
- Avoid using `MetaInfo` in quantile constructor to limit the scope of parameter.
This commit is contained in:
Jiaming Yuan
2022-07-18 22:39:36 +08:00
committed by GitHub
parent e28f6f6657
commit 4083440690
9 changed files with 52 additions and 53 deletions

View File

@@ -82,8 +82,8 @@ void TestDistributedQuantile(size_t rows, size_t cols) {
std::vector<float> hessian(rows, 1.0);
auto hess = Span<float const>{hessian};
ContainerType<use_column> sketch_distributed(n_bins, m->Info(), column_size, false,
OmpGetNumThreads(0));
ContainerType<use_column> sketch_distributed(n_bins, m->Info().feature_types.ConstHostSpan(),
column_size, false, OmpGetNumThreads(0));
if (use_column) {
for (auto const& page : m->GetBatches<SortedCSCPage>()) {
@@ -103,8 +103,8 @@ void TestDistributedQuantile(size_t rows, size_t cols) {
CHECK_EQ(rabit::GetWorldSize(), 1);
std::for_each(column_size.begin(), column_size.end(), [=](auto& size) { size *= world; });
m->Info().num_row_ = world * rows;
ContainerType<use_column> sketch_on_single_node(n_bins, m->Info(), column_size, false,
OmpGetNumThreads(0));
ContainerType<use_column> sketch_on_single_node(n_bins, m->Info().feature_types.ConstHostSpan(),
column_size, false, OmpGetNumThreads(0));
m->Info().num_row_ = rows;
for (auto rank = 0; rank < world; ++rank) {