[Openmp-commits] [openmp] be29d92 - OpenMP Tasks dependencies hash re-sizing fixed.
via Openmp-commits
openmp-commits at lists.llvm.org
Fri Oct 25 06:05:27 PDT 2019
Author: AndreyChurbanov
Date: 2019-10-25T16:04:46+03:00
New Revision: be29d9285487e1970f0ad070d79d5dfeca345f2e
URL: https://github.com/llvm/llvm-project/commit/be29d9285487e1970f0ad070d79d5dfeca345f2e
DIFF: https://github.com/llvm/llvm-project/commit/be29d9285487e1970f0ad070d79d5dfeca345f2e.diff
LOG: 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
Added:
Modified:
openmp/runtime/src/kmp_taskdeps.cpp
Removed:
################################################################################
diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp
index f8aa51dd904a..8d60bbbc816b 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;
}
}
More information about the Openmp-commits
mailing list