Porting elementwise metrics to GPU. (#3952)
* Port elementwise metrics to GPU. * All elementwise metrics are converted to static polymorphic. * Create a reducer for metrics reduction. * Remove const of Metric::Eval to accommodate CubMemory.
This commit is contained in:
@@ -85,13 +85,14 @@ void CheckRankingObjFunction(xgboost::ObjFunction * obj,
|
||||
|
||||
|
||||
xgboost::bst_float GetMetricEval(xgboost::Metric * metric,
|
||||
std::vector<xgboost::bst_float> preds,
|
||||
xgboost::HostDeviceVector<xgboost::bst_float> preds,
|
||||
std::vector<xgboost::bst_float> labels,
|
||||
std::vector<xgboost::bst_float> weights) {
|
||||
xgboost::MetaInfo info;
|
||||
info.num_row_ = labels.size();
|
||||
info.labels_.HostVector() = labels;
|
||||
info.weights_.HostVector() = weights;
|
||||
|
||||
return metric->Eval(preds, info, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user