Rename and extract Context. (#8528)

* Rename `GenericParameter` to `Context`.
* Rename header file to reflect the change.
* Rename all references.
This commit is contained in:
Jiaming Yuan
2022-12-07 04:58:54 +08:00
committed by GitHub
parent 05fc6f3ca9
commit 3e26107a9c
105 changed files with 548 additions and 574 deletions

View File

@@ -9,7 +9,7 @@
#include "../collective/communicator-inl.h"
#include "../common/common.h"
#include "xgboost/generic_parameters.h"
#include "xgboost/context.h"
#include "xgboost/host_device_vector.h"
#include "xgboost/tree_model.h"

View File

@@ -4,6 +4,7 @@
* \brief Registry of all objective functions.
*/
#include <dmlc/registry.h>
#include <xgboost/context.h>
#include <xgboost/objective.h>
#include <sstream>
@@ -16,7 +17,7 @@ DMLC_REGISTRY_ENABLE(::xgboost::ObjFunctionReg);
namespace xgboost {
// implement factory functions
ObjFunction* ObjFunction::Create(const std::string& name, GenericParameter const* tparam) {
ObjFunction* ObjFunction::Create(const std::string& name, Context const* ctx) {
auto *e = ::dmlc::Registry< ::xgboost::ObjFunctionReg>::Get()->Find(name);
if (e == nullptr) {
std::stringstream ss;
@@ -27,7 +28,7 @@ ObjFunction* ObjFunction::Create(const std::string& name, GenericParameter const
<< ss.str();
}
auto pobj = (e->body)();
pobj->ctx_ = tparam;
pobj->ctx_ = ctx;
return pobj;
}

View File

@@ -23,8 +23,8 @@
#include "./regression_loss.h"
#include "adaptive.h"
#include "xgboost/base.h"
#include "xgboost/context.h"
#include "xgboost/data.h"
#include "xgboost/generic_parameters.h"
#include "xgboost/host_device_vector.h"
#include "xgboost/json.h"
#include "xgboost/linalg.h"