Medial Code Documentation
Loading...
Searching...
No Matches
ellpack_page_source.h
1
5#ifndef XGBOOST_DATA_ELLPACK_PAGE_SOURCE_H_
6#define XGBOOST_DATA_ELLPACK_PAGE_SOURCE_H_
7
8#include <xgboost/data.h>
9
10#include <memory>
11#include <string>
12#include <utility>
13
14#include "../common/common.h"
15#include "../common/hist_util.h"
16#include "ellpack_page.h" // for EllpackPage
17#include "sparse_page_source.h"
18
19namespace xgboost::data {
20class EllpackPageSource : public PageSourceIncMixIn<EllpackPage> {
21 bool is_dense_;
22 size_t row_stride_;
23 BatchParam param_;
25 std::unique_ptr<common::HistogramCuts> cuts_;
26 std::int32_t device_;
27
28 public:
29 EllpackPageSource(float missing, int nthreads, bst_feature_t n_features, size_t n_batches,
30 std::shared_ptr<Cache> cache, BatchParam param,
31 std::unique_ptr<common::HistogramCuts> cuts, bool is_dense, size_t row_stride,
33 std::shared_ptr<SparsePageSource> source, std::int32_t device)
34 : PageSourceIncMixIn(missing, nthreads, n_features, n_batches, cache, false),
35 is_dense_{is_dense},
36 row_stride_{row_stride},
37 param_{std::move(param)},
38 feature_types_{feature_types},
39 cuts_{std::move(cuts)},
40 device_{device} {
41 this->source_ = source;
42 this->Fetch();
43 }
44
45 void Fetch() final;
46};
47
48#if !defined(XGBOOST_USE_CUDA)
49inline void EllpackPageSource::Fetch() {
50 // silent the warning about unused variables.
51 (void)(row_stride_);
52 (void)(is_dense_);
53 common::AssertGPUSupport();
54}
55#endif // !defined(XGBOOST_USE_CUDA)
56} // namespace xgboost::data
57
58#endif // XGBOOST_DATA_ELLPACK_PAGE_SOURCE_H_
span class implementation, based on ISO++20 span<T>. The interface should be the same.
Definition span.h:424
Definition ellpack_page_source.h:20
Definition sparse_page_source.h:375
Copyright 2015-2023 by XGBoost Contributors.
Copyright 2019-2023, XGBoost Contributors.
Definition data.py:1
uint32_t bst_feature_t
Type for data column (feature) index.
Definition base.h:101
Copyright 2014-2023, XGBoost Contributors.
Parameters for constructing histogram index batches.
Definition data.h:244