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
a0b5f0ac
Commit
a0b5f0ac
authored
13 years ago
by
Tim Warburton
Browse files
Options
Downloads
Patches
Plain Diff
Minor variable rename.
parent
1c7b8b23
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/__init__.py
+16
-16
16 additions, 16 deletions
loopy/__init__.py
with
16 additions
and
16 deletions
loopy/__init__.py
+
16
−
16
View file @
a0b5f0ac
...
...
@@ -254,21 +254,21 @@ def make_kernel(*args, **kwargs):
# {{{ dimension split
def
split_dimension
(
kernel
,
iname
,
inner_length
,
def
split_dimension
(
kernel
,
split_
iname
,
inner_length
,
outer_iname
=
None
,
inner_iname
=
None
,
outer_tag
=
None
,
inner_tag
=
None
,
slabs
=
(
0
,
0
),
do_tagged_check
=
True
):
if
do_tagged_check
and
kernel
.
iname_to_tag
.
get
(
iname
)
is
not
None
:
raise
RuntimeError
(
"
cannot split already tagged iname
'
%s
'"
%
iname
)
if
do_tagged_check
and
kernel
.
iname_to_tag
.
get
(
split_
iname
)
is
not
None
:
raise
RuntimeError
(
"
cannot split already tagged iname
'
%s
'"
%
split_
iname
)
if
iname
not
in
kernel
.
all_inames
():
raise
ValueError
(
"
cannot split loop for unknown variable
'
%s
'"
%
iname
)
if
split_
iname
not
in
kernel
.
all_inames
():
raise
ValueError
(
"
cannot split loop for unknown variable
'
%s
'"
%
split_
iname
)
if
outer_iname
is
None
:
outer_iname
=
iname
+
"
_outer
"
outer_iname
=
split_
iname
+
"
_outer
"
if
inner_iname
is
None
:
inner_iname
=
iname
+
"
_inner
"
inner_iname
=
split_
iname
+
"
_inner
"
outer_var_nr
=
kernel
.
space
.
dim
(
dim_type
.
set
)
inner_var_nr
=
kernel
.
space
.
dim
(
dim_type
.
set
)
+
1
...
...
@@ -285,9 +285,9 @@ def split_dimension(kernel, iname, inner_length,
make_slab
(
space
,
inner_iname
,
0
,
inner_length
)
# name = inner + length*outer
.
add_constraint
(
isl
.
Constraint
.
eq_from_names
(
space
,
{
iname
:
1
,
inner_iname
:
-
1
,
outer_iname
:
-
inner_length
})))
space
,
{
split_
iname
:
1
,
inner_iname
:
-
1
,
outer_iname
:
-
inner_length
})))
name_dim_type
,
name_idx
=
space
.
get_var_dict
()[
iname
]
name_dim_type
,
name_idx
=
space
.
get_var_dict
()[
split_
iname
]
return
(
s
.
intersect
(
inner_constraint_set
)
.
eliminate
(
name_dim_type
,
name_idx
,
1
)
...
...
@@ -304,19 +304,19 @@ def split_dimension(kernel, iname, inner_length,
from
loopy.symbolic
import
ReductionLoopSplitter
rls
=
ReductionLoopSplitter
(
iname
,
outer_iname
,
inner_iname
)
rls
=
ReductionLoopSplitter
(
split_
iname
,
outer_iname
,
inner_iname
)
new_insns
=
[]
for
insn
in
kernel
.
instructions
:
subst_map
=
{
var
(
iname
):
new_loop_index
}
subst_map
=
{
var
(
split_
iname
):
new_loop_index
}
from
loopy.symbolic
import
SubstitutionMapper
subst_mapper
=
SubstitutionMapper
(
subst_map
.
get
)
new_expr
=
subst_mapper
(
rls
(
insn
.
expression
))
if
iname
in
insn
.
forced_iname_deps
:
if
split_
iname
in
insn
.
forced_iname_deps
:
new_forced_iname_deps
=
insn
.
forced_iname_deps
.
copy
()
new_forced_iname_deps
.
remove
(
iname
)
new_forced_iname_deps
.
remove
(
split_
iname
)
new_forced_iname_deps
.
update
([
outer_iname
,
inner_iname
])
else
:
new_forced_iname_deps
=
insn
.
forced_iname_deps
...
...
@@ -324,8 +324,7 @@ def split_dimension(kernel, iname, inner_length,
insn
=
insn
.
copy
(
assignee
=
subst_mapper
(
insn
.
assignee
),
expression
=
new_expr
,
forced_iname_deps
=
new_forced_iname_deps
)
forced_iname_deps
=
new_forced_iname_deps
)
new_insns
.
append
(
insn
)
...
...
@@ -336,7 +335,8 @@ def split_dimension(kernel, iname, inner_length,
result
=
(
kernel
.
copy
(
domain
=
new_domain
,
iname_slab_increments
=
iname_slab_increments
,
instructions
=
new_insns
))
instructions
=
new_insns
,
))
return
tag_dimensions
(
result
,
{
outer_iname
:
outer_tag
,
inner_iname
:
inner_tag
})
...
...
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