Fix cpplint. (#4157)
* Add comment after #endif. * Add missing headers.
This commit is contained in:
parent
71a604fae3
commit
2e618af743
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2015 by Contributors
|
/* Copyright (c) 2015 by Contributors
|
||||||
*
|
*
|
||||||
* This file was initially generated using the following R command:
|
* This file was initially generated using the following R command:
|
||||||
* tools::package_native_routine_registration_skeleton('.', con = 'src/init.c', character_only = F)
|
* tools::package_native_routine_registration_skeleton('.', con = 'src/init.c', character_only = F)
|
||||||
* and edited to conform to xgboost C linter requirements. For details, see
|
* and edited to conform to xgboost C linter requirements. For details, see
|
||||||
@ -10,7 +10,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <R_ext/Rdynload.h>
|
#include <R_ext/Rdynload.h>
|
||||||
|
|
||||||
/* FIXME:
|
/* FIXME:
|
||||||
Check these declarations against the C/Fortran source code.
|
Check these declarations against the C/Fortran source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ static const R_CallMethodDef CallEntries[] = {
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
__declspec(dllexport)
|
__declspec(dllexport)
|
||||||
#endif
|
#endif // defined(_WIN32)
|
||||||
void R_init_xgboost(DllInfo *dll) {
|
void R_init_xgboost(DllInfo *dll) {
|
||||||
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
|
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
|
||||||
R_useDynamicSymbols(dll, FALSE);
|
R_useDynamicSymbols(dll, FALSE);
|
||||||
|
|||||||
@ -53,7 +53,7 @@ bool CheckNAN(double v) {
|
|||||||
double LogGamma(double v) {
|
double LogGamma(double v) {
|
||||||
return lgammafn(v);
|
return lgammafn(v);
|
||||||
}
|
}
|
||||||
#endif
|
#endif // !defined(XGBOOST_USE_CUDA)
|
||||||
// customize random engine.
|
// customize random engine.
|
||||||
void CustomGlobalRandomEngine::seed(CustomGlobalRandomEngine::result_type val) {
|
void CustomGlobalRandomEngine::seed(CustomGlobalRandomEngine::result_type val) {
|
||||||
// ignore the seed
|
// ignore the seed
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
/*!
|
||||||
|
* Copyright 2019 by Contributors
|
||||||
|
* \file build_config.h
|
||||||
|
*/
|
||||||
#ifndef XGBOOST_BUILD_CONFIG_H_
|
#ifndef XGBOOST_BUILD_CONFIG_H_
|
||||||
#define XGBOOST_BUILD_CONFIG_H_
|
#define XGBOOST_BUILD_CONFIG_H_
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef XGBOOST_STRICT_R_MODE
|
#ifndef XGBOOST_STRICT_R_MODE
|
||||||
#define XGBOOST_STRICT_R_MODE 0
|
#define XGBOOST_STRICT_R_MODE 0
|
||||||
#endif
|
#endif // XGBOOST_STRICT_R_MODE
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Whether always log console message with time.
|
* \brief Whether always log console message with time.
|
||||||
@ -26,21 +26,21 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef XGBOOST_LOG_WITH_TIME
|
#ifndef XGBOOST_LOG_WITH_TIME
|
||||||
#define XGBOOST_LOG_WITH_TIME 1
|
#define XGBOOST_LOG_WITH_TIME 1
|
||||||
#endif
|
#endif // XGBOOST_LOG_WITH_TIME
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Whether customize the logger outputs.
|
* \brief Whether customize the logger outputs.
|
||||||
*/
|
*/
|
||||||
#ifndef XGBOOST_CUSTOMIZE_LOGGER
|
#ifndef XGBOOST_CUSTOMIZE_LOGGER
|
||||||
#define XGBOOST_CUSTOMIZE_LOGGER XGBOOST_STRICT_R_MODE
|
#define XGBOOST_CUSTOMIZE_LOGGER XGBOOST_STRICT_R_MODE
|
||||||
#endif
|
#endif // XGBOOST_CUSTOMIZE_LOGGER
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Whether to customize global PRNG.
|
* \brief Whether to customize global PRNG.
|
||||||
*/
|
*/
|
||||||
#ifndef XGBOOST_CUSTOMIZE_GLOBAL_PRNG
|
#ifndef XGBOOST_CUSTOMIZE_GLOBAL_PRNG
|
||||||
#define XGBOOST_CUSTOMIZE_GLOBAL_PRNG XGBOOST_STRICT_R_MODE
|
#define XGBOOST_CUSTOMIZE_GLOBAL_PRNG XGBOOST_STRICT_R_MODE
|
||||||
#endif
|
#endif // XGBOOST_CUSTOMIZE_GLOBAL_PRNG
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Check if alignas(*) keyword is supported. (g++ 4.8 or higher)
|
* \brief Check if alignas(*) keyword is supported. (g++ 4.8 or higher)
|
||||||
@ -49,7 +49,7 @@
|
|||||||
#define XGBOOST_ALIGNAS(X) alignas(X)
|
#define XGBOOST_ALIGNAS(X) alignas(X)
|
||||||
#else
|
#else
|
||||||
#define XGBOOST_ALIGNAS(X)
|
#define XGBOOST_ALIGNAS(X)
|
||||||
#endif
|
#endif // defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
|
||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) && \
|
#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) && \
|
||||||
!defined(__CUDACC__)
|
!defined(__CUDACC__)
|
||||||
@ -64,7 +64,7 @@
|
|||||||
#else
|
#else
|
||||||
#define XGBOOST_PARALLEL_SORT(X, Y, Z) std::sort((X), (Y), (Z))
|
#define XGBOOST_PARALLEL_SORT(X, Y, Z) std::sort((X), (Y), (Z))
|
||||||
#define XGBOOST_PARALLEL_STABLE_SORT(X, Y, Z) std::stable_sort((X), (Y), (Z))
|
#define XGBOOST_PARALLEL_STABLE_SORT(X, Y, Z) std::stable_sort((X), (Y), (Z))
|
||||||
#endif
|
#endif // GLIBC VERSION
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Tag function as usable by device
|
* \brief Tag function as usable by device
|
||||||
@ -73,7 +73,7 @@
|
|||||||
#define XGBOOST_DEVICE __host__ __device__
|
#define XGBOOST_DEVICE __host__ __device__
|
||||||
#else
|
#else
|
||||||
#define XGBOOST_DEVICE
|
#define XGBOOST_DEVICE
|
||||||
#endif
|
#endif // defined (__CUDA__) || defined(__NVCC__)
|
||||||
|
|
||||||
/*! \brief namespace of xgboost*/
|
/*! \brief namespace of xgboost*/
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
@ -215,8 +215,8 @@ using bst_omp_uint = dmlc::omp_uint; // NOLINT
|
|||||||
#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
|
#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
|
||||||
#define override
|
#define override
|
||||||
#define final
|
#define final
|
||||||
#endif
|
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 8
|
||||||
#endif
|
#endif // DMLC_USE_CXX11 && defined(__GNUC__) && !defined(__clang_version__)
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|
||||||
/* Always keep this #include at the bottom of xgboost/base.h */
|
/* Always keep this #include at the bottom of xgboost/base.h */
|
||||||
|
|||||||
@ -13,6 +13,6 @@
|
|||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
// Enable __builtin_prefetch for GCC
|
// Enable __builtin_prefetch for GCC
|
||||||
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
|
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
|
||||||
#endif
|
#endif // GUARDS
|
||||||
|
|
||||||
#endif // XGBOOST_BUILD_CONFIG_H_
|
#endif // XGBOOST_BUILD_CONFIG_H_
|
||||||
|
|||||||
@ -10,11 +10,12 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define XGB_EXTERN_C extern "C"
|
#define XGB_EXTERN_C extern "C"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdint>
|
||||||
#else
|
#else
|
||||||
#define XGB_EXTERN_C
|
#define XGB_EXTERN_C
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif // __cplusplus
|
||||||
|
|
||||||
// XGBoost C API will include APIs in Rabit C API
|
// XGBoost C API will include APIs in Rabit C API
|
||||||
#include <rabit/c_api.h>
|
#include <rabit/c_api.h>
|
||||||
@ -23,7 +24,7 @@
|
|||||||
#define XGB_DLL XGB_EXTERN_C __declspec(dllexport)
|
#define XGB_DLL XGB_EXTERN_C __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define XGB_DLL XGB_EXTERN_C
|
#define XGB_DLL XGB_EXTERN_C
|
||||||
#endif
|
#endif // defined(_MSC_VER) || defined(_WIN32)
|
||||||
|
|
||||||
// manually define unsigned long
|
// manually define unsigned long
|
||||||
typedef uint64_t bst_ulong; // NOLINT(*)
|
typedef uint64_t bst_ulong; // NOLINT(*)
|
||||||
@ -49,7 +50,7 @@ typedef struct { // NOLINT(*)
|
|||||||
long* offset; // NOLINT(*)
|
long* offset; // NOLINT(*)
|
||||||
#else
|
#else
|
||||||
int64_t* offset; // NOLINT(*)
|
int64_t* offset; // NOLINT(*)
|
||||||
#endif
|
#endif // __APPLE__
|
||||||
/*! \brief labels of each instance */
|
/*! \brief labels of each instance */
|
||||||
float* label;
|
float* label;
|
||||||
/*! \brief weight of each instance, can be NULL */
|
/*! \brief weight of each instance, can be NULL */
|
||||||
@ -562,7 +563,7 @@ XGB_DLL int XGBoosterGetAttr(BoosterHandle handle,
|
|||||||
*
|
*
|
||||||
* \param handle handle
|
* \param handle handle
|
||||||
* \param key The key of the attribute.
|
* \param key The key of the attribute.
|
||||||
* \param value The value to be saved.
|
* \param value The value to be saved.
|
||||||
* If nullptr, the attribute would be deleted.
|
* If nullptr, the attribute would be deleted.
|
||||||
* \return 0 when success, -1 when failure happens
|
* \return 0 when success, -1 when failure happens
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#include <rabit/rabit.h>
|
#include <rabit/rabit.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "./base.h"
|
#include "./base.h"
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class BaseLogger {
|
|||||||
BaseLogger() {
|
BaseLogger() {
|
||||||
#if XGBOOST_LOG_WITH_TIME
|
#if XGBOOST_LOG_WITH_TIME
|
||||||
log_stream_ << "[" << dmlc::DateLogger().HumanDate() << "] ";
|
log_stream_ << "[" << dmlc::DateLogger().HumanDate() << "] ";
|
||||||
#endif
|
#endif // XGBOOST_LOG_WITH_TIME
|
||||||
}
|
}
|
||||||
std::ostream& stream() { return log_stream_; } // NOLINT
|
std::ostream& stream() { return log_stream_; } // NOLINT
|
||||||
|
|
||||||
@ -116,14 +116,14 @@ class LogCallbackRegistry {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif // !defined(XGBOOST_STRICT_R_MODE) || XGBOOST_STRICT_R_MODE == 0
|
||||||
|
|
||||||
using LogCallbackRegistryStore = dmlc::ThreadLocalStore<LogCallbackRegistry>;
|
using LogCallbackRegistryStore = dmlc::ThreadLocalStore<LogCallbackRegistry>;
|
||||||
|
|
||||||
// Redefines LOG_WARNING for controling verbosity
|
// Redefines LOG_WARNING for controling verbosity
|
||||||
#if defined(LOG_WARNING)
|
#if defined(LOG_WARNING)
|
||||||
#undef LOG_WARNING
|
#undef LOG_WARNING
|
||||||
#endif
|
#endif // defined(LOG_WARNING)
|
||||||
#define LOG_WARNING \
|
#define LOG_WARNING \
|
||||||
if (::xgboost::ConsoleLogger::ShouldLog( \
|
if (::xgboost::ConsoleLogger::ShouldLog( \
|
||||||
::xgboost::ConsoleLogger::LV::kWarning)) \
|
::xgboost::ConsoleLogger::LV::kWarning)) \
|
||||||
@ -133,7 +133,7 @@ using LogCallbackRegistryStore = dmlc::ThreadLocalStore<LogCallbackRegistry>;
|
|||||||
// Redefines LOG_INFO for controling verbosity
|
// Redefines LOG_INFO for controling verbosity
|
||||||
#if defined(LOG_INFO)
|
#if defined(LOG_INFO)
|
||||||
#undef LOG_INFO
|
#undef LOG_INFO
|
||||||
#endif
|
#endif // defined(LOG_INFO)
|
||||||
#define LOG_INFO \
|
#define LOG_INFO \
|
||||||
if (::xgboost::ConsoleLogger::ShouldLog( \
|
if (::xgboost::ConsoleLogger::ShouldLog( \
|
||||||
::xgboost::ConsoleLogger::LV::kInfo)) \
|
::xgboost::ConsoleLogger::LV::kInfo)) \
|
||||||
@ -142,7 +142,7 @@ using LogCallbackRegistryStore = dmlc::ThreadLocalStore<LogCallbackRegistry>;
|
|||||||
|
|
||||||
#if defined(LOG_DEBUG)
|
#if defined(LOG_DEBUG)
|
||||||
#undef LOG_DEBUG
|
#undef LOG_DEBUG
|
||||||
#endif
|
#endif // defined(LOG_DEBUG)
|
||||||
#define LOG_DEBUG \
|
#define LOG_DEBUG \
|
||||||
if (::xgboost::ConsoleLogger::ShouldLog( \
|
if (::xgboost::ConsoleLogger::ShouldLog( \
|
||||||
::xgboost::ConsoleLogger::LV::kDebug)) \
|
::xgboost::ConsoleLogger::LV::kDebug)) \
|
||||||
@ -152,7 +152,7 @@ using LogCallbackRegistryStore = dmlc::ThreadLocalStore<LogCallbackRegistry>;
|
|||||||
// redefines the logging macro if not existed
|
// redefines the logging macro if not existed
|
||||||
#ifndef LOG
|
#ifndef LOG
|
||||||
#define LOG(severity) LOG_##severity.stream()
|
#define LOG(severity) LOG_##severity.stream()
|
||||||
#endif
|
#endif // LOG
|
||||||
|
|
||||||
// Enable LOG(CONSOLE) for print messages to console.
|
// Enable LOG(CONSOLE) for print messages to console.
|
||||||
#define LOG_CONSOLE ::xgboost::ConsoleLogger( \
|
#define LOG_CONSOLE ::xgboost::ConsoleLogger( \
|
||||||
|
|||||||
@ -7,11 +7,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <xgboost/base.h>
|
#include <xgboost/base.h>
|
||||||
#include <xgboost/data.h>
|
#include <xgboost/data.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "../../src/gbm/gbtree_model.h"
|
#include "../../src/gbm/gbtree_model.h"
|
||||||
#include "../../src/common/host_device_vector.h"
|
#include "../../src/common/host_device_vector.h"
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,6 @@ GlobalRandomEngine& GlobalRandom() {
|
|||||||
int AllVisibleImpl::AllVisible() {
|
int AllVisibleImpl::AllVisible() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // !defined(XGBOOST_USE_CUDA)
|
||||||
|
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#define WITH_CUDA() false
|
#define WITH_CUDA() false
|
||||||
|
|
||||||
#endif
|
#endif // defined(__CUDACC__)
|
||||||
|
|
||||||
namespace dh {
|
namespace dh {
|
||||||
#if defined(__CUDACC__)
|
#if defined(__CUDACC__)
|
||||||
@ -44,7 +44,7 @@ inline cudaError_t ThrowOnCudaError(cudaError_t code, const char *file,
|
|||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(__CUDACC__)
|
||||||
} // namespace dh
|
} // namespace dh
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#ifdef __CUDACC__
|
#ifdef __CUDACC__
|
||||||
#include "device_helpers.cuh"
|
#include "device_helpers.cuh"
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace common {
|
namespace common {
|
||||||
@ -115,7 +115,7 @@ class CompressedBufferWriter {
|
|||||||
symbol >>= 8;
|
symbol >>= 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
|
|
||||||
template <typename IterT>
|
template <typename IterT>
|
||||||
void Write(CompressedByteT *buffer, IterT input_begin, IterT input_end) {
|
void Write(CompressedByteT *buffer, IterT input_begin, IterT input_end) {
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
#define PREFETCH_READ_T0(addr) __builtin_prefetch(reinterpret_cast<const char*>(addr), 0, 3)
|
#define PREFETCH_READ_T0(addr) __builtin_prefetch(reinterpret_cast<const char*>(addr), 0, 3)
|
||||||
#else // no SW pre-fetching available; PREFETCH_READ_T0 is no-op
|
#else // no SW pre-fetching available; PREFETCH_READ_T0 is no-op
|
||||||
#define PREFETCH_READ_T0(addr) do {} while (0)
|
#define PREFETCH_READ_T0(addr) do {} while (0)
|
||||||
#endif
|
#endif // defined(XGBOOST_MM_PREFETCH_PRESENT)
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace common {
|
namespace common {
|
||||||
@ -544,7 +544,7 @@ void GHistBuilder::BuildBlockHist(const std::vector<GradientPair>& gpair,
|
|||||||
|
|
||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP)
|
||||||
const auto nthread = static_cast<bst_omp_uint>(this->nthread_);
|
const auto nthread = static_cast<bst_omp_uint>(this->nthread_);
|
||||||
#endif
|
#endif // defined(_OPENMP)
|
||||||
tree::GradStats* p_hist = hist.data();
|
tree::GradStats* p_hist = hist.data();
|
||||||
|
|
||||||
#pragma omp parallel for num_threads(nthread) schedule(guided)
|
#pragma omp parallel for num_threads(nthread) schedule(guided)
|
||||||
@ -590,7 +590,7 @@ void GHistBuilder::SubtractionTrick(GHistRow self, GHistRow sibling, GHistRow pa
|
|||||||
|
|
||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP)
|
||||||
const auto nthread = static_cast<bst_omp_uint>(this->nthread_);
|
const auto nthread = static_cast<bst_omp_uint>(this->nthread_);
|
||||||
#endif
|
#endif // defined(_OPENMP)
|
||||||
tree::GradStats* p_self = self.data();
|
tree::GradStats* p_self = self.data();
|
||||||
tree::GradStats* p_sibling = sibling.data();
|
tree::GradStats* p_sibling = sibling.data();
|
||||||
tree::GradStats* p_parent = parent.data();
|
tree::GradStats* p_parent = parent.data();
|
||||||
|
|||||||
@ -159,4 +159,4 @@ template class HostDeviceVector<size_t>;
|
|||||||
|
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
|
|||||||
@ -57,6 +57,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
@ -66,7 +67,7 @@
|
|||||||
// is included from a .cu file
|
// is included from a .cu file
|
||||||
#ifdef __CUDACC__
|
#ifdef __CUDACC__
|
||||||
#include <thrust/device_ptr.h>
|
#include <thrust/device_ptr.h>
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ namespace xgboost {
|
|||||||
// Sets a function to call instead of cudaSetDevice();
|
// Sets a function to call instead of cudaSetDevice();
|
||||||
// only added for testing
|
// only added for testing
|
||||||
void SetCudaSetDeviceHandler(void (*handler)(int));
|
void SetCudaSetDeviceHandler(void (*handler)(int));
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
|
|
||||||
template <typename T> struct HostDeviceVectorImpl;
|
template <typename T> struct HostDeviceVectorImpl;
|
||||||
|
|
||||||
@ -233,7 +234,7 @@ class HostDeviceVector {
|
|||||||
|
|
||||||
void ScatterFrom(thrust::device_ptr<const T> begin, thrust::device_ptr<const T> end);
|
void ScatterFrom(thrust::device_ptr<const T> begin, thrust::device_ptr<const T> end);
|
||||||
void GatherTo(thrust::device_ptr<T> begin, thrust::device_ptr<T> end) const;
|
void GatherTo(thrust::device_ptr<T> begin, thrust::device_ptr<T> end) const;
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
|
|
||||||
void Fill(T v);
|
void Fill(T v);
|
||||||
void Copy(const HostDeviceVector<T>& other);
|
void Copy(const HostDeviceVector<T>& other);
|
||||||
|
|||||||
@ -123,7 +123,7 @@ inline bool CheckNAN(T v) {
|
|||||||
return (_isnan(v) != 0);
|
return (_isnan(v) != 0);
|
||||||
#else
|
#else
|
||||||
return std::isnan(v);
|
return std::isnan(v);
|
||||||
#endif
|
#endif // _MSC_VER
|
||||||
}
|
}
|
||||||
#endif // XGBOOST_STRICT_R_MODE_
|
#endif // XGBOOST_STRICT_R_MODE_
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ XGBOOST_DEVICE inline T LogGamma(T v) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
return lgamma(v);
|
return lgamma(v);
|
||||||
#endif
|
#endif // _MSC_VER
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // XGBOOST_STRICT_R_MODE && !defined(XGBOOST_USE_CUDA)
|
#endif // XGBOOST_STRICT_R_MODE && !defined(XGBOOST_USE_CUDA)
|
||||||
|
|||||||
@ -66,7 +66,7 @@ typedef CustomGlobalRandomEngine GlobalRandomEngine;
|
|||||||
* \brief global random engine
|
* \brief global random engine
|
||||||
*/
|
*/
|
||||||
using GlobalRandomEngine = RandomEngine;
|
using GlobalRandomEngine = RandomEngine;
|
||||||
#endif
|
#endif // XGBOOST_CUSTOMIZE_GLOBAL_PRNG
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief global singleton of a random engine.
|
* \brief global singleton of a random engine.
|
||||||
|
|||||||
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#define __span_noexcept noexcept
|
#define __span_noexcept noexcept
|
||||||
|
|
||||||
#endif
|
#endif // defined(_MSC_VER) && _MSC_VER < 1910
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace common {
|
namespace common {
|
||||||
@ -85,7 +85,7 @@ namespace common {
|
|||||||
#define SPAN_CHECK KERNEL_CHECK
|
#define SPAN_CHECK KERNEL_CHECK
|
||||||
#else
|
#else
|
||||||
#define SPAN_CHECK CHECK // check from dmlc
|
#define SPAN_CHECK CHECK // check from dmlc
|
||||||
#endif
|
#endif // __CUDA_ARCH__
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
/*!
|
/*!
|
||||||
@ -101,7 +101,7 @@ using ptrdiff_t = int64_t; // NOLINT
|
|||||||
constexpr const detail::ptrdiff_t dynamic_extent = -1; // NOLINT
|
constexpr const detail::ptrdiff_t dynamic_extent = -1; // NOLINT
|
||||||
#else
|
#else
|
||||||
constexpr detail::ptrdiff_t dynamic_extent = -1; // NOLINT
|
constexpr detail::ptrdiff_t dynamic_extent = -1; // NOLINT
|
||||||
#endif
|
#endif // defined(_MSC_VER) && _MSC_VER < 1910
|
||||||
|
|
||||||
enum class byte : unsigned char {}; // NOLINT
|
enum class byte : unsigned char {}; // NOLINT
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ struct Monitor {
|
|||||||
cudaSetDevice(device);
|
cudaSetDevice(device);
|
||||||
cudaDeviceSynchronize();
|
cudaDeviceSynchronize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
}
|
}
|
||||||
statistics_map[name].timer.Start();
|
statistics_map[name].timer.Start();
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ struct Monitor {
|
|||||||
cudaSetDevice(device);
|
cudaSetDevice(device);
|
||||||
cudaDeviceSynchronize();
|
cudaDeviceSynchronize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif // __CUDACC__
|
||||||
}
|
}
|
||||||
this->Stop(name);
|
this->Stop(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <dmlc/omp.h>
|
#include <dmlc/omp.h>
|
||||||
#include <xgboost/data.h>
|
#include <xgboost/data.h>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <type_traits> // enable_if
|
#include <type_traits> // enable_if
|
||||||
|
|
||||||
@ -15,7 +16,7 @@
|
|||||||
|
|
||||||
#if defined (__CUDACC__)
|
#if defined (__CUDACC__)
|
||||||
#include "device_helpers.cuh"
|
#include "device_helpers.cuh"
|
||||||
#endif
|
#endif // defined (__CUDACC__)
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace common {
|
namespace common {
|
||||||
@ -32,7 +33,7 @@ __global__ void LaunchCUDAKernel(Functor _func, Range _range,
|
|||||||
_func(i, _spans...);
|
_func(i, _spans...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(__CUDACC__)
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ class Transform {
|
|||||||
void LaunchCUDA(Functor _func, HDV*... _vectors) const {
|
void LaunchCUDA(Functor _func, HDV*... _vectors) const {
|
||||||
LOG(FATAL) << "Not part of device code. WITH_CUDA: " << WITH_CUDA();
|
LOG(FATAL) << "Not part of device code. WITH_CUDA: " << WITH_CUDA();
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(__CUDACC__)
|
||||||
|
|
||||||
template <typename... HDV>
|
template <typename... HDV>
|
||||||
void LaunchCPU(Functor func, HDV*... vectors) const {
|
void LaunchCPU(Functor func, HDV*... vectors) const {
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
#if DMLC_ENABLE_STD_THREAD
|
#if DMLC_ENABLE_STD_THREAD
|
||||||
#include "./sparse_page_source.h"
|
#include "./sparse_page_source.h"
|
||||||
#include "./sparse_page_dmatrix.h"
|
#include "./sparse_page_dmatrix.h"
|
||||||
#endif
|
#endif // DMLC_ENABLE_STD_THREAD
|
||||||
|
|
||||||
namespace dmlc {
|
namespace dmlc {
|
||||||
DMLC_REGISTRY_ENABLE(::xgboost::data::SparsePageFormatReg);
|
DMLC_REGISTRY_ENABLE(::xgboost::data::SparsePageFormatReg);
|
||||||
@ -264,7 +264,7 @@ DMatrix* DMatrix::Create(dmlc::Parser<uint32_t>* parser,
|
|||||||
#else
|
#else
|
||||||
LOG(FATAL) << "External memory is not enabled in mingw";
|
LOG(FATAL) << "External memory is not enabled in mingw";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
#endif // DMLC_ENABLE_STD_THREAD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ DMatrix* DMatrix::Create(std::unique_ptr<DataSource>&& source,
|
|||||||
#else
|
#else
|
||||||
LOG(FATAL) << "External memory is not enabled in mingw";
|
LOG(FATAL) << "External memory is not enabled in mingw";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
#endif // DMLC_ENABLE_STD_THREAD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|||||||
@ -9,9 +9,13 @@
|
|||||||
|
|
||||||
#include <xgboost/base.h>
|
#include <xgboost/base.h>
|
||||||
#include <xgboost/data.h>
|
#include <xgboost/data.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "simple_csr_source.h"
|
#include "simple_csr_source.h"
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
|
|||||||
@ -100,4 +100,4 @@ bool SparsePageDMatrix::SingleColBlock() const {
|
|||||||
}
|
}
|
||||||
} // namespace data
|
} // namespace data
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
#endif
|
#endif // DMLC_ENABLE_STD_THREAD
|
||||||
|
|||||||
@ -9,9 +9,11 @@
|
|||||||
|
|
||||||
#include <xgboost/data.h>
|
#include <xgboost/data.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "sparse_page_source.h"
|
#include "sparse_page_source.h"
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ GetCacheShards(const std::string& cache_info) {
|
|||||||
cache_shards[0] = cache_info.substr(0, 2) + cache_shards[0];
|
cache_shards[0] = cache_info.substr(0, 2) + cache_shards[0];
|
||||||
return cache_shards;
|
return cache_shards;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // (defined _WIN32) || (defined __CYGWIN__)
|
||||||
return xgboost::common::Split(cache_info, ':');
|
return xgboost::common::Split(cache_info, ':');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,4 +291,4 @@ void SparsePageSource::CreateColumnPage(DMatrix* src,
|
|||||||
}
|
}
|
||||||
} // namespace data
|
} // namespace data
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
#endif
|
#endif // DMLC_ENABLE_STD_THREAD
|
||||||
|
|||||||
@ -10,9 +10,12 @@
|
|||||||
#include <xgboost/base.h>
|
#include <xgboost/base.h>
|
||||||
#include <xgboost/data.h>
|
#include <xgboost/data.h>
|
||||||
#include <dmlc/threadediter.h>
|
#include <dmlc/threadediter.h>
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "sparse_page_writer.h"
|
#include "sparse_page_writer.h"
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
#if DMLC_ENABLE_STD_THREAD
|
#if DMLC_ENABLE_STD_THREAD
|
||||||
#include <dmlc/concurrency.h>
|
#include <dmlc/concurrency.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#endif
|
#endif // DMLC_ENABLE_STD_THREAD
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace data {
|
namespace data {
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
#include <dmlc/parameter.h>
|
#include <dmlc/parameter.h>
|
||||||
#include <dmlc/io.h>
|
#include <dmlc/io.h>
|
||||||
#include <xgboost/tree_model.h>
|
#include <xgboost/tree_model.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@ -178,7 +178,7 @@ class LearnerImpl : public Learner {
|
|||||||
static void AssertGPUSupport() {
|
static void AssertGPUSupport() {
|
||||||
#ifndef XGBOOST_USE_CUDA
|
#ifndef XGBOOST_USE_CUDA
|
||||||
LOG(FATAL) << "XGBoost version not compiled with GPU support.";
|
LOG(FATAL) << "XGBoost version not compiled with GPU support.";
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ class LearnerImpl : public Learner {
|
|||||||
cfg_["predictor"] = "cpu_predictor";
|
cfg_["predictor"] = "cpu_predictor";
|
||||||
kv.second = "cpu_predictor";
|
kv.second = "cpu_predictor";
|
||||||
}
|
}
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
attributes_ =
|
attributes_ =
|
||||||
|
|||||||
@ -30,6 +30,6 @@ DMLC_REGISTRY_LINK_TAG(updater_shotgun);
|
|||||||
DMLC_REGISTRY_LINK_TAG(updater_coordinate);
|
DMLC_REGISTRY_LINK_TAG(updater_coordinate);
|
||||||
#ifdef XGBOOST_USE_CUDA
|
#ifdef XGBOOST_USE_CUDA
|
||||||
DMLC_REGISTRY_LINK_TAG(updater_gpu_coordinate);
|
DMLC_REGISTRY_LINK_TAG(updater_gpu_coordinate);
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
} // namespace linear
|
} // namespace linear
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|||||||
@ -35,7 +35,7 @@ TrackerLogger::~TrackerLogger() {
|
|||||||
|
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|
||||||
#endif
|
#endif // !defined(XGBOOST_STRICT_R_MODE) || XGBOOST_STRICT_R_MODE == 0
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
|
|
||||||
|
|||||||
@ -5,4 +5,4 @@
|
|||||||
|
|
||||||
#if !defined(XGBOOST_USE_CUDA)
|
#if !defined(XGBOOST_USE_CUDA)
|
||||||
#include "elementwise_metric.cu"
|
#include "elementwise_metric.cu"
|
||||||
#endif
|
#endif // !defined(XGBOOST_USE_CUDA)
|
||||||
|
|||||||
@ -144,7 +144,7 @@ class MetricsReduction {
|
|||||||
result.weights_sum_ += res_per_device[i].weights_sum_;
|
result.weights_sum_ += res_per_device[i].weights_sum_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(XGBOOST_USE_CUDA)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ class MetricsReduction {
|
|||||||
EvalRow policy_;
|
EvalRow policy_;
|
||||||
#if defined(XGBOOST_USE_CUDA)
|
#if defined(XGBOOST_USE_CUDA)
|
||||||
std::vector<dh::CubMemory> allocators_;
|
std::vector<dh::CubMemory> allocators_;
|
||||||
#endif
|
#endif // defined(XGBOOST_USE_CUDA)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EvalRowRMSE {
|
struct EvalRowRMSE {
|
||||||
|
|||||||
@ -15,4 +15,4 @@ DMLC_REGISTRY_FILE_TAG(hinge_obj);
|
|||||||
|
|
||||||
#ifndef XGBOOST_USE_CUDA
|
#ifndef XGBOOST_USE_CUDA
|
||||||
#include "hinge.cu"
|
#include "hinge.cu"
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
|
|||||||
@ -16,7 +16,7 @@ namespace obj {
|
|||||||
|
|
||||||
#if defined(XGBOOST_USE_CUDA)
|
#if defined(XGBOOST_USE_CUDA)
|
||||||
DMLC_REGISTRY_FILE_TAG(hinge_obj_gpu);
|
DMLC_REGISTRY_FILE_TAG(hinge_obj_gpu);
|
||||||
#endif
|
#endif // defined(XGBOOST_USE_CUDA)
|
||||||
|
|
||||||
struct HingeObjParam : public dmlc::Parameter<HingeObjParam> {
|
struct HingeObjParam : public dmlc::Parameter<HingeObjParam> {
|
||||||
int n_gpus;
|
int n_gpus;
|
||||||
|
|||||||
@ -15,4 +15,4 @@ DMLC_REGISTRY_FILE_TAG(multiclass_obj);
|
|||||||
|
|
||||||
#ifndef XGBOOST_USE_CUDA
|
#ifndef XGBOOST_USE_CUDA
|
||||||
#include "multiclass_obj.cu"
|
#include "multiclass_obj.cu"
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
|
|||||||
@ -21,7 +21,7 @@ namespace obj {
|
|||||||
|
|
||||||
#if defined(XGBOOST_USE_CUDA)
|
#if defined(XGBOOST_USE_CUDA)
|
||||||
DMLC_REGISTRY_FILE_TAG(multiclass_obj_gpu);
|
DMLC_REGISTRY_FILE_TAG(multiclass_obj_gpu);
|
||||||
#endif
|
#endif // defined(XGBOOST_USE_CUDA)
|
||||||
|
|
||||||
struct SoftmaxMultiClassParam : public dmlc::Parameter<SoftmaxMultiClassParam> {
|
struct SoftmaxMultiClassParam : public dmlc::Parameter<SoftmaxMultiClassParam> {
|
||||||
int num_class;
|
int num_class;
|
||||||
|
|||||||
@ -38,7 +38,7 @@ DMLC_REGISTRY_LINK_TAG(multiclass_obj_gpu);
|
|||||||
DMLC_REGISTRY_LINK_TAG(regression_obj);
|
DMLC_REGISTRY_LINK_TAG(regression_obj);
|
||||||
DMLC_REGISTRY_LINK_TAG(hinge_obj);
|
DMLC_REGISTRY_LINK_TAG(hinge_obj);
|
||||||
DMLC_REGISTRY_LINK_TAG(multiclass_obj);
|
DMLC_REGISTRY_LINK_TAG(multiclass_obj);
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
DMLC_REGISTRY_LINK_TAG(rank_obj);
|
DMLC_REGISTRY_LINK_TAG(rank_obj);
|
||||||
} // namespace obj
|
} // namespace obj
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|||||||
@ -15,4 +15,4 @@ DMLC_REGISTRY_FILE_TAG(regression_obj);
|
|||||||
|
|
||||||
#ifndef XGBOOST_USE_CUDA
|
#ifndef XGBOOST_USE_CUDA
|
||||||
#include "regression_obj.cu"
|
#include "regression_obj.cu"
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
|
|||||||
@ -24,7 +24,7 @@ namespace obj {
|
|||||||
|
|
||||||
#if defined(XGBOOST_USE_CUDA)
|
#if defined(XGBOOST_USE_CUDA)
|
||||||
DMLC_REGISTRY_FILE_TAG(regression_obj_gpu);
|
DMLC_REGISTRY_FILE_TAG(regression_obj_gpu);
|
||||||
#endif
|
#endif // defined(XGBOOST_USE_CUDA)
|
||||||
|
|
||||||
struct RegLossParam : public dmlc::Parameter<RegLossParam> {
|
struct RegLossParam : public dmlc::Parameter<RegLossParam> {
|
||||||
float scale_pos_weight;
|
float scale_pos_weight;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ namespace predictor {
|
|||||||
// List of files that will be force linked in static links.
|
// List of files that will be force linked in static links.
|
||||||
#ifdef XGBOOST_USE_CUDA
|
#ifdef XGBOOST_USE_CUDA
|
||||||
DMLC_REGISTRY_LINK_TAG(gpu_predictor);
|
DMLC_REGISTRY_LINK_TAG(gpu_predictor);
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
DMLC_REGISTRY_LINK_TAG(cpu_predictor);
|
DMLC_REGISTRY_LINK_TAG(cpu_predictor);
|
||||||
} // namespace predictor
|
} // namespace predictor
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#include <dmlc/registry.h>
|
#include <dmlc/registry.h>
|
||||||
#include <xgboost/base.h>
|
#include <xgboost/base.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@ -37,6 +37,6 @@ DMLC_REGISTRY_LINK_TAG(updater_sync);
|
|||||||
#ifdef XGBOOST_USE_CUDA
|
#ifdef XGBOOST_USE_CUDA
|
||||||
DMLC_REGISTRY_LINK_TAG(updater_gpu);
|
DMLC_REGISTRY_LINK_TAG(updater_gpu);
|
||||||
DMLC_REGISTRY_LINK_TAG(updater_gpu_hist);
|
DMLC_REGISTRY_LINK_TAG(updater_gpu_hist);
|
||||||
#endif
|
#endif // XGBOOST_USE_CUDA
|
||||||
} // namespace tree
|
} // namespace tree
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|||||||
@ -597,7 +597,7 @@ class ColMaker: public TreeUpdater {
|
|||||||
const auto num_features = static_cast<bst_omp_uint>(feat_set.size());
|
const auto num_features = static_cast<bst_omp_uint>(feat_set.size());
|
||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP)
|
||||||
const int batch_size = std::max(static_cast<int>(num_features / this->nthread_ / 32), 1);
|
const int batch_size = std::max(static_cast<int>(num_features / this->nthread_ / 32), 1);
|
||||||
#endif
|
#endif // defined(_OPENMP)
|
||||||
int poption = param_.parallel_option;
|
int poption = param_.parallel_option;
|
||||||
if (poption == 2) {
|
if (poption == 2) {
|
||||||
poption = static_cast<int>(num_features) * 2 < this->nthread_ ? 1 : 0;
|
poption = static_cast<int>(num_features) * 2 < this->nthread_ ? 1 : 0;
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <unordered_map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "./param.h"
|
#include "./param.h"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user