Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
a82b2b6b
Commit
a82b2b6b
authored
9 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Represent the residual/the jacobian as a virtual loopy global arg
parent
a193946f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/dune/perftool/generation/loopy.py
+4
-3
4 additions, 3 deletions
python/dune/perftool/generation/loopy.py
python/dune/perftool/loopy/transformer.py
+13
-2
13 additions, 2 deletions
python/dune/perftool/loopy/transformer.py
with
17 additions
and
5 deletions
python/dune/perftool/generation/loopy.py
+
4
−
3
View file @
a82b2b6b
...
...
@@ -13,11 +13,12 @@ pymbolic_expr = generator_factory(item_tags=("loopy", "kernel", "pymbolic"))
constantarg
=
generator_factory
(
item_tags
=
(
"
loopy
"
,
"
kernel
"
,
"
argument
"
,
"
constantarg
"
),
on_store
=
lambda
n
:
loopy
.
ConstantArg
(
n
))
@generator_factory
(
item_tags
=
(
"
loopy
"
,
"
kernel
"
,
"
argument
"
,
"
globalarg
"
))
def
globalarg
(
name
,
shape
=
loopy
.
auto
):
@generator_factory
(
item_tags
=
(
"
loopy
"
,
"
kernel
"
,
"
argument
"
,
"
globalarg
"
),
cache_key_generator
=
lambda
n
,
**
kw
:
n
)
def
globalarg
(
name
,
shape
=
loopy
.
auto
,
**
kw
):
if
isinstance
(
shape
,
str
):
shape
=
(
shape
,)
return
loopy
.
GlobalArg
(
name
,
numpy
.
float64
,
shape
)
return
loopy
.
GlobalArg
(
name
,
dtype
=
numpy
.
float64
,
shape
=
shape
,
**
kw
)
@generator_factory
(
item_tags
=
(
"
loopy
"
,
"
kernel
"
,
"
domain
"
))
...
...
This diff is collapsed.
Click to expand it.
python/dune/perftool/loopy/transformer.py
+
13
−
2
View file @
a82b2b6b
...
...
@@ -13,6 +13,7 @@ from dune.perftool.generation import (domain,
globalarg
,
iname
,
instruction
,
symbol
,
temporary_variable
,
valuearg
,
)
...
...
@@ -22,12 +23,17 @@ from ufl.algorithms import MultiFunction
import
loopy
@symbol
def
argument_bound
(
number
):
return
"
arg{}_n
"
.
format
(
number
)
@iname
def
argument_iname
(
arg
):
# TODO extract the {iname}_n thing by a preamble
from
dune.perftool.ufl.modified_terminals
import
modified_argument_number
ainame
=
"
arg{}
"
.
format
(
chr
(
ord
(
"
i
"
)
+
arg
.
argexpr
.
number
()))
domain
(
ainame
,
a
iname
+
"
_n
"
)
domain
(
ainame
,
a
rgument_bound
(
arg
.
argexpr
.
number
())
)
return
ainame
...
...
@@ -134,6 +140,10 @@ def transform_accumulation_term(term):
from
dune.perftool.pdelab.argument
import
name_residual
residual
=
name_residual
()
# The residual/the jacobian should be represented through a loopy global argument
from
dune.perftool.ufl.rank
import
ufl_rank
globalarg
(
residual
,
shape
=
tuple
(
argument_bound
(
i
)
for
i
in
range
(
ufl_rank
(
term
))))
from
dune.perftool.generation
import
retrieve_cache_items
inames
=
retrieve_cache_items
(
"
iname
"
)
...
...
@@ -143,5 +153,6 @@ def transform_accumulation_term(term):
"
,
"
.
join
(
accumargs
),
expr_tv_name
,
name_factor
()
)
),
assignees
=
residual
,
)
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