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
b88c9990
"README.rst" did not exist on "9ef7ffa343ee7b7523a61d3b18b011e5ae323f73"
Commit
b88c9990
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
remove_unused_arguments: Consider uses in data shapes/offsets/strides
parent
971f3759
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/transform/data.py
+20
-0
20 additions, 0 deletions
loopy/transform/data.py
with
20 additions
and
0 deletions
loopy/transform/data.py
+
20
−
0
View file @
b88c9990
...
@@ -353,6 +353,26 @@ def remove_unused_arguments(knl):
...
@@ -353,6 +353,26 @@ def remove_unused_arguments(knl):
for
insn
in
exp_knl
.
instructions
:
for
insn
in
exp_knl
.
instructions
:
refd_vars
.
update
(
insn
.
dependency_names
())
refd_vars
.
update
(
insn
.
dependency_names
())
from
loopy.kernel.array
import
ArrayBase
,
FixedStrideArrayDimTag
from
loopy.symbolic
import
get_dependencies
from
itertools
import
chain
def
tolerant_get_deps
(
expr
):
if
expr
is
None
or
expr
is
lp
.
auto
:
return
set
()
return
get_dependencies
(
expr
)
for
ary
in
chain
(
knl
.
args
,
six
.
itervalues
(
knl
.
temporary_variables
)):
if
isinstance
(
ary
,
ArrayBase
):
refd_vars
.
update
(
tolerant_get_deps
(
ary
.
shape
)
|
tolerant_get_deps
(
ary
.
offset
))
for
dim_tag
in
ary
.
dim_tags
:
if
isinstance
(
dim_tag
,
FixedStrideArrayDimTag
):
refd_vars
.
update
(
tolerant_get_deps
(
dim_tag
.
stride
))
for
arg
in
knl
.
args
:
for
arg
in
knl
.
args
:
if
arg
.
name
in
refd_vars
:
if
arg
.
name
in
refd_vars
:
new_args
.
append
(
arg
)
new_args
.
append
(
arg
)
...
...
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