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
75a51f7c
Commit
75a51f7c
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Plain Diff
Merge branch 'fuse-fortran-loops'
parents
a62559eb
5278957b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
loopy/frontend/fortran/translator.py
+3
-0
3 additions, 0 deletions
loopy/frontend/fortran/translator.py
loopy/loop.py
+77
-0
77 additions, 0 deletions
loopy/loop.py
loopy/subst.py
+0
-1
0 additions, 1 deletion
loopy/subst.py
with
80 additions
and
1 deletion
loopy/frontend/fortran/translator.py
+
3
−
0
View file @
75a51f7c
...
...
@@ -683,6 +683,9 @@ class F2LoopyTranslator(FTreeWalkerBase):
default_order
=
"
F
"
)
from
loopy.loop
import
fuse_loop_domains
knl
=
fuse_loop_domains
(
knl
)
proc_dict
[
sub
.
subprogram_name
]
=
lp
.
fold_constants
(
knl
)
transform_code
=
remove_common_indentation
(
...
...
This diff is collapsed.
Click to expand it.
loopy/loop.py
0 → 100644
+
77
−
0
View file @
75a51f7c
from
__future__
import
division
,
absolute_import
__copyright__
=
"
Copyright (C) 2012 Andreas Kloeckner
"
__license__
=
"""
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the
"
Software
"
), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED
"
AS IS
"
, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
import
six
def
potential_loop_nest_map
(
kernel
):
"""
Returns a dictionary mapping inames to other inames that *could*
be nested around them.
:seealso: :func:`loopy.schedule.loop_nest_map`
"""
result
=
{}
all_inames
=
kernel
.
all_inames
()
iname_to_insns
=
kernel
.
iname_to_insns
()
# examine pairs of all inames--O(n**2), I know.
from
loopy.kernel.data
import
IlpBaseTag
for
inner_iname
in
all_inames
:
inner_result
=
set
()
for
outer_iname
in
all_inames
:
if
inner_iname
==
outer_iname
:
continue
if
iname_to_insns
[
inner_iname
]
<=
iname_to_insns
[
outer_iname
]:
inner_result
.
add
(
outer_iname
)
if
inner_result
:
result
[
inner_iname
]
=
inner_result
return
result
def
fuse_loop_domains
(
kernel
):
did_something
=
False
while
True
:
lnm
=
potential_loop_nest_map
(
kernel
)
for
inner_iname
,
outer_inames
in
six
.
iteritems
(
lnm
):
for
outer_iname
in
outer_inames
:
inner_do
print
kernel
print
lnm
1
/
0
if
not
did_something
:
break
return
kernel
This diff is collapsed.
Click to expand it.
loopy/subst.py
+
0
−
1
View file @
75a51f7c
...
...
@@ -274,7 +274,6 @@ def temporary_to_subst(kernel, temp_name, within=None):
"""
Extract an assignment to a temporary variable
as a :ref:`substituion-rule`. The temporary may
:arg within: a stack match as understood by
:func:`loopy.context_matching.parse_stack_match`.
...
...
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