Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
pystencils
Commits
d2dfecbf
Commit
d2dfecbf
authored
1 year ago
by
Daniel Bauer
Browse files
Options
Downloads
Patches
Plain Diff
fix typos
parent
6904b818
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/cpu/vectorization.py
+4
-4
4 additions, 4 deletions
pystencils/cpu/vectorization.py
pystencils/transformations.py
+1
-1
1 addition, 1 deletion
pystencils/transformations.py
with
5 additions
and
5 deletions
pystencils/cpu/vectorization.py
+
4
−
4
View file @
d2dfecbf
...
@@ -103,8 +103,8 @@ def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best',
...
@@ -103,8 +103,8 @@ def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best',
vectorized_loop_substitutions: a dictionary of symbols and substitutions to be applied only to the vectorized loop,
vectorized_loop_substitutions: a dictionary of symbols and substitutions to be applied only to the vectorized loop,
with the purpose of declaring certain scalar constants entering the kernel from outside
with the purpose of declaring certain scalar constants entering the kernel from outside
as vectorized variables in front of the loop.
as vectorized variables in front of the loop.
moved_nodes: enables cooperation with moved constants: a set of TypedSybol of symbols that were previously moved out
moved_nodes: enables cooperation with moved constants: a set of TypedSy
m
bol of symbols that were previously moved out
of loops. They have to be adapted with a
c
astFunc to the vector datatype.
of loops. They have to be adapted with a
C
astFunc to the vector datatype.
"""
"""
if
instruction_set
==
'
best
'
:
if
instruction_set
==
'
best
'
:
if
get_supported_instruction_sets
():
if
get_supported_instruction_sets
():
...
@@ -302,11 +302,11 @@ def insert_vector_casts(ast_node, instruction_set, default_float_type='double',
...
@@ -302,11 +302,11 @@ def insert_vector_casts(ast_node, instruction_set, default_float_type='double',
new_args
=
[
visit_expr
(
a
,
default_type
)
for
a
in
expr
.
args
]
new_args
=
[
visit_expr
(
a
,
default_type
)
for
a
in
expr
.
args
]
arg_types
=
[
get_type_of_expression
(
a
,
default_float_type
=
default_type
)
for
a
in
new_args
]
arg_types
=
[
get_type_of_expression
(
a
,
default_float_type
=
default_type
)
for
a
in
new_args
]
if
not
any
(
type
(
t
)
is
VectorType
for
t
in
arg_types
):
if
not
any
(
type
(
t
)
is
VectorType
for
t
in
arg_types
):
# no vector type in expr: dont scalar expression to vec
# no vector type in expr: don
't cas
t scalar expression to vec
return
expr
return
expr
else
:
else
:
target_type
=
collate_types
(
arg_types
)
target_type
=
collate_types
(
arg_types
)
# insert cast function to target type (e.g. vectorType) if its missing
# insert cast function to target type (e.g. vectorType) if it
'
s missing
casted_args
=
[
casted_args
=
[
CastFunc
(
a
,
target_type
)
if
t
!=
target_type
and
not
isinstance
(
a
,
VectorMemoryAccess
)
and
not
all
(
isinstance
(
f
,
TypedSymbol
)
for
f
in
a
.
free_symbols
)
else
a
CastFunc
(
a
,
target_type
)
if
t
!=
target_type
and
not
isinstance
(
a
,
VectorMemoryAccess
)
and
not
all
(
isinstance
(
f
,
TypedSymbol
)
for
f
in
a
.
free_symbols
)
else
a
for
a
,
t
in
zip
(
new_args
,
arg_types
)]
for
a
,
t
in
zip
(
new_args
,
arg_types
)]
...
...
This diff is collapsed.
Click to expand it.
pystencils/transformations.py
+
1
−
1
View file @
d2dfecbf
...
@@ -633,7 +633,7 @@ def move_constants_before_loop(ast_node, rename_moved_consts = False):
...
@@ -633,7 +633,7 @@ def move_constants_before_loop(ast_node, rename_moved_consts = False):
block
.
append
(
child
)
block
.
append
(
child
)
continue
continue
if
isinstance
(
child
,
ast
.
SympyAssignment
)
and
isinstance
(
child
.
lhs
,
ResolvedFieldAccess
):
# dont move field accesses
if
isinstance
(
child
,
ast
.
SympyAssignment
)
and
isinstance
(
child
.
lhs
,
ResolvedFieldAccess
):
# don
'
t move field accesses
block
.
append
(
child
)
block
.
append
(
child
)
continue
continue
...
...
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