Initial support for external memory in gpu_predictor (#4284)
This commit is contained in:
@@ -32,6 +32,10 @@ float SimpleDMatrix::GetColDensity(size_t cidx) {
|
||||
class SimpleBatchIteratorImpl : public BatchIteratorImpl {
|
||||
public:
|
||||
explicit SimpleBatchIteratorImpl(SparsePage* page) : page_(page) {}
|
||||
SparsePage& operator*() override {
|
||||
CHECK(page_ != nullptr);
|
||||
return *page_;
|
||||
}
|
||||
const SparsePage& operator*() const override {
|
||||
CHECK(page_ != nullptr);
|
||||
return *page_;
|
||||
|
||||
@@ -29,6 +29,7 @@ class SparseBatchIteratorImpl : public BatchIteratorImpl {
|
||||
explicit SparseBatchIteratorImpl(SparsePageSource* source) : source_(source) {
|
||||
CHECK(source_ != nullptr);
|
||||
}
|
||||
SparsePage& operator*() override { return source_->Value(); }
|
||||
const SparsePage& operator*() const override { return source_->Value(); }
|
||||
void operator++() override { at_end_ = !source_->Next(); }
|
||||
bool AtEnd() const override { return at_end_; }
|
||||
|
||||
@@ -104,6 +104,10 @@ void SparsePageSource::BeforeFirst() {
|
||||
}
|
||||
}
|
||||
|
||||
SparsePage& SparsePageSource::Value() {
|
||||
return *page_;
|
||||
}
|
||||
|
||||
const SparsePage& SparsePageSource::Value() const {
|
||||
return *page_;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ class SparsePageSource : public DataSource {
|
||||
// implement BeforeFirst
|
||||
void BeforeFirst() override;
|
||||
// implement Value
|
||||
SparsePage& Value();
|
||||
const SparsePage& Value() const override;
|
||||
/*!
|
||||
* \brief Create source by taking data from parser.
|
||||
|
||||
Reference in New Issue
Block a user