Skip to content

Commit

Permalink
Try some stuff with DMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
yoquinjo committed Mar 27, 2023
1 parent 2b8cca6 commit 9e79c2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,16 @@ XGB_DLL int XGBoosterInplacePredict(BoosterHandle handle,
}
}
fprintf (stdout, reinterpret_cast<const char *>(p_m.get()));
DMatrixProxy* stuff = dynamic_cast<data::DMatrixProxy *>(p_m.get());
auto proxy = new std::shared_ptr<xgboost::DMatrix>(new xgboost::data::DMatrixProxy);
if (!proxy) {
fprintf (stderr, "proxy is null");
exit(1);
}
if (!stuff) {
fprintf (stderr, "stuff is null");
exit(1);
}
auto *learner = static_cast<xgboost::Learner *>(handle);
auto iteration_end = GetIterationFromTreeLimit(ntree_limit, learner);
InplacePredictImplCore(p_m, learner, (xgboost::PredictionType)0, missing, num_rows, num_features,
Expand Down
3 changes: 2 additions & 1 deletion src/predictor/cpu_predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ class CPUPredictor : public Predictor {
bool InplacePredict(std::shared_ptr<DMatrix> p_m, const gbm::GBTreeModel &model, float missing,
PredictionCacheEntry *out_preds, uint32_t tree_begin,
unsigned tree_end) const override {
auto proxy = dynamic_cast<data::DMatrixProxy *>(p_m.get());
//auto proxy = dynamic_cast<data::DMatrixProxy *>(p_m.get());
auto proxy = new std::shared_ptr<xgboost::DMatrix>(new xgboost::data::DMatrixProxy);
if (!proxy) {
fprintf (stderr, "InplacePredict: proxy is null cpu variant");
exit(1);
Expand Down

0 comments on commit 9e79c2e

Please sign in to comment.