Prepare for improving Windows networking compatibility. (#8234)

* Prepare for improving Windows networking compatibility.

* Include dmlc filesystem indirectly as dmlc/filesystem.h includes windows.h, which
  conflicts with winsock2.h
* Define `NOMINMAX` conditionally.
* Link the winsock library when mysys32 is used.
* Add config file for read the doc.
This commit is contained in:
Jiaming Yuan 2022-09-10 15:16:49 +08:00 committed by GitHub
parent dd44ac91b8
commit bc818316f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 173 additions and 106 deletions

7
.gitignore vendored
View File

@ -97,8 +97,11 @@ metastore_db
R-package/src/Makevars R-package/src/Makevars
*.lib *.lib
# Visual Studio Code # Visual Studio
/.vscode/ .vs/
CMakeSettings.json
*.ilk
*.pdb
# IntelliJ/CLion # IntelliJ/CLion
.idea .idea

28
.readthedocs.yaml Normal file
View File

@ -0,0 +1,28 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- graphviz
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py
# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/requirements.txt
system_packages: true

View File

@ -30,7 +30,7 @@ $(foreach v, $(XGB_RFLAGS), $(warning $(v)))
PKG_CPPFLAGS= -I$(PKGROOT)/include -I$(PKGROOT)/dmlc-core/include -I$(PKGROOT)/rabit/include -I$(PKGROOT) $(XGB_RFLAGS) PKG_CPPFLAGS= -I$(PKGROOT)/include -I$(PKGROOT)/dmlc-core/include -I$(PKGROOT)/rabit/include -I$(PKGROOT) $(XGB_RFLAGS)
PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS) PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS) PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS) -lwsock32 -lws2_32
OBJECTS= ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./init.o \ OBJECTS= ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./init.o \
$(PKGROOT)/amalgamation/xgboost-all0.o $(PKGROOT)/amalgamation/dmlc-minimum0.o \ $(PKGROOT)/amalgamation/xgboost-all0.o $(PKGROOT)/amalgamation/dmlc-minimum0.o \
$(PKGROOT)/rabit/src/engine.o $(PKGROOT)/rabit/src/rabit_c_api.o \ $(PKGROOT)/rabit/src/engine.o $(PKGROOT)/rabit/src/rabit_c_api.o \

View File

@ -244,7 +244,7 @@ macro(xgboost_target_properties target)
$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8> $<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>
-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE
) )
endif (MSVC) endif (MSVC)
if (WIN32 AND MINGW) if (WIN32 AND MINGW)
@ -314,4 +314,8 @@ macro(xgboost_target_link_libraries target)
if (RABIT_BUILD_MPI) if (RABIT_BUILD_MPI)
target_link_libraries(${target} PRIVATE MPI::MPI_CXX) target_link_libraries(${target} PRIVATE MPI::MPI_CXX)
endif (RABIT_BUILD_MPI) endif (RABIT_BUILD_MPI)
if (MINGW)
target_link_libraries(${target} PRIVATE wsock32 ws2_32)
endif (MINGW)
endmacro(xgboost_target_link_libraries) endmacro(xgboost_target_link_libraries)

View File

@ -5,7 +5,10 @@
* *
* \author Tianqi Chen, Ignacio Cano, Tianyi Zhou * \author Tianqi Chen, Ignacio Cano, Tianyi Zhou
*/ */
#if !defined(NOMINMAX) && defined(_WIN32)
#define NOMINMAX #define NOMINMAX
#endif // !defined(NOMINMAX)
#include "rabit/base.h" #include "rabit/base.h"
#include "rabit/internal/rabit-inl.h" #include "rabit/internal/rabit-inl.h"
#include "allreduce_base.h" #include "allreduce_base.h"

View File

@ -6,7 +6,11 @@
*/ */
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#if !defined(NOMINMAX) && defined(_WIN32)
#define NOMINMAX #define NOMINMAX
#endif // !defined(NOMINMAX)
#include <dmlc/timer.h> #include <dmlc/timer.h>
#include <xgboost/learner.h> #include <xgboost/learner.h>

View File

@ -1,7 +1,6 @@
/*! /*!
* Copyright 2018-2022 by XGBoost Contributors * Copyright 2018-2022 by XGBoost Contributors
*/ */
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "../../../src/common/column_matrix.h" #include "../../../src/common/column_matrix.h"

View File

