/*! * Copyright 2019-2021 by XGBoost Contributors */ #ifndef XGBOOST_DATA_ELLPACK_PAGE_SOURCE_H_ #define XGBOOST_DATA_ELLPACK_PAGE_SOURCE_H_ #include #include #include #include #include "../common/common.h" #include "../common/hist_util.h" #include "sparse_page_source.h" namespace xgboost { namespace data { class EllpackPageSource : public PageSourceIncMixIn { bool is_dense_; size_t row_stride_; BatchParam param_; common::Span feature_types_; std::unique_ptr cuts_; public: EllpackPageSource( float missing, int nthreads, bst_feature_t n_features, size_t n_batches, std::shared_ptr cache, BatchParam param, std::unique_ptr cuts, bool is_dense, size_t row_stride, common::Span feature_types, std::shared_ptr source) : PageSourceIncMixIn(missing, nthreads, n_features, n_batches, cache), is_dense_{is_dense}, row_stride_{row_stride}, param_{std::move(param)}, feature_types_{feature_types}, cuts_{std::move(cuts)} { this->source_ = source; this->Fetch(); } void Fetch() final; }; #if !defined(XGBOOST_USE_CUDA) inline void EllpackPageSource::Fetch() { // silent the warning about unused variables. (void)(row_stride_); (void)(is_dense_); common::AssertGPUSupport(); } #endif // !defined(XGBOOST_USE_CUDA) } // namespace data } // namespace xgboost #endif // XGBOOST_DATA_ELLPACK_PAGE_SOURCE_H_