Remove plugin, cuda related code in automake & autoconf files (#4789)

* Build plugin example with CMake.

* Remove plugin, cuda related code in automake & autoconf files.

* Fix typo in GPU doc.
This commit is contained in:
Jiaming Yuan
2019-08-18 16:54:34 -04:00
committed by GitHub
parent c358d95c44
commit ab357dd41c
17 changed files with 56 additions and 94 deletions

View File

@@ -12,7 +12,8 @@ if (USE_CUDA)
file(GLOB_RECURSE CUDA_TEST_SOURCES "*.cu")
list(APPEND TEST_SOURCES ${CUDA_TEST_SOURCES})
endif (USE_CUDA)
add_executable(testxgboost ${TEST_SOURCES} ${XGBOOST_OBJ_SOURCES})
add_executable(testxgboost ${TEST_SOURCES} ${XGBOOST_OBJ_SOURCES}
${xgboost_SOURCE_DIR}/plugin/example/custom_obj.cc)
if (USE_CUDA)
# OpenMP is mandatory for CUDA

View File

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

View File

@@ -5,8 +5,6 @@ make -f dmlc-core/scripts/packages.mk lz4
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
echo 'USE_OPENMP=0' >> config.mk
echo 'TMPVAR := $(XGB_PLUGINS)' >> config.mk
echo 'XGB_PLUGINS = $(filter-out plugin/lz4/plugin.mk, $(TMPVAR))' >> config.mk
else
# use g++-4.8 for linux
export CXX=g++-4.8