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
Compare revisions
master to vectorization_sqrt_fix
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
hyteg/pystencils
Select target project
No results found
vectorization_sqrt_fix
Select Git revision
Swap
Target
pycodegen/pystencils
Select target project
anirudh.jonnalagadda/pystencils
hyteg/pystencils
jbadwaik/pystencils
jngrad/pystencils
itischler/pystencils
ob28imeq/pystencils
hoenig/pystencils
Bindgen/pystencils
hammer/pystencils
da15siwa/pystencils
holzer/pystencils
alexander.reinauer/pystencils
ec93ujoh/pystencils
Harke/pystencils
seitz/pystencils
pycodegen/pystencils
16 results
master
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Fix: vectorization of float sqrt
· c5cdc763
Markus Holzer
authored
4 years ago
c5cdc763
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/backends/cbackend.py
+2
-0
2 additions, 0 deletions
pystencils/backends/cbackend.py
pystencils/data_types.py
+1
-1
1 addition, 1 deletion
pystencils/data_types.py
with
3 additions
and
1 deletion
pystencils/backends/cbackend.py
View file @
c5cdc763
...
...
@@ -391,6 +391,8 @@ class CustomSympyPrinter(CCodePrinter):
if
isinstance
(
arg
,
sp
.
Number
)
and
arg
.
is_finite
:
return
self
.
_typed_number
(
arg
,
data_type
)
else
:
if
str
(
arg
)
==
"
-1
"
:
print
(
"
!!
"
)
return
"
((%s)(%s))
"
%
(
data_type
,
self
.
_print
(
arg
))
elif
isinstance
(
expr
,
fast_division
):
return
"
({})
"
.
format
(
self
.
_print
(
expr
.
args
[
0
]
/
expr
.
args
[
1
]))
...
...
This diff is collapsed.
Click to expand it.
pystencils/data_types.py
View file @
c5cdc763
...
...
@@ -550,7 +550,7 @@ def get_type_of_expression(expr,
return
result
elif
isinstance
(
expr
,
sp
.
Pow
):
base_type
=
get_type
(
expr
.
args
[
0
])
if
expr
.
exp
.
is_integer
:
if
expr
.
exp
.
is_integer
or
expr
.
exp
==
sp
.
Rational
(
1
,
2
)
:
return
base_type
else
:
return
collate_types
([
create_type
(
default_float_type
),
base_type
])
...
...
This diff is collapsed.
Click to expand it.