From f70652cf8e11129d555e97f23d7a84d1d088c44c Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Tue, 21 Jul 2020 19:50:00 -0700 Subject: [PATCH 1/2] Add explicit template specializations --- src/data/data.cc | 10 ++++++++++ src/tree/updater_quantile_hist.cc | 30 +++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/data/data.cc b/src/data/data.cc index e8a9a85822e9..57a9a68c6706 100644 --- a/src/data/data.cc +++ b/src/data/data.cc @@ -933,7 +933,17 @@ void SparsePage::PushCSC(const SparsePage &batch) { self_offset = std::move(offset); } +template uint64_t +SparsePage::Push(const data::DenseAdapterBatch& batch, float missing, int nthread); +template uint64_t +SparsePage::Push(const data::CSRAdapterBatch& batch, float missing, int nthread); +template uint64_t +SparsePage::Push(const data::CSCAdapterBatch& batch, float missing, int nthread); +template uint64_t +SparsePage::Push(const data::DataTableAdapterBatch& batch, float missing, int nthread); + namespace data { + // List of files that will be force linked in static links. DMLC_REGISTRY_LINK_TAG(sparse_page_raw_format); } // namespace data diff --git a/src/tree/updater_quantile_hist.cc b/src/tree/updater_quantile_hist.cc index 30eb01a726ee..cee3d1e0db92 100644 --- a/src/tree/updater_quantile_hist.cc +++ b/src/tree/updater_quantile_hist.cc @@ -282,21 +282,12 @@ void QuantileHistMaker::Builder::SetHistSynchronizer( HistSynchronizer* sync) { hist_synchronizer_.reset(sync); } -template void QuantileHistMaker::Builder::SetHistSynchronizer( - HistSynchronizer* sync); -template void QuantileHistMaker::Builder::SetHistSynchronizer( - HistSynchronizer* sync); template void QuantileHistMaker::Builder::SetHistRowsAdder( HistRowsAdder* adder) { hist_rows_adder_.reset(adder); } -template void QuantileHistMaker::Builder::SetHistRowsAdder( - HistRowsAdder* sync); -template void QuantileHistMaker::Builder::SetHistRowsAdder( - HistRowsAdder* sync); - template void QuantileHistMaker::Builder::BuildHistogramsLossGuide( ExpandEntry entry, @@ -1356,6 +1347,27 @@ GradStats QuantileHistMaker::Builder::EnumerateSplit( return e; } +template struct QuantileHistMaker::Builder; +template struct QuantileHistMaker::Builder; +template void QuantileHistMaker::Builder::PartitionKernel( + const size_t node_in_set, const size_t nid, common::Range1d range, + const int32_t split_cond, const ColumnMatrix& column_matrix, const RegTree& tree); +template void QuantileHistMaker::Builder::PartitionKernel( + const size_t node_in_set, const size_t nid, common::Range1d range, + const int32_t split_cond, const ColumnMatrix& column_matrix, const RegTree& tree); +template void QuantileHistMaker::Builder::PartitionKernel( + const size_t node_in_set, const size_t nid, common::Range1d range, + const int32_t split_cond, const ColumnMatrix& column_matrix, const RegTree& tree); +template void QuantileHistMaker::Builder::PartitionKernel( + const size_t node_in_set, const size_t nid, common::Range1d range, + const int32_t split_cond, const ColumnMatrix& column_matrix, const RegTree& tree); +template void QuantileHistMaker::Builder::PartitionKernel( + const size_t node_in_set, const size_t nid, common::Range1d range, + const int32_t split_cond, const ColumnMatrix& column_matrix, const RegTree& tree); +template void QuantileHistMaker::Builder::PartitionKernel( + const size_t node_in_set, const size_t nid, common::Range1d range, + const int32_t split_cond, const ColumnMatrix& column_matrix, const RegTree& tree); + XGBOOST_REGISTER_TREE_UPDATER(FastHistMaker, "grow_fast_histmaker") .describe("(Deprecated, use grow_quantile_histmaker instead.)" " Grow tree using quantized histogram.") From e0d108751cea088eff1b073494c88db331670cdd Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Tue, 21 Jul 2020 21:35:22 -0700 Subject: [PATCH 2/2] Adding Specialization for FileAdapterBatch --- src/data/data.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data/data.cc b/src/data/data.cc index 57a9a68c6706..a835e9e171ba 100644 --- a/src/data/data.cc +++ b/src/data/data.cc @@ -941,6 +941,8 @@ template uint64_t SparsePage::Push(const data::CSCAdapterBatch& batch, float missing, int nthread); template uint64_t SparsePage::Push(const data::DataTableAdapterBatch& batch, float missing, int nthread); +template uint64_t +SparsePage::Push(const data::FileAdapterBatch& batch, float missing, int nthread); namespace data {