Add explicit template specialization for portability (#5921)

* Add explicit template specializations

* Adding Specialization for FileAdapterBatch
This commit is contained in:
Philip Hyunsu Cho 2020-07-22 12:31:17 -07:00 committed by GitHub
parent bc1d3ee230
commit 4af857f95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 9 deletions

View File

@ -933,7 +933,19 @@ void SparsePage::PushCSC(const SparsePage &batch) {
self_offset = std::move(offset); 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);
template uint64_t
SparsePage::Push(const data::FileAdapterBatch& batch, float missing, int nthread);
namespace data { namespace data {
// List of files that will be force linked in static links. // List of files that will be force linked in static links.
DMLC_REGISTRY_LINK_TAG(sparse_page_raw_format); DMLC_REGISTRY_LINK_TAG(sparse_page_raw_format);
} // namespace data } // namespace data

View File

@ -282,21 +282,12 @@ void QuantileHistMaker::Builder<GradientSumT>::SetHistSynchronizer(
HistSynchronizer<GradientSumT>* sync) { HistSynchronizer<GradientSumT>* sync) {
hist_synchronizer_.reset(sync); hist_synchronizer_.reset(sync);
} }
template void QuantileHistMaker::Builder<double>::SetHistSynchronizer(
HistSynchronizer<double>* sync);
template void QuantileHistMaker::Builder<float>::SetHistSynchronizer(
HistSynchronizer<float>* sync);
template<typename GradientSumT> template<typename GradientSumT>
void QuantileHistMaker::Builder<GradientSumT>::SetHistRowsAdder( void QuantileHistMaker::Builder<GradientSumT>::SetHistRowsAdder(
HistRowsAdder<GradientSumT>* adder) { HistRowsAdder<GradientSumT>* adder) {
hist_rows_adder_.reset(adder); hist_rows_adder_.reset(adder);
} }
template void QuantileHistMaker::Builder<double>::SetHistRowsAdder(
HistRowsAdder<double>* sync);
template void QuantileHistMaker::Builder<float>::SetHistRowsAdder(
HistRowsAdder<float>* sync);
template<typename GradientSumT> template<typename GradientSumT>
void QuantileHistMaker::Builder<GradientSumT>::BuildHistogramsLossGuide( void QuantileHistMaker::Builder<GradientSumT>::BuildHistogramsLossGuide(
ExpandEntry entry, ExpandEntry entry,
@ -1356,6 +1347,27 @@ GradStats QuantileHistMaker::Builder<GradientSumT>::EnumerateSplit(
return e; return e;
} }
template struct QuantileHistMaker::Builder<float>;
template struct QuantileHistMaker::Builder<double>;
template void QuantileHistMaker::Builder<float>::PartitionKernel<uint8_t>(
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<float>::PartitionKernel<uint16_t>(
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<float>::PartitionKernel<uint32_t>(
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<double>::PartitionKernel<uint8_t>(
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<double>::PartitionKernel<uint16_t>(
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<double>::PartitionKernel<uint32_t>(
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") XGBOOST_REGISTER_TREE_UPDATER(FastHistMaker, "grow_fast_histmaker")
.describe("(Deprecated, use grow_quantile_histmaker instead.)" .describe("(Deprecated, use grow_quantile_histmaker instead.)"
" Grow tree using quantized histogram.") " Grow tree using quantized histogram.")