Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Sepanski
loopy
Commits
967414c7
Commit
967414c7
authored
7 years ago
by
Matt Wala
Browse files
Options
Downloads
Patches
Plain Diff
find_most_recent_global_barrier(): Simplify by using
recursive_insn_dep_map().
parent
1a838063
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/kernel/__init__.py
+6
-12
6 additions, 12 deletions
loopy/kernel/__init__.py
with
6 additions
and
12 deletions
loopy/kernel/__init__.py
+
6
−
12
View file @
967414c7
...
...
@@ -901,20 +901,14 @@ class LoopKernel(ImmutableRecordWithoutPickling):
global_barrier_to_ordinal
=
dict
(
(
b
,
i
)
for
i
,
b
in
enumerate
(
self
.
global_barrier_order
))
def
get_barrier_ordinal
(
barrier_id
):
return
(
global_barrier_to_ordinal
[
barrier_id
]
if
barrier_id
is
not
None
else
-
1
)
barriers
=
set
(
dep
for
dep
in
self
.
recursive_insn_dep_map
()[
insn_id
]
if
is_barrier
(
dep
))
direct_barrier_dependencies
=
set
(
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
)
if
len
(
barriers
)
>
0
:
return
max
(
barriers
,
key
=
lambda
b
:
global_barrier_to_ordinal
[
b
])
else
:
return
max
((
self
.
find_most_recent_global_barrier
(
dep
)
for
dep
in
insn
.
depends_on
),
key
=
get_barrier_ordinal
)
return
None
@property
@memoize_method
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment