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
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
Andreas Klöckner
loopy
Commits
384071db
Commit
384071db
authored
12 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
No, do *not* use local ids to determine for loop bounds. Things go wrong. Badly.
Thanks,
c0d784d3
.
parent
4bfc2512
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/codegen/bounds.py
+10
-6
10 additions, 6 deletions
loopy/codegen/bounds.py
with
10 additions
and
6 deletions
loopy/codegen/bounds.py
+
10
−
6
View file @
384071db
...
...
@@ -229,9 +229,9 @@ def wrap_in_for_from_constraints(ccm, iname, constraint_bset, stmt,
# {{{ on which variables may a conditional depend?
def
get_
defined_inames
(
kernel
,
sched_index
):
def
get_
usable_inames_for_conditional
(
kernel
,
sched_index
):
from
loopy.schedule
import
EnterLoop
,
LeaveLoop
from
loopy.kernel
import
ParallelTag
from
loopy.kernel
import
ParallelTag
,
LocalIndexTagBase
result
=
set
()
...
...
@@ -246,8 +246,11 @@ def get_defined_inames(kernel, sched_index):
for
iname
in
kernel
.
all_inames
():
tag
=
kernel
.
iname_to_tag
.
get
(
iname
)
# these are always defined
if
isinstance
(
tag
,
ParallelTag
):
# Parallel inames are always defined, BUT local indices may not be used
# in conditionals that cross barriers.
if
(
isinstance
(
tag
,
ParallelTag
)
and
not
isinstance
(
tag
,
LocalIndexTagBase
)):
result
.
add
(
iname
)
return
frozenset
(
result
)
...
...
@@ -257,11 +260,12 @@ def get_defined_inames(kernel, sched_index):
# {{{ get_simple_loop_bounds
def
get_simple_loop_bounds
(
kernel
,
sched_index
,
iname
,
implemented_domain
,
iname_domain
):
from
loopy.codegen.bounds
import
get_bounds_constraints
,
get_defined_inames
from
loopy.codegen.bounds
import
(
get_bounds_constraints
,
get_usable_inames_for_conditional
)
lower_constraints_orig
,
upper_constraints_orig
,
equality_constraints_orig
=
\
get_bounds_constraints
(
iname_domain
,
iname
,
frozenset
([
iname
])
|
get_
defined_inames
(
kernel
,
sched_index
+
1
),
|
get_
usable_inames_for_conditional
(
kernel
,
sched_index
+
1
),
allow_parameters
=
True
)
lower_constraints_orig
.
extend
(
equality_constraints_orig
)
...
...
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