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
6ddf6bdc
Commit
6ddf6bdc
authored
6 years ago
by
Marcel Koch
Browse files
Options
Downloads
Patches
Plain Diff
adds vectorized iname array
parent
07f1d971
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/blockstructured/vectorization.py
+17
-11
17 additions, 11 deletions
python/dune/perftool/blockstructured/vectorization.py
with
17 additions
and
11 deletions
python/dune/perftool/blockstructured/vectorization.py
+
17
−
11
View file @
6ddf6bdc
...
...
@@ -310,27 +310,31 @@ def find_accumulation_inames(knl):
return
inames
def
prepare_macro_points
(
knl
,
vec_iname
):
def
add_iname_array
(
knl
,
vec_iname
):
insns_with_macro_points
=
lp
.
find_instructions
(
knl
,
Tagged
(
vec_iname
))
if
insns_with_macro_points
:
from
pudb
import
set_trace
;
set_trace
()
tmp
=
vec_iname
+
'
_
arr
'
array_name
=
vec_iname
+
'
_arr
'
vector_name
=
vec_iname
+
'
_
vec
'
new_temporaries
=
dict
()
new_temporaries
[
tmp
]
=
DuneTemporaryVariable
(
tmp
,
managed
=
True
,
shape
=
(
get_form_option
(
'
number_of_blocks
'
),),
scope
=
lp
.
temp_var_scope
.
PRIVATE
,
dtype
=
np
.
float64
,
base_storage
=
vec_iname
+
'
_buff
'
,
_base_storage_access_may_be_aliasing
=
True
)
new_temporaries
[
array_name
]
=
DuneTemporaryVariable
(
array_name
,
managed
=
True
,
shape
=
(
get_form_option
(
'
number_of_blocks
'
),),
scope
=
lp
.
temp_var_scope
.
PRIVATE
,
dtype
=
np
.
float64
,
base_storage
=
vec_iname
+
'
_buff
'
,
_base_storage_access_may_be_aliasing
=
True
)
new_temporaries
[
vector_name
]
=
DuneTemporaryVariable
(
vector_name
,
managed
=
True
,
shape
=
(
get_form_option
(
'
number_of_blocks
'
),),
scope
=
lp
.
temp_var_scope
.
PRIVATE
,
dtype
=
np
.
float64
,
base_storage
=
vec_iname
+
'
_buff
'
,
_base_storage_access_may_be_aliasing
=
True
)
new_insns
=
[]
new_insns
.
append
(
lp
.
Assignment
(
assignee
=
prim
.
Subscript
(
prim
.
Variable
(
tmp
),
(
prim
.
Variable
(
vec_iname
),)),
new_insns
.
append
(
lp
.
Assignment
(
assignee
=
prim
.
Subscript
(
prim
.
Variable
(
array_name
),
(
prim
.
Variable
(
vec_iname
),)),
expression
=
prim
.
Variable
(
vec_iname
),
id
=
'
init_{}_buffer
'
.
format
(
vec_iname
),
within_inames
=
frozenset
({
vec_iname
}),
within_inames_is_final
=
True
))
replacemap
=
dict
()
replacemap
[
vec_iname
]
=
prim
.
Subscript
(
prim
.
Variable
(
tmp
),
(
prim
.
Variable
(
vec_iname
),))
replacemap
[
vec_iname
]
=
prim
.
Subscript
(
prim
.
Variable
(
vector_name
),
(
prim
.
Variable
(
vec_iname
),))
for
insn
in
knl
.
instructions
:
if
insn
in
insns_with_macro_points
:
...
...
@@ -354,11 +358,13 @@ def vectorize_micro_elements(knl):
assert
get_form_option
(
'
number_of_blocks
'
)
%
vcl_size
==
0
knl
=
prepare_macro_points
(
knl
,
vec_iname
)
knl
=
add_iname_array
(
knl
,
vec_iname
)
knl
=
lp
.
split_iname
(
knl
,
vec_iname
,
vcl_size
,
inner_tag
=
'
vec
'
)
array_alias
=
[
a
for
a
in
knl
.
arg_dict
.
keys
()
if
a
.
endswith
(
'
alias
'
)
or
a
.
endswith
(
'
tail
'
)]
knl
=
lp
.
split_array_axis
(
knl
,
array_alias
,
0
,
vcl_size
)
iname_vector
=
[
a
for
a
in
knl
.
temporary_variables
.
keys
()
if
a
.
endswith
(
'
vec
'
)]
knl
=
lp
.
split_array_axis
(
knl
,
array_alias
+
iname_vector
,
0
,
vcl_size
)
knl
=
lp
.
tag_array_axes
(
knl
,
iname_vector
,
(
'
c
'
,
'
vec
'
))
knl
=
add_vcl_temporaries
(
knl
)
knl
=
add_vcl_accum_insns
(
knl
,
vec_iname
+
'
_inner
'
,
vec_iname
+
'
_outer
'
)
...
...
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