Skip to content
Snippets Groups Projects
Commit 98c27e6b authored by Matt Wala's avatar Matt Wala
Browse files

Revert "find_most_recent_global_barrier(): Simplify by using"

This reverts commit 967414c7.
parent 967414c7
No related branches found
No related tags found
No related merge requests found
...@@ -901,14 +901,20 @@ class LoopKernel(ImmutableRecordWithoutPickling): ...@@ -901,14 +901,20 @@ class LoopKernel(ImmutableRecordWithoutPickling):
global_barrier_to_ordinal = dict( global_barrier_to_ordinal = dict(
(b, i) for i, b in enumerate(self.global_barrier_order)) (b, i) for i, b in enumerate(self.global_barrier_order))
barriers = set(dep def get_barrier_ordinal(barrier_id):
for dep in self.recursive_insn_dep_map()[insn_id] return (global_barrier_to_ordinal[barrier_id]
if is_barrier(dep)) if barrier_id is not None
else -1)
if len(barriers) > 0: direct_barrier_dependencies = set(
return max(barriers, key=lambda b: global_barrier_to_ordinal[b]) dep for dep in insn.depends_on if is_barrier(dep))
if len(direct_barrier_dependencies) > 0:
return max(direct_barrier_dependencies, key=get_barrier_ordinal)
else: else:
return None return max((self.find_most_recent_global_barrier(dep)
for dep in insn.depends_on),
key=get_barrier_ordinal)
@property @property
@memoize_method @memoize_method
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment