Rename and extract Context. (#8528)
* Rename `GenericParameter` to `Context`. * Rename header file to reflect the change. * Rename all references.
This commit is contained in:
@@ -108,10 +108,10 @@ inline std::pair<double, double> GetGradient(int group_idx, int num_group, int f
|
||||
*
|
||||
* \return The gradient and diagonal Hessian entry for a given feature.
|
||||
*/
|
||||
inline std::pair<double, double>
|
||||
GetGradientParallel(GenericParameter const *ctx, int group_idx, int num_group,
|
||||
int fidx, const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat) {
|
||||
inline std::pair<double, double> GetGradientParallel(Context const *ctx, int group_idx,
|
||||
int num_group, int fidx,
|
||||
const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat) {
|
||||
std::vector<double> sum_grad_tloc(ctx->Threads(), 0.0);
|
||||
std::vector<double> sum_hess_tloc(ctx->Threads(), 0.0);
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ DMLC_REGISTRY_ENABLE(::xgboost::LinearUpdaterReg);
|
||||
|
||||
namespace xgboost {
|
||||
|
||||
LinearUpdater* LinearUpdater::Create(const std::string& name, GenericParameter const* lparam) {
|
||||
LinearUpdater* LinearUpdater::Create(const std::string& name, Context const* ctx) {
|
||||
auto *e = ::dmlc::Registry< ::xgboost::LinearUpdaterReg>::Get()->Find(name);
|
||||
if (e == nullptr) {
|
||||
LOG(FATAL) << "Unknown linear updater " << name;
|
||||
}
|
||||
auto p_linear = (e->body)();
|
||||
p_linear->ctx_ = lparam;
|
||||
p_linear->ctx_ = ctx;
|
||||
return p_linear;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user