Generalize prediction cache. (#8783)

* Extract most of the functionality into `DMatrixCache`.
* Move API entry to independent file to reduce dependency on `predictor.h` file.
* Add test.

---------

Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2023-02-13 12:36:43 +08:00
committed by GitHub
parent ed91e775ec
commit d11a0044cf
12 changed files with 278 additions and 126 deletions

View File

@@ -1,5 +1,5 @@
/*!
* Copyright 2017-2022 by XGBoost contributors
* Copyright 2017-2023 by XGBoost contributors
*/
#include <gtest/gtest.h>
#include <xgboost/learner.h>
@@ -10,6 +10,7 @@
#include <thread>
#include <vector>
#include "../../src/common/api_entry.h" // XGBAPIThreadLocalEntry
#include "../../src/common/io.h"
#include "../../src/common/linalg_op.h"
#include "../../src/common/random.h"