[EM] Enable access to the number of batches. (#10691)

- Expose `NumBatches` in `DMatrix`.
- Small cleanup for removing legacy CUDA stream and ~force CUDA context initialization~.
- Purge old external memory data generation code.
This commit is contained in:
Jiaming Yuan
2024-08-17 02:59:45 +08:00
committed by GitHub
parent 033a666900
commit 8d7fe262d9
26 changed files with 169 additions and 352 deletions

View File

@@ -541,9 +541,12 @@ class DMatrix {
[[nodiscard]] bool PageExists() const;
/**
* @return Whether the data columns single column block.
* @return Whether the contains a single batch.
*
* The naming is legacy.
*/
[[nodiscard]] virtual bool SingleColBlock() const = 0;
[[nodiscard]] bool SingleColBlock() const { return this->NumBatches() == 1; }
[[nodiscard]] virtual std::int32_t NumBatches() const { return 1; }
virtual ~DMatrix();