/*! * Copyright by Contributors 2017 */ #include #include namespace dmlc { DMLC_REGISTRY_ENABLE(::xgboost::PredictorReg); } // namespace dmlc namespace xgboost { void Predictor::Init( const std::vector>& cfg, const std::vector>& cache) { for (const std::shared_ptr& d : cache) { cache_[d.get()].data = d; } } Predictor* Predictor::Create(std::string name) { auto* e = ::dmlc::Registry::Get()->Find(name); if (e == nullptr) { LOG(FATAL) << "Unknown predictor type " << name; } return (e->body)(); } } // namespace xgboost namespace xgboost { namespace predictor { // List of files that will be force linked in static links. #ifdef XGBOOST_USE_CUDA DMLC_REGISTRY_LINK_TAG(gpu_predictor); #endif DMLC_REGISTRY_LINK_TAG(cpu_predictor); } // namespace predictor } // namespace xgboost