| xgboost | 
XGBoost 的运行时上下文。包含线程和设备等信息。 更多...
#include <context.h>


| 公共成员函数 | |
| Context () | |
| void | Init (Args const &kwargs) | 
| 模板<typename Container > | |
| Args | UpdateAllowUnknown (Container const &kwargs) | 
| std::int32_t | Threads () const | 
| 根据 `nthread` 参数和系统设置,返回自动选择的线程数。 更多... | |
| bool | IsCPU () const | 
| XGBoost 是否在 CPU 上运行? 更多... | |
| bool | IsCUDA () const | 
| XGBoost 是否在 CUDA 设备上运行? 更多... | |
| bool | IsSyclDefault () const | 
| XGBoost 是否在默认 SYCL 设备上运行? 更多... | |
| bool | IsSyclCPU () const | 
| XGBoost 是否在 SYCL CPU 上运行? 更多... | |
| bool | IsSyclGPU () const | 
| XGBoost 是否在 SYCL GPU 上运行? 更多... | |
| bool | IsSycl () const | 
| XGBoost 是否在任何 SYCL 设备上运行? 更多... | |
| DeviceOrd | Device () const | 
| 获取当前设备和序号。 更多... | |
| DeviceOrd | DeviceFP64 () const | 
| 获取当前设备和序号,如果支持 fp64,否则返回默认 CPU。 更多... | |
| bst_d_ordinal_t | Ordinal () const | 
| 获取 CUDA 设备序号。如果 XGBoost 在 CPU 上运行,则为 -1。 更多... | |
| std::string | DeviceName () const | 
| 当前设备的名称。 更多... | |
| CUDAContext const * | CUDACtx () const | 
| 获取分配器和流的 CUDA 设备上下文。 更多... | |
| Context | MakeCUDA (bst_d_ordinal_t ordinal=0) const | 
| 根据当前上下文创建 CUDA 上下文。 更多... | |
| Context | MakeCPU () const | 
| 根据当前上下文创建 CPU 上下文。 更多... | |
| 模板<typename CPUFn , typename CUDAFn > | |
| decltype(auto) | DispatchDevice (CPUFn &&cpu_fn, CUDAFn &&cuda_fn) const | 
| 根据当前设备调用函数。 更多... | |
| 模板<typename CPUFn , typename CUDAFn , typename SYCLFn > | |
| decltype(auto) | DispatchDevice (CPUFn &&cpu_fn, CUDAFn &&cuda_fn, SYCLFn &&sycl_fn) const | 
| 为 SYCL 设备调用函数。 更多... | |
| DMLC_DECLARE_PARAMETER (Context) | |
|  从 xgboost::XGBoostParameter< Context > 继承的公共成员函数 | |
| Args | UpdateAllowUnknown (Container const &kwargs) | 
| bool | GetInitialised () const | 
| 公共属性 | |
| std::int32_t | nthread {0} | 
| std::int64_t | seed {kDefaultSeed} | 
| bool | seed_per_iteration {false} | 
| bool | fail_on_invalid_gpu_id {false} | 
| bool | validate_parameters {false} | 
| 静态公共属性 | |
| static constexpr std::int64_t | kDefaultSeed = 0 | 
| 附加继承成员 | |
|  从 xgboost::XGBoostParameter< Context > 继承的受保护属性 | |
| bool | initialised_ | 
XGBoost的运行时上下文。包含线程和设备等信息。
| xgboost::Context::Context | ( | ) | 
| CUDAContext const* xgboost::Context::CUDACtx | ( | ) | const | 
获取分配器和流的 CUDA 设备上下文。
| 
 | inline | 
获取当前设备和序号。
| DeviceOrd xgboost::Context::DeviceFP64 | ( | ) | const | 
获取当前设备和序号,如果支持 fp64,否则返回默认 CPU。
| 
 | inline | 
当前设备的名称。
| 
 | inline | 
根据当前设备调用函数。
| 
 | inline | 
为 SYCL 设备调用函数。
| 
 | inline | 
| void xgboost::Context::Init | ( | Args const & | kwargs | ) | 
| 
 | inline | 
XGBoost 是否在 CPU 上运行?
| 
 | inline | 
XGBoost 是否在 CUDA 设备上运行?
| 
 | inline | 
XGBoost 是否在任何 SYCL 设备上运行?
| 
 | inline | 
XGBoost 是否在 SYCL CPU 上运行?
| 
 | inline | 
XGBoost 是否在默认 SYCL 设备上运行?
| 
 | inline | 
XGBoost 是否在 SYCL GPU 上运行?
| 
 | inline | 
根据当前上下文创建 CPU 上下文。
| 
 | inline | 
根据当前上下文创建 CUDA 上下文。
| ordinal | CUDA 设备序号。 | 
| 
 | inline | 
获取 CUDA 设备序号。如果 XGBoost 在 CPU 上运行,则为 -1。
| std::int32_t xgboost::Context::Threads | ( | ) | const | 
根据 `nthread` 参数和系统设置,返回自动选择的线程数。
| 
 | inline | 
| bool xgboost::Context::fail_on_invalid_gpu_id {false} | 
| 
 | staticconstexpr | 
| std::int32_t xgboost::Context::nthread {0} | 
| std::int64_t xgboost::Context::seed {kDefaultSeed} | 
| bool xgboost::Context::seed_per_iteration {false} | 
| bool xgboost::Context::validate_parameters {false} |