xgboost
global_config.h
Go to the documentation of this file.
1 
7 #ifndef XGBOOST_GLOBAL_CONFIG_H_
8 #define XGBOOST_GLOBAL_CONFIG_H_
9 
10 #include <dmlc/thread_local.h> // for ThreadLocalStore
11 #include <xgboost/parameter.h> // for XGBoostParameter
12 
13 #include <cstdint> // for int32_t
14 
15 namespace xgboost {
16 struct GlobalConfiguration : public XGBoostParameter<GlobalConfiguration> {
17  std::int32_t verbosity{1};
18  bool use_rmm{false};
19  bool use_cuda_async_pool{false};
20  // This is not a dmlc parameter to avoid conflict with the context class.
21  std::int32_t nthread{0};
23  DMLC_DECLARE_FIELD(verbosity)
24  .set_range(0, 3)
25  .set_default(1) // shows only warning
26  .describe("Flag to print out detailed breakdown of runtime.");
27  DMLC_DECLARE_FIELD(use_rmm).set_default(false).describe(
28  "Whether to use RAPIDS Memory Manager to allocate GPU memory in XGBoost");
29  DMLC_DECLARE_FIELD(use_cuda_async_pool)
30  .set_default(false)
31  .describe("Whether to use the async memory pool in CUDA.");
32  }
33 };
34 
35 using GlobalConfigThreadLocalStore = dmlc::ThreadLocalStore<GlobalConfiguration>;
36 
37 struct InitNewThread {
39  std::int32_t device{-1};
40 
41  void operator()() const;
43 };
44 } // namespace xgboost
45 
46 #endif // XGBOOST_GLOBAL_CONFIG_H_
Learner interface that integrates objective, gbm and evaluation together. This is the user facing XGB...
Definition: base.h:89
dmlc::ThreadLocalStore< GlobalConfiguration > GlobalConfigThreadLocalStore
Definition: global_config.h:35
macro for using C++11 enum class as DMLC parameter
Definition: global_config.h:16
bool use_rmm
Definition: global_config.h:18
bool use_cuda_async_pool
Definition: global_config.h:19
std::int32_t nthread
Definition: global_config.h:21
DMLC_DECLARE_PARAMETER(GlobalConfiguration)
Definition: global_config.h:22
std::int32_t verbosity
Definition: global_config.h:17
Definition: global_config.h:37
GlobalConfiguration config
Definition: global_config.h:38
std::int32_t device
Definition: global_config.h:39
void operator()() const
Definition: parameter.h:84