xgboost
Classes | Namespaces | Macros | Typedefs | Variables
base.h File Reference

Defines configuration macros and basic types for xgboost. More...

#include <dmlc/base.h>
#include <dmlc/omp.h>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for base.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  xgboost::detail::GradientPairInternal< T >
 Implementation of gradient statistics pair. Template specialisation may be used to overload different gradients types e.g. low precision, high precision, integer, floating point. More...
 
class  xgboost::GradientPairInt64
 Fixed point representation for high precision gradient pair. Has a different interface so we don't accidentally use it in gain calculations. More...
 

Namespaces

 xgboost
 namespace of xgboost
 
 xgboost::detail
 

Macros

#define XGBOOST_STRICT_R_MODE   0
 string flag for R library, to leave hooks when needed. More...
 
#define XGBOOST_LOG_WITH_TIME   1
 Whether always log console message with time. It will display like, with timestamp appended to head of the message. "[21:47:50] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train". More...
 
#define XGBOOST_CUSTOMIZE_GLOBAL_PRNG   XGBOOST_STRICT_R_MODE
 Whether to customize global PRNG. More...
 
#define XGBOOST_ALIGNAS(X)
 Check if alignas(*) keyword is supported. (g++ 4.8 or higher) More...
 
#define XGBOOST_EXPECT(cond, ret)   (cond)
 
#define XGBOOST_DEVICE
 Tag function as usable by device. More...
 
#define XGBOOST_HOST_DEV_INLINE
 
#define XGBOOST_DEV_INLINE
 

Typedefs

using xgboost::bst_uint = uint32_t
 unsigned integer type used for feature index. More...
 
using xgboost::bst_ulong = uint64_t
 unsigned long integers More...
 
using xgboost::bst_float = float
 float type, used for storing statistics More...
 
using xgboost::bst_cat_t = int32_t
 Categorical value type. More...
 
using xgboost::bst_feature_t = uint32_t
 Type for data column (feature) index. More...
 
using xgboost::bst_bin_t = int32_t
 Type for histogram bin index. More...
 
using xgboost::bst_row_t = std::size_t
 Type for data row index. More...
 
using xgboost::bst_node_t = std::int32_t
 Type for tree node index. More...
 
using xgboost::bst_group_t = std::uint32_t
 Type for ranking group index. More...
 
using xgboost::bst_target_t = std::uint32_t
 Type for indexing into output targets. More...
 
using xgboost::bst_layer_t = std::int32_t
 Type for indexing boosted layers. More...
 
using xgboost::bst_tree_t = std::int32_t
 Type for indexing trees. More...
 
using xgboost::bst_d_ordinal_t = std::int16_t
 Ordinal of a CUDA device. More...
 
using xgboost::GradientPair = detail::GradientPairInternal< float >
 gradient statistics pair usually needed in gradient boosting More...
 
using xgboost::GradientPairPrecise = detail::GradientPairInternal< double >
 High precision gradient statistics pair. More...
 
using xgboost::Args = std::vector< std::pair< std::string, std::string > >
 
using xgboost::omp_ulong = dmlc::omp_ulong
 define unsigned long for openmp loop More...
 
using xgboost::bst_omp_uint = dmlc::omp_uint
 define unsigned int for openmp loop More...
 
using xgboost::XGBoostVersionT = int32_t
 Type used for representing version number in binary form. More...
 

Variables

constexpr bst_float xgboost::kRtEps = 1e-6f
 small eps gap for minimum split decision. More...
 

Detailed Description

Defines configuration macros and basic types for xgboost.

Copyright 2015-2023 by XGBoost Contributors

Macro Definition Documentation

◆ XGBOOST_ALIGNAS

#define XGBOOST_ALIGNAS (   X)

Check if alignas(*) keyword is supported. (g++ 4.8 or higher)

◆ XGBOOST_CUSTOMIZE_GLOBAL_PRNG

#define XGBOOST_CUSTOMIZE_GLOBAL_PRNG   XGBOOST_STRICT_R_MODE

Whether to customize global PRNG.

◆ XGBOOST_DEV_INLINE

#define XGBOOST_DEV_INLINE

◆ XGBOOST_DEVICE

#define XGBOOST_DEVICE

Tag function as usable by device.

◆ XGBOOST_EXPECT

#define XGBOOST_EXPECT (   cond,
  ret 
)    (cond)

◆ XGBOOST_HOST_DEV_INLINE

#define XGBOOST_HOST_DEV_INLINE

◆ XGBOOST_LOG_WITH_TIME

#define XGBOOST_LOG_WITH_TIME   1

Whether always log console message with time. It will display like, with timestamp appended to head of the message. "[21:47:50] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train".

◆ XGBOOST_STRICT_R_MODE

#define XGBOOST_STRICT_R_MODE   0

string flag for R library, to leave hooks when needed.