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
0c68888c
Commit
0c68888c
authored
7 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Fixups
parent
866645c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/perftool/sumfact/vectorization.py
+19
-11
19 additions, 11 deletions
python/dune/perftool/sumfact/vectorization.py
with
19 additions
and
11 deletions
python/dune/perftool/sumfact/vectorization.py
+
19
−
11
View file @
0c68888c
...
...
@@ -50,17 +50,23 @@ def attach_vectorization_info(sf):
return
_cache_vectorization_info
(
sf
,
None
)
@backend
(
interface
=
"
vectorization_
costfunction
"
,
name
=
"
greedy
"
)
@backend
(
interface
=
"
vectorization_
strategy
"
,
name
=
"
greedy
"
)
def
greedy_costfunction
(
sf
):
return
1
@backend
(
interface
=
"
vectorization_
costfunction
"
,
name
=
"
explicit
"
)
@backend
(
interface
=
"
vectorization_
strategy
"
,
name
=
"
explicit
"
)
def
explicit_costfunction
(
sf
):
# Read the explicitly set values for horizontal and vertical vectorization
width
=
get_vcl_type_size
(
np
.
float64
)
horizontal
=
int
(
get_option
(
"
vectorization_horizontal
"
,
width
))
vertical
=
int
(
get_option
(
"
vectorization_vertical
"
,
1
))
horizontal
=
get_option
(
"
vectorization_horizontal
"
)
if
horizontal
is
None
:
horizontal
=
width
vertical
=
get_option
(
"
vectorization_vertical
"
)
if
vertical
is
None
:
vertical
=
1
horizontal
=
int
(
horizontal
)
vertical
=
int
(
vertical
)
if
sf
.
horizontal_width
==
horizontal
and
sf
.
vertical_width
==
vertical
:
return
1
...
...
@@ -71,8 +77,8 @@ def explicit_costfunction(sf):
def
strategy_cost
(
strategy
):
qp
,
strategy
=
strategy
set_quadrature_points
(
qp
)
func
=
get_backend
(
interface
=
"
vectorization_
costfunction
"
,
name
=
get_option
(
"
vectorization_strategy
"
))
func
=
get_backend
(
interface
=
"
vectorization_
strategy
"
,
selector
=
lambda
:
get_option
(
"
vectorization_strategy
"
))
return
sum
(
float
(
func
(
sf
))
for
sf
in
strategy
.
values
())
...
...
@@ -80,8 +86,8 @@ def stringify_vectorization_strategy(strategy):
result
=
[]
qp
,
strategy
=
strategy
result
.
append
[
"
Printing potential vectorization strategy:
"
]
result
.
append
[
"
Quadrature point tuple: {}
"
.
format
(
qp
)
]
result
.
append
(
"
Printing potential vectorization strategy:
"
)
result
.
append
(
"
Quadrature point tuple: {}
"
.
format
(
qp
)
)
# Look for all realizations in the strategy and iterate over them
cache_keys
=
frozenset
(
v
.
cache_key
for
v
in
strategy
.
values
())
...
...
@@ -89,14 +95,16 @@ def stringify_vectorization_strategy(strategy):
# Filter all the kernels that are realized by this and print
for
key
in
strategy
:
if
strategy
[
key
].
cache_key
==
ck
:
result
.
append
[
"
{}:
"
.
format
(
key
)
]
result
.
append
(
"
{}:
"
.
format
(
key
)
)
# Find one representative to print
for
val
in
strategy
.
values
():
if
val
.
cache_key
==
ck
:
result
.
append
[
"
{}
"
.
format
(
val
)
]
result
.
append
(
"
{}
"
.
format
(
val
)
)
break
return
result
def
decide_vectorization_strategy
():
"""
Decide how to vectorize!
...
...
@@ -144,7 +152,7 @@ def decide_vectorization_strategy():
# Register the results
for
sf
in
all_sumfacts
:
_cache_vectorization_info
(
sf
,
sfdict
.
get
(
sf
,
no_vec
(
sf
))
)
_cache_vectorization_info
(
sf
,
sfdict
[
sf
]
)
def
vectorization_opportunity_generator
(
sumfacts
,
width
):
...
...
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