| 202 | |
| 203 | template <bool has_categorical, bool any_missing, int num_deep_levels = 1, typename TreeView> |
| 204 | void ProcessArrayTree(TreeView const& tree, common::Span<RegTree::FVec> fvec_tloc, |
| 205 | std::size_t const block_size, bst_node_t* p_nidx, bst_node_t tree_depth) { |
| 206 | constexpr int kMaxNumDeepLevels = |
| 207 | ArrayTreeLayout<has_categorical, any_missing, 0, TreeView>::kMaxNumDeepLevels; |
| 208 | |
| 209 | // Fill the array tree, then output predicted node idx. |
| 210 | if constexpr (num_deep_levels == kMaxNumDeepLevels) { |
| 211 | ArrayTreeLayout<has_categorical, any_missing, num_deep_levels, TreeView> buffer{ |
| 212 | tree, tree.GetCategoriesMatrix()}; |
| 213 | buffer.Process(fvec_tloc, block_size, p_nidx); |
| 214 | } else { |
| 215 | if (tree_depth <= num_deep_levels) { |
| 216 | ArrayTreeLayout<has_categorical, any_missing, num_deep_levels, TreeView> buffer{ |
| 217 | tree, tree.GetCategoriesMatrix()}; |
| 218 | buffer.Process(fvec_tloc, block_size, p_nidx); |
| 219 | } else { |
| 220 | ProcessArrayTree<has_categorical, any_missing, num_deep_levels + 1>( |
| 221 | tree, fvec_tloc, block_size, p_nidx, tree_depth); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | } // namespace xgboost::predictor |
| 226 | #endif // XGBOOST_PREDICTOR_ARRAY_TREE_LAYOUT_H_ |
nothing calls this directly
no test coverage detected