diff options
| author | AndreyChurbanov <andrey.churbanov@intel.com> | 2019-10-25 15:59:07 +0300 |
|---|---|---|
| committer | AndreyChurbanov <andrey.churbanov@intel.com> | 2019-10-25 16:04:46 +0300 |
| commit | be29d9285487e1970f0ad070d79d5dfeca345f2e (patch) | |
| tree | ea0d4960123571c1f5a264e4b64c15a37d5e19e7 /openmp/runtime/src | |
| parent | 1baa50396d9b8766a2e3d775f2ea14c42e2fc05c (diff) | |
| download | bcm5719-llvm-be29d9285487e1970f0ad070d79d5dfeca345f2e.tar.gz bcm5719-llvm-be29d9285487e1970f0ad070d79d5dfeca345f2e.zip | |
OpenMP Tasks dependencies hash re-sizing fixed.
Details:
- nconflicts field initialized;
- formatting fix (moved declaration out of the long line);
- count conflicts in new hash as opposed to old one.
Differential Revision: https://reviews.llvm.org/D68036
Diffstat (limited to 'openmp/runtime/src')
| -rw-r--r-- | openmp/runtime/src/kmp_taskdeps.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp index f8aa51dd904..8d60bbbc816 100644 --- a/openmp/runtime/src/kmp_taskdeps.cpp +++ b/openmp/runtime/src/kmp_taskdeps.cpp @@ -85,19 +85,19 @@ static kmp_dephash_t *__kmp_dephash_extend(kmp_info_t *thread, h->nelements = current_dephash->nelements; h->buckets = (kmp_dephash_entry **)(h + 1); h->generation = gen; - + h->nconflicts = 0; // insert existing elements in the new table for (size_t i = 0; i < current_dephash->size; i++) { - kmp_dephash_entry_t *next; - for (kmp_dephash_entry_t *entry = current_dephash->buckets[i]; entry; entry = next) { + kmp_dephash_entry_t *next, *entry; + for (entry = current_dephash->buckets[i]; entry; entry = next) { next = entry->next_in_bucket; // Compute the new hash using the new size, and insert the entry in // the new bucket. kmp_int32 new_bucket = __kmp_dephash_hash(entry->addr, h->size); + entry->next_in_bucket = h->buckets[new_bucket]; if (entry->next_in_bucket) { h->nconflicts++; } - entry->next_in_bucket = h->buckets[new_bucket]; h->buckets[new_bucket] = entry; } } |