@ -1,11 +1,13 @@
/*! /*!
* Copyright 2019 by Contributors * Copyright 2019 by Contributors
*/ */
#include <gtest/gtest.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include "../../../src/common/config.h" #include "../../../src/common/config.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
namespace xgboost { namespace xgboost {

View File

@ -1,26 +1,25 @@
/*! /*!
* Copyright 2019-2022 by XGBoost Contributors * Copyright 2019-2022 by XGBoost Contributors
*/ */
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <thrust/device_vector.h>
#include <xgboost/c_api.h>
#include <xgboost/data.h>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <thrust/device_vector.h>
#include <xgboost/data.h>
#include <xgboost/c_api.h>
#include "test_hist_util.h"
#include "../helpers.h"
#include "../data/test_array_interface.h"
#include "../../../src/common/device_helpers.cuh"
#include "../../../src/common/hist_util.h"
#include "../../../src/common/hist_util.cuh"
#include "../../../src/data/device_adapter.cuh"
#include "../../../src/common/math.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../../../include/xgboost/logging.h" #include "../../../include/xgboost/logging.h"
#include "../../../src/common/device_helpers.cuh"
#include "../../../src/common/hist_util.cuh"
#include "../../../src/common/hist_util.h"
#include "../../../src/common/math.h"
#include "../../../src/data/device_adapter.cuh"
#include "../../../src/data/simple_dmatrix.h"
#include "../data/test_array_interface.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "test_hist_util.h"
namespace xgboost { namespace xgboost {
namespace common { namespace common {

View File

@ -3,16 +3,17 @@
*/ */
#pragma once #pragma once
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <random>
#include <vector>
#include <string>
#include <fstream>
#include "../helpers.h" #include <fstream>
#include <random>
#include <string>
#include <vector>
#include "../../../src/common/hist_util.h" #include "../../../src/common/hist_util.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../../../src/data/adapter.h" #include "../../../src/data/adapter.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#ifdef __CUDACC__ #ifdef __CUDACC__
#include <xgboost/json.h> #include <xgboost/json.h>

View File

@ -2,12 +2,12 @@
* Copyright (c) by XGBoost Contributors 2019 * Copyright (c) by XGBoost Contributors 2019
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <fstream> #include <fstream>
#include "../helpers.h"
#include "../../../src/common/io.h" #include "../../../src/common/io.h"
#include "../helpers.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
namespace xgboost { namespace xgboost {
namespace common { namespace common {

View File

@ -2,16 +2,17 @@
* Copyright (c) by Contributors 2019-2022 * Copyright (c) by Contributors 2019-2022
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <fstream> #include <fstream>
#include <map> #include <map>
#include "xgboost/json.h"
#include "xgboost/logging.h"
#include "xgboost/json_io.h"
#include "../helpers.h"
#include "../../../src/common/io.h"
#include "../../../src/common/charconv.h" #include "../../../src/common/charconv.h"
#include "../../../src/common/io.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
#include "xgboost/json.h"
#include "xgboost/json_io.h"
#include "xgboost/logging.h"
namespace xgboost { namespace xgboost {

View File

@ -1,3 +1,6 @@
#ifndef XGBOOST_TESTS_CPP_COMMON_TEST_QUANTILE_H_
#define XGBOOST_TESTS_CPP_COMMON_TEST_QUANTILE_H_
#include <rabit/rabit.h> #include <rabit/rabit.h>
#include <algorithm> #include <algorithm>
#include <string> #include <string>
@ -62,3 +65,5 @@ template <typename Fn> void RunWithSeedsAndBins(size_t rows, Fn fn) {
} }
} // namespace common } // namespace common
} // namespace xgboost } // namespace xgboost
#endif // XGBOOST_TESTS_CPP_COMMON_TEST_QUANTILE_H_

View File

@ -1,18 +1,16 @@
/*! /*!
* Copyright 2019 XGBoost contributors * Copyright 2019 XGBoost contributors
*/ */
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <dmlc/io.h> #include <dmlc/io.h>
#include <gtest/gtest.h>
#include <xgboost/version_config.h>
#include <xgboost/json.h>
#include <xgboost/base.h> #include <xgboost/base.h>
#include <xgboost/json.h>
#include <xgboost/version_config.h>
#include <string> #include <string>
#include "../../../src/common/version.h" #include "../../../src/common/version.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
namespace xgboost { namespace xgboost {
TEST(Version, Basic) { TEST(Version, Basic) {

View File

@ -2,13 +2,14 @@
* Copyright 2019-2022 by XGBoost Contributors * Copyright 2019-2022 by XGBoost Contributors
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "xgboost/data.h" #include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "xgboost/data.h"
namespace xgboost { namespace xgboost {
TEST(SparsePage, PushCSC) { TEST(SparsePage, PushCSC) {

View File

@ -2,12 +2,11 @@
* Copyright 2021 XGBoost contributors * Copyright 2021 XGBoost contributors
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#include "../../../src/data/sparse_page_source.h"
#include "../../../src/data/ellpack_page.cuh" #include "../../../src/data/ellpack_page.cuh"
#include "../../../src/data/sparse_page_source.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
namespace xgboost { namespace xgboost {

View File

@ -2,13 +2,13 @@
* Copyright 2021 XGBoost contributors * Copyright 2021 XGBoost contributors
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <memory> #include <memory>
#include "../../../src/data/adapter.h"
#include "../../../src/data/file_iterator.h" #include "../../../src/data/file_iterator.h"
#include "../../../src/data/proxy_dmatrix.h" #include "../../../src/data/proxy_dmatrix.h"
#include "../../../src/data/adapter.h" #include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
namespace xgboost { namespace xgboost {

View File

@ -2,12 +2,13 @@
#include "test_metainfo.h" #include "test_metainfo.h"
#include <dmlc/io.h> #include <dmlc/io.h>
#include <dmlc/filesystem.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#include <string>
#include <memory>
#include "../../../src/common/version.h"
#include <memory>
#include <string>
#include "../../../src/common/version.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "xgboost/base.h" #include "xgboost/base.h"

View File

@ -1,12 +1,13 @@
// Copyright by Contributors // Copyright by Contributors
#include <dmlc/filesystem.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#include <array> #include <array>
#include "xgboost/base.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../../../src/data/adapter.h" #include "../../../src/data/adapter.h"
#include "../../../src/data/simple_dmatrix.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "xgboost/base.h"
using namespace xgboost; // NOLINT using namespace xgboost; // NOLINT

View File

@ -1,5 +1,4 @@
// Copyright by Contributors // Copyright by Contributors
#include <dmlc/filesystem.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#include "../../../src/data/simple_dmatrix.h" #include "../../../src/data/simple_dmatrix.h"

View File

@ -1,14 +1,16 @@
// Copyright by Contributors // Copyright by Contributors
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#include <thread>
#include <future> #include <future>
#include <thread>
#include "../../../src/common/io.h" #include "../../../src/common/io.h"
#include "../../../src/data/adapter.h" #include "../../../src/data/adapter.h"
#include "../../../src/data/file_iterator.h"
#include "../../../src/data/simple_dmatrix.h" #include "../../../src/data/simple_dmatrix.h"
#include "../../../src/data/sparse_page_dmatrix.h" #include "../../../src/data/sparse_page_dmatrix.h"
#include "../../../src/data/file_iterator.h" #include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
using namespace xgboost; // NOLINT using namespace xgboost; // NOLINT

View File

@ -1,10 +1,10 @@
// Copyright by Contributors // Copyright by Contributors
#include <dmlc/filesystem.h>
#include "../helpers.h"
#include "../../../src/common/compressed_iterator.h" #include "../../../src/common/compressed_iterator.h"
#include "../../../src/data/ellpack_page.cuh" #include "../../../src/data/ellpack_page.cuh"
#include "../../../src/data/sparse_page_dmatrix.h" #include "../../../src/data/sparse_page_dmatrix.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h"
namespace xgboost { namespace xgboost {

View File

@ -2,10 +2,10 @@
* Copyright 2021 XGBoost contributors * Copyright 2021 XGBoost contributors
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#include "../../../src/data/sparse_page_source.h" #include "../../../src/data/sparse_page_source.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
namespace xgboost { namespace xgboost {

15
tests/cpp/filesystem.h Normal file
View File

@ -0,0 +1,15 @@
/*!
* Copyright (c) 2022 by XGBoost Contributors
*/
#ifndef XGBOOST_TESTS_CPP_FILESYSTEM_H
#define XGBOOST_TESTS_CPP_FILESYSTEM_H
// A macro used inside `windows.h` to avoid conflicts with `winsock2.h`
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif // WIN32_LEAN_AND_MEAN
#include "dmlc/filesystem.h"
#endif // XGBOOST_TESTS_CPP_FILESYSTEM_H

View File

@ -1,13 +1,13 @@
/*! /*!
* Copyright 2019-2022 XGBoost contributors * Copyright 2019-2022 XGBoost contributors
*/ */
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/generic_parameters.h> #include <xgboost/generic_parameters.h>
#include "../../../src/data/adapter.h" #include "../../../src/data/adapter.h"
#include "../../../src/data/proxy_dmatrix.h" #include "../../../src/data/proxy_dmatrix.h"
#include "../../../src/gbm/gbtree.h" #include "../../../src/gbm/gbtree.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "xgboost/base.h" #include "xgboost/base.h"
#include "xgboost/host_device_vector.h" #include "xgboost/host_device_vector.h"

View File

@ -3,7 +3,6 @@
*/ */
#include "helpers.h" #include "helpers.h"
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/gbm.h> #include <xgboost/gbm.h>
#include <xgboost/json.h> #include <xgboost/json.h>
@ -21,6 +20,7 @@
#include "../../src/data/simple_dmatrix.h" #include "../../src/data/simple_dmatrix.h"
#include "../../src/data/sparse_page_dmatrix.h" #include "../../src/data/sparse_page_dmatrix.h"
#include "../../src/gbm/gbtree_model.h" #include "../../src/gbm/gbtree_model.h"
#include "filesystem.h" // dmlc::TemporaryDirectory
#include "xgboost/c_api.h" #include "xgboost/c_api.h"
#include "xgboost/predictor.h" #include "xgboost/predictor.h"

View File

@ -4,25 +4,24 @@
#ifndef XGBOOST_TESTS_CPP_HELPERS_H_ #ifndef XGBOOST_TESTS_CPP_HELPERS_H_
#define XGBOOST_TESTS_CPP_HELPERS_H_ #define XGBOOST_TESTS_CPP_HELPERS_H_
#include <iostream> #include <gtest/gtest.h>
#include <fstream>
#include <cstdio>
#include <string>
#include <memory>
#include <vector>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <xgboost/base.h> #include <xgboost/base.h>
#include <xgboost/json.h>
#include <xgboost/generic_parameters.h> #include <xgboost/generic_parameters.h>
#include <xgboost/json.h>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include "../../src/common/common.h" #include "../../src/common/common.h"
#include "../../src/gbm/gbtree_model.h"
#include "../../src/data/array_interface.h" #include "../../src/data/array_interface.h"
#include "../../src/gbm/gbtree_model.h"
#include "filesystem.h" // dmlc::TemporaryDirectory
#if defined(__CUDACC__) #if defined(__CUDACC__)
#define DeclareUnifiedTest(name) GPU ## name #define DeclareUnifiedTest(name) GPU ## name

View File

@ -1,14 +1,14 @@
/*! /*!
* Copyright 2017-2020 XGBoost contributors * Copyright 2017-2020 XGBoost contributors
*/ */
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/predictor.h> #include <xgboost/predictor.h>
#include "../../../src/data/adapter.h"
#include "../../../src/gbm/gbtree_model.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "../predictor/test_predictor.h" #include "../predictor/test_predictor.h"
#include "../../../src/gbm/gbtree_model.h"
#include "../../../src/data/adapter.h"
namespace xgboost { namespace xgboost {
TEST(Plugin, OneAPIPredictorBasic) { TEST(Plugin, OneAPIPredictorBasic) {

View File

@ -1,7 +1,6 @@
/*! /*!
* Copyright 2017-2022 XGBoost contributors * Copyright 2017-2022 XGBoost contributors
*/ */
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/predictor.h> #include <xgboost/predictor.h>
@ -9,6 +8,7 @@
#include "../../../src/data/proxy_dmatrix.h" #include "../../../src/data/proxy_dmatrix.h"
#include "../../../src/gbm/gbtree.h" #include "../../../src/gbm/gbtree.h"
#include "../../../src/gbm/gbtree_model.h" #include "../../../src/gbm/gbtree_model.h"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "test_predictor.h" #include "test_predictor.h"

View File

@ -1,7 +1,6 @@
/*! /*!
* Copyright 2017-2020 XGBoost contributors * Copyright 2017-2020 XGBoost contributors
*/ */
#include <dmlc/filesystem.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/c_api.h> #include <xgboost/c_api.h>
#include <xgboost/learner.h> #include <xgboost/learner.h>

View File

@ -2,17 +2,18 @@
* Copyright 2017-2022 by XGBoost contributors * Copyright 2017-2022 by XGBoost contributors
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <vector>
#include <thread>
#include "helpers.h"
#include <dmlc/filesystem.h>
#include <xgboost/learner.h> #include <xgboost/learner.h>
#include <xgboost/version_config.h> #include <xgboost/version_config.h>
#include "xgboost/json.h"
#include <thread>
#include <vector>
#include "../../src/common/io.h" #include "../../src/common/io.h"
#include "../../src/common/random.h"
#include "../../src/common/linalg_op.h" #include "../../src/common/linalg_op.h"
#include "../../src/common/random.h"
#include "filesystem.h" // dmlc::TemporaryDirectory
#include "helpers.h"
#include "xgboost/json.h"
namespace xgboost { namespace xgboost {
TEST(Learner, Basic) { TEST(Learner, Basic) {

View File

@ -1,14 +1,16 @@
// Copyright (c) 2019-2022 by Contributors // Copyright (c) 2019-2022 by Contributors
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <string>
#include <xgboost/learner.h>
#include <xgboost/data.h>
#include <xgboost/base.h> #include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/json.h> #include <xgboost/json.h>
#include "helpers.h" #include <xgboost/learner.h>
#include <string>
#include "../../src/common/io.h" #include "../../src/common/io.h"
#include "../../src/common/random.h" #include "../../src/common/random.h"
#include "filesystem.h" // dmlc::TemporaryDirectory
#include "helpers.h"
namespace xgboost { namespace xgboost {
template <typename Array> template <typename Array>

View File

@ -6,8 +6,8 @@
#include "../../../../src/data/ellpack_page.cuh" #include "../../../../src/data/ellpack_page.cuh"
#include "../../../../src/tree/gpu_hist/gradient_based_sampler.cuh" #include "../../../../src/tree/gpu_hist/gradient_based_sampler.cuh"
#include "../../../../src/tree/param.h" #include "../../../../src/tree/param.h"
#include "../../filesystem.h" // dmlc::TemporaryDirectory
#include "../../helpers.h" #include "../../helpers.h"
#include "dmlc/filesystem.h"
namespace xgboost { namespace xgboost {
namespace tree { namespace tree {

View File

@ -4,22 +4,22 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <thrust/device_vector.h> #include <thrust/device_vector.h>
#include <thrust/host_vector.h> #include <thrust/host_vector.h>
#include <dmlc/filesystem.h>
#include <xgboost/base.h> #include <xgboost/base.h>
#include <random> #include <random>
#include <string> #include <string>
#include <vector> #include <vector>
#include "../../../src/common/common.h"
#include "../../../src/data/sparse_page_source.h"
#include "../../../src/tree/constraints.cuh"
#include "../../../src/tree/updater_gpu_common.cuh"
#include "../../../src/tree/updater_gpu_hist.cu"
#include "../filesystem.h" // dmlc::TemporaryDirectory
#include "../helpers.h" #include "../helpers.h"
#include "../histogram_helpers.h" #include "../histogram_helpers.h"
#include "xgboost/generic_parameters.h" #include "xgboost/generic_parameters.h"
#include "xgboost/json.h" #include "xgboost/json.h"
#include "../../../src/data/sparse_page_source.h"
#include "../../../src/tree/updater_gpu_hist.cu"
#include "../../../src/tree/updater_gpu_common.cuh"
#include "../../../src/common/common.h"
#include "../../../src/tree/constraints.cuh"
namespace xgboost { namespace xgboost {
namespace tree { namespace tree {

View File

@ -1,11 +1,12 @@
// Copyright by Contributors // Copyright by Contributors
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "../helpers.h"
#include "dmlc/filesystem.h"
#include "xgboost/json_io.h"
#include "xgboost/tree_model.h"
#include "../../../src/common/bitfield.h" #include "../../../src/common/bitfield.h"
#include "../../../src/common/categorical.h" #include "../../../src/common/categorical.h"
#include "../filesystem.h"
#include "../helpers.h"
#include "xgboost/json_io.h"
#include "xgboost/tree_model.h"
namespace xgboost { namespace xgboost {
TEST(Tree, ModelShape) { TEST(Tree, ModelShape) {