Skip to content

Commit

Permalink
set num_threads of share_state (fix #3151) (#3238)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <shiyu@gbdt-shiyu.ren3kv4wanvufliwrpy4k03lsf.xx.internal.cloudapp.net>
  • Loading branch information
shiyu1994 and Ubuntu authored Jul 19, 2020
1 parent 1c35c3b commit 58b49dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/LightGBM/dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ struct TrainingShareStates {
hist_buf;

void SetMultiValBin(MultiValBin* bin) {
num_threads = OMP_NUM_THREADS();
if (bin == nullptr) {
return;
}
multi_val_bin.reset(bin);
num_threads = OMP_NUM_THREADS();
num_bin_aligned =
(bin->num_bin() + kAlignedSize - 1) / kAlignedSize * kAlignedSize;
size_t new_size = static_cast<size_t>(num_bin_aligned) * 2 * num_threads;
Expand Down

0 comments on commit 58b49dd

Please sign in to comment.