xgboost/tests/cpp/plugin/test_example_objective.cc
Rong Ou 38ab79f889 Make HostDeviceVector single gpu only (#4773)
* Make HostDeviceVector single gpu only
2019-08-26 09:51:13 +12:00

16 lines
393 B
C++

#include <gtest/gtest.h>
#include <xgboost/objective.h>
#include <string>
#include "../helpers.h"
namespace xgboost {
TEST(Plugin, ExampleObjective) {
xgboost::GenericParameter tparam = CreateEmptyGenericParam(GPUIDX);
auto * obj = xgboost::ObjFunction::Create("mylogistic", &tparam);
ASSERT_EQ(obj->DefaultEvalMetric(), std::string{"error"});
delete obj;
}
} // namespace xgboost