Unify test helpers for creating ctx. (#9274)
This commit is contained in:
@@ -4,12 +4,10 @@
|
||||
#include "../helpers.h"
|
||||
|
||||
namespace xgboost {
|
||||
|
||||
TEST(Plugin, ExampleObjective) {
|
||||
xgboost::Context ctx = CreateEmptyGenericParam(GPUIDX);
|
||||
xgboost::Context ctx = MakeCUDACtx(GPUIDX);
|
||||
auto* obj = xgboost::ObjFunction::Create("mylogistic", &ctx);
|
||||
ASSERT_EQ(obj->DefaultEvalMetric(), std::string{"logloss"});
|
||||
delete obj;
|
||||
}
|
||||
|
||||
} // namespace xgboost
|
||||
|
||||
Reference in New Issue
Block a user