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
Model registry
Operate
Environments
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
pycodegen
pystencils
Commits
8833346c
Commit
8833346c
authored
7 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Fixes in vectorization to also support float kernels
parent
c378ca19
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
transformations.py
+6
-6
6 additions, 6 deletions
transformations.py
with
6 additions
and
6 deletions
transformations.py
+
6
−
6
View file @
8833346c
...
...
@@ -707,7 +707,7 @@ class KernelConstraintsCheck:
new_lhs
=
self
.
_process_lhs
(
assignment
.
lhs
)
return
ast
.
SympyAssignment
(
new_lhs
,
new_rhs
)
def
process_expression
(
self
,
rhs
):
def
process_expression
(
self
,
rhs
,
type_constants
=
True
):
self
.
_update_accesses_rhs
(
rhs
)
if
isinstance
(
rhs
,
Field
.
Access
):
self
.
fields_read
.
add
(
rhs
.
field
)
...
...
@@ -716,19 +716,19 @@ class KernelConstraintsCheck:
return
rhs
elif
isinstance
(
rhs
,
sp
.
Symbol
):
return
TypedSymbol
(
symbol_name_to_variable_name
(
rhs
.
name
),
self
.
_type_for_symbol
[
rhs
.
name
])
elif
isinstance
(
rhs
,
sp
.
Number
):
elif
type_constants
and
isinstance
(
rhs
,
sp
.
Number
):
return
cast_func
(
rhs
,
create_type
(
self
.
_type_for_symbol
[
'
_constant
'
]))
elif
isinstance
(
rhs
,
sp
.
Mul
):
new_args
=
[
self
.
process_expression
(
arg
)
if
arg
not
in
(
-
1
,
1
)
else
arg
for
arg
in
rhs
.
args
]
new_args
=
[
self
.
process_expression
(
arg
,
type_constants
)
if
arg
not
in
(
-
1
,
1
)
else
arg
for
arg
in
rhs
.
args
]
return
rhs
.
func
(
*
new_args
)
if
new_args
else
rhs
elif
isinstance
(
rhs
,
sp
.
Indexed
):
return
rhs
else
:
if
isinstance
(
rhs
,
sp
.
Pow
):
# don't process exponents -> they should remain integers
return
sp
.
Pow
(
self
.
process_expression
(
rhs
.
args
[
0
]),
rhs
.
args
[
1
])
return
sp
.
Pow
(
self
.
process_expression
(
rhs
.
args
[
0
]
,
type_constants
),
rhs
.
args
[
1
])
else
:
new_args
=
[
self
.
process_expression
(
arg
)
for
arg
in
rhs
.
args
]
new_args
=
[
self
.
process_expression
(
arg
,
type_constants
)
for
arg
in
rhs
.
args
]
return
rhs
.
func
(
*
new_args
)
if
new_args
else
rhs
@property
...
...
@@ -796,7 +796,7 @@ def add_types(eqs, type_for_symbol, check_independence_condition):
return
check
.
process_assignment
(
obj
)
elif
isinstance
(
obj
,
ast
.
Conditional
):
false_block
=
None
if
obj
.
false_block
is
None
else
visit
(
obj
.
false_block
)
return
ast
.
Conditional
(
check
.
process_expression
(
obj
.
condition_expr
),
return
ast
.
Conditional
(
check
.
process_expression
(
obj
.
condition_expr
,
type_constants
=
False
),
true_block
=
visit
(
obj
.
true_block
),
false_block
=
false_block
)
elif
isinstance
(
obj
,
ast
.
Block
):
return
ast
.
Block
([
visit
(
e
)
for
e
in
obj
.
args
])
...
...
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