xgboost
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
xgboost::common::ParallelGHistBuilder Class Reference

Stores temporary histograms to compute them in parallel Supports processing multiple tree-nodes for nested parallelism Able to reduce histograms across threads in efficient way. More...

#include <hist_util.h>

Collaboration diagram for xgboost::common::ParallelGHistBuilder:
Collaboration graph

Public Member Functions

void Init (size_t nbins)
 
void Reset (size_t nthreads, size_t nodes, const BlockedSpace2d &space, const std::vector< GHistRow > &targeted_hists)
 
GHistRow GetInitializedHist (size_t tid, size_t nid)
 
void ReduceHist (size_t nid, size_t begin, size_t end)
 

Protected Member Functions

void MatchThreadsToNodes (const BlockedSpace2d &space)
 
void AllocateAdditionalHistograms ()
 
void MatchNodeNidPairToHist ()
 

Protected Attributes

size_t nbins_ = 0
 number of bins in each histogram More...
 
size_t nthreads_ = 0
 number of threads for parallel computation More...
 
size_t nodes_ = 0
 number of nodes which will be processed in parallel More...
 
HistCollection hist_buffer_
 Buffer for additional histograms for Parallel processing. More...
 
std::vector< int > hist_was_used_
 Marks which hists were used, it means that they should be merged. Contains only {true or false} values but 'int' is used instead of 'bool', because std::vector<bool> isn't thread safe. More...
 
std::vector< bool > threads_to_nids_map_
 Buffer for additional histograms for Parallel processing. More...
 
std::vector< GHistRowtargeted_hists_
 Contains histograms for final results. More...
 
std::vector< GHistRowhist_memory_
 Allocated memory for histograms used for construction. More...
 
std::map< std::pair< size_t, size_t >, size_t > tid_nid_to_hist_
 map pair {tid, nid} to index of allocated histogram from hist_memory_ More...
 

Detailed Description

Stores temporary histograms to compute them in parallel Supports processing multiple tree-nodes for nested parallelism Able to reduce histograms across threads in efficient way.

Member Function Documentation

◆ AllocateAdditionalHistograms()

void xgboost::common::ParallelGHistBuilder::AllocateAdditionalHistograms ( )
inlineprotected

◆ GetInitializedHist()

GHistRow xgboost::common::ParallelGHistBuilder::GetInitializedHist ( size_t  tid,
size_t  nid 
)
inline

◆ Init()

void xgboost::common::ParallelGHistBuilder::Init ( size_t  nbins)
inline

◆ MatchNodeNidPairToHist()

void xgboost::common::ParallelGHistBuilder::MatchNodeNidPairToHist ( )
inlineprotected

◆ MatchThreadsToNodes()

void xgboost::common::ParallelGHistBuilder::MatchThreadsToNodes ( const BlockedSpace2d space)
inlineprotected

◆ ReduceHist()

void xgboost::common::ParallelGHistBuilder::ReduceHist ( size_t  nid,
size_t  begin,
size_t  end 
)
inline

◆ Reset()

void xgboost::common::ParallelGHistBuilder::Reset ( size_t  nthreads,
size_t  nodes,
const BlockedSpace2d space,
const std::vector< GHistRow > &  targeted_hists 
)
inline

Member Data Documentation

◆ hist_buffer_

HistCollection xgboost::common::ParallelGHistBuilder::hist_buffer_
protected

Buffer for additional histograms for Parallel processing.

◆ hist_memory_

std::vector<GHistRow> xgboost::common::ParallelGHistBuilder::hist_memory_
protected

Allocated memory for histograms used for construction.

◆ hist_was_used_

std::vector<int> xgboost::common::ParallelGHistBuilder::hist_was_used_
protected

Marks which hists were used, it means that they should be merged. Contains only {true or false} values but 'int' is used instead of 'bool', because std::vector<bool> isn't thread safe.

◆ nbins_

size_t xgboost::common::ParallelGHistBuilder::nbins_ = 0
protected

number of bins in each histogram

◆ nodes_

size_t xgboost::common::ParallelGHistBuilder::nodes_ = 0
protected

number of nodes which will be processed in parallel

◆ nthreads_

size_t xgboost::common::ParallelGHistBuilder::nthreads_ = 0
protected

number of threads for parallel computation

◆ targeted_hists_

std::vector<GHistRow> xgboost::common::ParallelGHistBuilder::targeted_hists_
protected

Contains histograms for final results.

◆ threads_to_nids_map_

std::vector<bool> xgboost::common::ParallelGHistBuilder::threads_to_nids_map_
protected

Buffer for additional histograms for Parallel processing.

◆ tid_nid_to_hist_

std::map<std::pair<size_t, size_t>, size_t> xgboost::common::ParallelGHistBuilder::tid_nid_to_hist_
protected

map pair {tid, nid} to index of allocated histogram from hist_memory_


The documentation for this class was generated from the following file: