multi-thread version of group builder
More...
#include <group_data.h>
|
| ParallelGroupBuilder (std::vector< SizeType > *p_rptr, std::vector< ValueType > *p_data, size_t base_row_offset=0) |
| parallel group builder of data. More...
|
|
void | InitBudget (std::size_t max_key, int nthread) |
| step 1: initialize the helper, with hint of number keys and thread used in the construction More...
|
|
void | AddBudget (std::size_t key, int threadid, SizeType nelem=1) |
| step 2: add budget to each key More...
|
|
void | InitStorage () |
| step 3: initialize the necessary storage More...
|
|
void | Push (std::size_t key, ValueType &&value, int threadid) |
| step 4: add data to the allocated space, the calls to this function should be exactly match previous call to AddBudget More...
|
|
template<typename ValueType, typename SizeType = bst_ulong>
class xgboost::common::ParallelGroupBuilder< ValueType, SizeType >
multi-thread version of group builder
- Template Parameters
-
ValueType | type of entries in the sparse matrix |
SizeType | type of the index range holder |
◆ ParallelGroupBuilder()
template<typename ValueType , typename SizeType = bst_ulong>
parallel group builder of data.
- Parameters
-
[in,out] | p_rptr | Row offsets for CSR matrix. |
[in,out] | p_data | Data vector to populate |
| base_row_offset | (Optional) If the matrix we are building is already partially populated, use this to indicate the row index we are starting from. This saves considerable amounts of time/memory when incrementaly building. |
◆ AddBudget()
template<typename ValueType , typename SizeType = bst_ulong>
step 2: add budget to each key
- Parameters
-
key | the key |
threadid | the id of thread that calls this function |
nelem | number of element budget add to this row |
◆ InitBudget()
template<typename ValueType , typename SizeType = bst_ulong>
step 1: initialize the helper, with hint of number keys and thread used in the construction
- Parameters
-
max_key | number of keys in the matrix, can be smaller than expected |
nthread | number of thread that will be used in construction |
◆ InitStorage()
template<typename ValueType , typename SizeType = bst_ulong>
step 3: initialize the necessary storage
◆ Push()
template<typename ValueType , typename SizeType = bst_ulong>
step 4: add data to the allocated space, the calls to this function should be exactly match previous call to AddBudget
- Parameters
-
key | the key of group. |
value | The value to be pushed to the group. |
threadid | the id of thread that calls this function |
The documentation for this class was generated from the following file: