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
94b65d29
Commit
94b65d29
authored
7 years ago
by
Matt Wala
Browse files
Options
Downloads
Patches
Plain Diff
get_usable_inames_for_conditional(): Fix inames finding in the case
that we are outside a subkernel (closes
#65
).
parent
bd12a464
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/codegen/bounds.py
+14
-5
14 additions, 5 deletions
loopy/codegen/bounds.py
with
14 additions
and
5 deletions
loopy/codegen/bounds.py
+
14
−
5
View file @
94b65d29
...
@@ -65,11 +65,20 @@ def get_usable_inames_for_conditional(kernel, sched_index):
...
@@ -65,11 +65,20 @@ def get_usable_inames_for_conditional(kernel, sched_index):
# Find our containing subkernel, grab inames for all insns from there.
# Find our containing subkernel, grab inames for all insns from there.
subkernel_index
=
sched_index
within_subkernel
=
False
from
loopy.schedule
import
CallKernel
for
prev_sched_index
,
sched_item
in
enumerate
(
kernel
.
schedule
):
while
not
isinstance
(
kernel
.
schedule
[
subkernel_index
],
CallKernel
):
if
prev_sched_index
==
sched_index
:
subkernel_index
-=
1
if
not
within_subkernel
:
# Outside all subkernels - use only inames available to device.
return
frozenset
(
result
)
from
loopy.schedule
import
CallKernel
,
ReturnFromKernel
if
isinstance
(
sched_item
,
CallKernel
):
within_subkernel
=
True
subkernel_index
=
prev_sched_index
elif
isinstance
(
sched_item
,
ReturnFromKernel
):
within_subkernel
=
False
insn_ids_for_subkernel
=
get_insn_ids_for_block_at
(
insn_ids_for_subkernel
=
get_insn_ids_for_block_at
(
kernel
.
schedule
,
subkernel_index
)
kernel
.
schedule
,
subkernel_index
)
...
...
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