Unverified Commit 58b49dd8 authored by shiyu1994's avatar shiyu1994 Committed by GitHub
Browse files

set num_threads of share_state (fix #3151) (#3238)


Co-authored-by: default avatarUbuntu <shiyu@gbdt-shiyu.ren3kv4wanvufliwrpy4k03lsf.xx.internal.cloudapp.net>
parent 1c35c3b9
...@@ -294,11 +294,11 @@ struct TrainingShareStates { ...@@ -294,11 +294,11 @@ struct TrainingShareStates {
hist_buf; hist_buf;
void SetMultiValBin(MultiValBin* bin) { void SetMultiValBin(MultiValBin* bin) {
num_threads = OMP_NUM_THREADS();
if (bin == nullptr) { if (bin == nullptr) {
return; return;
} }
multi_val_bin.reset(bin); multi_val_bin.reset(bin);
num_threads = OMP_NUM_THREADS();
num_bin_aligned = num_bin_aligned =
(bin->num_bin() + kAlignedSize - 1) / kAlignedSize * kAlignedSize; (bin->num_bin() + kAlignedSize - 1) / kAlignedSize * kAlignedSize;
size_t new_size = static_cast<size_t>(num_bin_aligned) * 2 * num_threads; size_t new_size = static_cast<size_t>(num_bin_aligned) * 2 * num_threads;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment