Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tom Harke
pystencils
Commits
3d8dd38f
Commit
3d8dd38f
authored
Apr 26, 2019
by
Nils Kohl
🌝
Committed by
Martin Bauer
Apr 26, 2019
Browse files
Relaxed assertion in vectorization
parent
e012de4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/cpu/vectorization.py
View file @
3d8dd38f
...
...
@@ -92,8 +92,10 @@ def vectorize_inner_loops_and_adapt_load_stores(ast_node, vector_width, assume_a
loop_node
.
stop
=
new_stop
else
:
cutting_point
=
modulo_floor
(
loop_range
,
vector_width
)
+
loop_node
.
start
loop_nodes
=
cut_loop
(
loop_node
,
[
cutting_point
])
assert
len
(
loop_nodes
)
in
(
1
,
2
)
# 2 for main and tail loop, 1 if loop range divisible by vector width
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
)
==
0
:
continue
loop_node
=
loop_nodes
[
0
]
# Find all array accesses (indexed) that depend on the loop counter as offset
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment