Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hog
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hyteg
hog
Commits
8e7fc84c
Commit
8e7fc84c
authored
4 months ago
by
Daniel Bauer
Browse files
Options
Downloads
Patches
Plain Diff
comment out old implementation of FUSEDROWS
parent
c38db50d
No related branches found
No related tags found
1 merge request
!39
Pystencils 2.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hog/operator_generation/loop_strategies.py
+49
-39
49 additions, 39 deletions
hog/operator_generation/loop_strategies.py
with
49 additions
and
39 deletions
hog/operator_generation/loop_strategies.py
+
49
−
39
View file @
8e7fc84c
...
@@ -226,47 +226,57 @@ class FUSEDROWS(LoopStrategy):
...
@@ -226,47 +226,57 @@ class FUSEDROWS(LoopStrategy):
)
)
super
(
FUSEDROWS
,
self
).
__init__
()
super
(
FUSEDROWS
,
self
).
__init__
()
def
create_loop
(
self
,
dim
,
element_index
,
micro_edges_per_macro_edge
):
def
create_loop
(
self
,
ctx
:
KernelCreationContext
,
dim
:
int
,
micro_edges_per_macro_edge
:
int
,
loop_bodies
:
Dict
[
Union
[
FaceType
,
CellType
],
PsBlock
],
pre_loop_stmts
:
Dict
[
Union
[
FaceType
,
CellType
],
PsBlock
]
=
{},
)
->
PsBlock
:
"""
create a single loop with and x-dim loop for each micro element type in the innermost dimension.
"""
"""
create a single loop with and x-dim loop for each micro element type in the innermost dimension.
"""
element_loops
=
create_micro_element_loops
(
dim
,
micro_edges_per_macro_edge
)
raise
NotImplementedError
(
(
fused_loop
,
bodies
)
=
fuse_loops_over_simplex
(
"
FUSEDROWS loop strategy has not been adapted to the new backend and is to be reimplemented in a more flexible manner (think arbitrary loop blocking).
"
[
elem_loop
for
elem_loop
in
element_loops
.
values
()],
1
,
dim
)
)
assert
len
(
bodies
)
==
2
*
3
**
(
dim
-
2
)
# element_loops = create_micro_element_loops(dim, micro_edges_per_macro_edge)
if
dim
==
2
:
# (fused_loop, bodies) = fuse_loops_over_simplex(
element_type
:
Union
[
Type
[
FaceType
],
Type
[
CellType
]]
=
FaceType
# [elem_loop for elem_loop in element_loops.values()], 1, dim
else
:
# )
element_type
=
CellType
# assert len(bodies) == 2 * 3 ** (dim - 2)
self
.
bodies
=
{
# if dim == 2:
eType
:
body
# element_type: Union[Type[FaceType], Type[CellType]] = FaceType
for
eType
,
body
in
zip
([
eType
for
eType
in
element_type
],
bodies
)
# else:
}
# element_type = CellType
# self.bodies = {
return
fused_loop
# eType: body
# for eType, body in zip([eType for eType in element_type], bodies)
def
add_body_to_loop
(
self
,
loop
,
body
,
element_type
):
# }
body
=
Block
(
body
)
self
.
bodies
[
element_type
].
parent
.
body
=
body
# return fused_loop
body
.
parent
=
self
.
bodies
[
element_type
].
parent
self
.
bodies
[
element_type
]
=
body
# def add_body_to_loop(self, loop, body, element_type):
# body = Block(body)
def
add_preloop_for_loop
(
self
,
loops
,
preloop_stmts
,
element_type
):
# self.bodies[element_type].parent.body = body
if
not
isinstance
(
loops
,
list
):
# body.parent = self.bodies[element_type].parent
loops
=
[
loops
]
# self.bodies[element_type] = body
preloop_stmts_lhs_subs
=
{
stmt
.
lhs
:
get_element_replacement
(
stmt
.
lhs
,
element_type
)
# def add_preloop_for_loop(self, loops, preloop_stmts, element_type):
for
stmt
in
preloop_stmts
# if not isinstance(loops, list):
}
# loops = [loops]
# preloop_stmts_lhs_subs = {
body
=
self
.
bodies
[
element_type
]
# stmt.lhs: get_element_replacement(stmt.lhs, element_type)
assert
isinstance
(
body
,
Block
),
f
"
Encountered body that is not a Block:
{
body
}
"
# for stmt in preloop_stmts
body
.
fast_subs
(
preloop_stmts_lhs_subs
)
# }
new_preloop_stmts
=
[
# body = self.bodies[element_type]
stmt
.
fast_subs
(
preloop_stmts_lhs_subs
)
for
stmt
in
preloop_stmts
# assert isinstance(body, Block), f"Encountered body that is not a Block: {body}"
]
# body.fast_subs(preloop_stmts_lhs_subs)
return
new_preloop_stmts
+
loops
# new_preloop_stmts = [
# stmt.fast_subs(preloop_stmts_lhs_subs) for stmt in preloop_stmts
# ]
# return new_preloop_stmts + loops
def
__str__
(
self
):
def
__str__
(
self
):
return
"
FUSEDROWS
"
return
"
FUSEDROWS
"
...
...
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