Improve OpenMP exception handling (#6680)
This commit is contained in:
@@ -257,8 +257,7 @@ struct GHistIndexMatrix {
|
||||
const size_t batch_size = batch.Size();
|
||||
CHECK_LT(batch_size, offset_vec.size());
|
||||
BinIdxType* index_data = index_data_span.data();
|
||||
#pragma omp parallel for num_threads(batch_threads) schedule(static)
|
||||
for (omp_ulong i = 0; i < batch_size; ++i) {
|
||||
ParallelFor(omp_ulong(batch_size), batch_threads, [&](omp_ulong i) {
|
||||
const int tid = omp_get_thread_num();
|
||||
size_t ibegin = row_ptr[rbegin + i];
|
||||
size_t iend = row_ptr[rbegin + i + 1];
|
||||
@@ -270,7 +269,7 @@ struct GHistIndexMatrix {
|
||||
index_data[ibegin + j] = get_offset(idx, j);
|
||||
++hit_count_tloc_[tid * nbins + idx];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ResizeIndex(const size_t n_index,
|
||||
|
||||
Reference in New Issue
Block a user