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
396da6d1
Commit
396da6d1
authored
12 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Switch padding machinery over to ExpandingIdentityMapper.
parent
65f6d419
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MEMO
+9
-9
9 additions, 9 deletions
MEMO
loopy/padding.py
+12
-12
12 additions, 12 deletions
loopy/padding.py
with
21 additions
and
21 deletions
MEMO
+
9
−
9
View file @
396da6d1
...
...
@@ -50,15 +50,6 @@ To-do
- when are link_inames, duplicate_inames safe?
- ExpandingIdentityMapper
extract_subst -> needs WalkMapper
padding
replace make_unique_var_name [DONE]
join_inames [DONE]
duplicate_inames [DONE]
split_iname [DONE]
CSE [DONE]
- Data implementation tags
TODO initial bringup:
- implemented_arg_info
...
...
@@ -143,6 +134,15 @@ Future ideas
Dealt with
^^^^^^^^^^
- ExpandingIdentityMapper
extract_subst -> needs WalkMapper [actually fine as is]
padding [DONE]
replace make_unique_var_name [DONE]
join_inames [DONE]
duplicate_inames [DONE]
split_iname [DONE]
CSE [DONE]
- rename iname
- delete unused inames
...
...
This diff is collapsed.
Click to expand it.
loopy/padding.py
+
12
−
12
View file @
396da6d1
...
...
@@ -25,21 +25,22 @@ THE SOFTWARE.
from
loopy.symbolic
import
IdentityMapper
from
loopy.symbolic
import
Expanding
IdentityMapper
class
ArgAxisSplitHelper
(
IdentityMapper
):
def
__init__
(
self
,
arg_names
,
handler
):
class
ArgAxisSplitHelper
(
ExpandingIdentityMapper
):
def
__init__
(
self
,
rules
,
var_name_gen
,
arg_names
,
handler
):
ExpandingIdentityMapper
.
__init__
(
self
,
rules
,
var_name_gen
)
self
.
arg_names
=
arg_names
self
.
handler
=
handler
def
map_subscript
(
self
,
expr
):
def
map_subscript
(
self
,
expr
,
expn_state
):
if
expr
.
aggregate
.
name
in
self
.
arg_names
:
return
self
.
handler
(
expr
)
else
:
return
IdentityMapper
.
map_subscript
(
self
,
expr
)
return
Expanding
IdentityMapper
.
map_subscript
(
self
,
expr
,
expn_state
)
...
...
@@ -176,19 +177,18 @@ def split_arg_axis(kernel, args_and_axes, count):
return
expr
.
aggregate
[
tuple
(
idx
)]
aash
=
ArgAxisSplitHelper
(
set
(
arg_to_rest
.
iterkeys
()),
split_access_axis
)
aash
=
ArgAxisSplitHelper
(
kernel
.
substitutions
,
var_name_gen
,
set
(
arg_to_rest
.
iterkeys
()),
split_access_axis
)
kernel
=
aash
.
map_kernel
(
kernel
)
result
=
(
kernel
.
map_expressions
(
aash
)
.
copy
(
args
=
new_args
))
kernel
=
kernel
.
copy
(
args
=
new_args
)
from
loopy
import
split_iname
for
iname
,
(
outer_iname
,
inner_iname
)
in
split_vars
.
iteritems
():
result
=
split_iname
(
result
,
iname
,
count
,
kernel
=
split_iname
(
kernel
,
iname
,
count
,
outer_iname
=
outer_iname
,
inner_iname
=
inner_iname
)
return
result
return
kernel
...
...
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