Commit e9cfece1 authored by Guolin Ke's avatar Guolin Ke
Browse files

fix #508

parent 5b0ae608
...@@ -374,13 +374,17 @@ public: ...@@ -374,13 +374,17 @@ public:
} }
uint64_t num_total_bin = train_data->NumTotalBin(); uint64_t num_total_bin = train_data->NumTotalBin();
Log::Info("Total Bins %d", num_total_bin); Log::Info("Total Bins %d", num_total_bin);
int old_cache_size = cache_size_; int old_cache_size = static_cast<int>(pool_.size());
Reset(cache_size, total_size); Reset(cache_size, total_size);
pool_.resize(cache_size);
data_.resize(cache_size); if (cache_size > old_cache_size) {
pool_.resize(cache_size);
data_.resize(cache_size);
}
OMP_INIT_EX(); OMP_INIT_EX();
#pragma omp parallel for schedule(static) #pragma omp parallel for schedule(static)
for (int i = old_cache_size; i < cache_size_; ++i) { for (int i = old_cache_size; i < cache_size; ++i) {
OMP_LOOP_EX_BEGIN(); OMP_LOOP_EX_BEGIN();
pool_[i].reset(new FeatureHistogram[train_data->num_features()]); pool_[i].reset(new FeatureHistogram[train_data->num_features()]);
data_[i].resize(num_total_bin); data_[i].resize(num_total_bin);
......
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