xgboost/tests/cpp/plugin/test_example_objective.cc
2023-08-02 14:31:18 +08:00

14 lines
369 B
C++

#include <gtest/gtest.h>
#include <xgboost/objective.h>
#include <string>
#include "../helpers.h"
namespace xgboost {
TEST(Plugin, ExampleObjective) {
xgboost::Context ctx = MakeCUDACtx(GetGPUId());
auto* obj = xgboost::ObjFunction::Create("mylogistic", &ctx);
ASSERT_EQ(obj->DefaultEvalMetric(), std::string{"logloss"});
delete obj;
}
} // namespace xgboost