Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Alt
pystencils
Commits
59840a2f
Commit
59840a2f
authored
May 27, 2021
by
Michael Kuron
Browse files
Undo some changes from !248 that are no longer needed
parent
91a79942
Changes
2
Hide whitespace changes
Inline
Side-by-side
pystencils/backends/cbackend.py
View file @
59840a2f
...
...
@@ -192,9 +192,7 @@ class CBackend:
def
__init__
(
self
,
sympy_printer
=
None
,
signature_only
=
False
,
vector_instruction_set
=
None
,
dialect
=
'c'
):
if
sympy_printer
is
None
:
if
vector_instruction_set
is
not
None
:
self
.
vector_sympy_printer
=
VectorizedCustomSympyPrinter
(
vector_instruction_set
)
self
.
scalar_sympy_printer
=
CustomSympyPrinter
()
self
.
sympy_printer
=
self
.
vector_sympy_printer
self
.
sympy_printer
=
VectorizedCustomSympyPrinter
(
vector_instruction_set
)
else
:
self
.
sympy_printer
=
CustomSympyPrinter
()
else
:
...
...
@@ -261,12 +259,6 @@ class CBackend:
prefix
=
"
\n
"
.
join
(
node
.
prefix_lines
)
if
prefix
:
prefix
+=
"
\n
"
if
self
.
_vector_instruction_set
and
hasattr
(
node
,
'instruction_set'
)
and
node
.
instruction_set
is
None
:
# the tail loop must not be vectorized
self
.
sympy_printer
=
self
.
scalar_sympy_printer
code
=
f
"
{
prefix
}{
loop_str
}
\n
{
self
.
_print
(
node
.
body
)
}
"
self
.
sympy_printer
=
self
.
vector_sympy_printer
return
code
return
f
"
{
prefix
}{
loop_str
}
\n
{
self
.
_print
(
node
.
body
)
}
"
def
_print_SympyAssignment
(
self
,
node
):
...
...
pystencils/cpu/vectorization.py
View file @
59840a2f
...
...
@@ -154,8 +154,6 @@ def vectorize_inner_loops_and_adapt_load_stores(ast_node, vector_width, assume_a
cutting_point
=
modulo_floor
(
loop_range
,
vector_width
)
+
loop_node
.
start
loop_nodes
=
[
l
for
l
in
cut_loop
(
loop_node
,
[
cutting_point
]).
args
if
isinstance
(
l
,
ast
.
LoopOverCoordinate
)]
assert
len
(
loop_nodes
)
in
(
0
,
1
,
2
)
# 2 for main and tail loop, 1 if loop range divisible by vector width
if
len
(
loop_nodes
)
==
2
:
loop_nodes
[
1
].
instruction_set
=
None
if
len
(
loop_nodes
)
==
0
:
continue
loop_node
=
loop_nodes
[
0
]
...
...
@@ -314,9 +312,6 @@ def insert_vector_casts(ast_node):
return
expr
def
visit_node
(
node
,
substitution_dict
):
if
hasattr
(
node
,
'instruction_set'
)
and
node
.
instruction_set
is
None
:
# the tail loop must not be vectorized
return
substitution_dict
=
substitution_dict
.
copy
()
for
arg
in
node
.
args
:
if
isinstance
(
arg
,
ast
.
SympyAssignment
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment