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
Christoph Alt
pystencils
Commits
d1ee3d7f
Commit
d1ee3d7f
authored
2 years ago
by
Christoph Alt
Browse files
Options
Downloads
Patches
Plain Diff
dirty hack to print sqrt instead of pow( 0.5 )
parent
c55ae38c
Branches
stencilstream
No related tags found
No related merge requests found
Pipeline
#48147
failed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/backends/syclbackend.py
+4
-4
4 additions, 4 deletions
pystencils/backends/syclbackend.py
with
4 additions
and
4 deletions
pystencils/backends/syclbackend.py
+
4
−
4
View file @
d1ee3d7f
...
@@ -6,7 +6,7 @@ import sympy as sp
...
@@ -6,7 +6,7 @@ import sympy as sp
from
pystencils.astnodes
import
Node
,
cast_func
from
pystencils.astnodes
import
Node
,
cast_func
from
pystencils.backends.cbackend
import
CBackend
,
CustomSympyPrinter
,
generate_c
from
pystencils.backends.cbackend
import
CBackend
,
CustomSympyPrinter
,
generate_c
from
pystencils.data_types
import
(
Type
,
VectorType
,
get_type_of_expression
,
collate_types
,)
from
pystencils.data_types
import
Type
,
VectorType
,
collate_types
,
get_type_of_expression
from
pystencils.field
import
Field
from
pystencils.field
import
Field
with
open
(
join
(
dirname
(
__file__
),
"
sycl_known_functions.txt
"
))
as
f
:
with
open
(
join
(
dirname
(
__file__
),
"
sycl_known_functions.txt
"
))
as
f
:
...
@@ -216,10 +216,10 @@ class SyCLSympyPrinter(CustomSympyPrinter):
...
@@ -216,10 +216,10 @@ class SyCLSympyPrinter(CustomSympyPrinter):
return
f
"
(
{
self
.
_print
(
sp
.
Mul
(
*
[
expr
.
base
]
*
expr
.
exp
,
evaluate
=
False
))
}
)
"
return
f
"
(
{
self
.
_print
(
sp
.
Mul
(
*
[
expr
.
base
]
*
expr
.
exp
,
evaluate
=
False
))
}
)
"
elif
expr
.
exp
.
is_integer
and
-
8
<
expr
.
exp
<
0
:
elif
expr
.
exp
.
is_integer
and
-
8
<
expr
.
exp
<
0
:
return
super
().
_print_Pow
(
expr
)
return
super
().
_print_Pow
(
expr
)
if
get_type_of_expression
(
expr
.
exp
)
!=
base_type
:
if
expr
.
exp
==
0.5
or
expr
.
exp
==
-
0.5
or
get_type_of_expression
(
expr
.
exp
)
==
base_type
:
ret
=
pre_fixed_pow
(
sp
.
Pow
(
expr
.
base
,
cast_func
(
expr
.
exp
,
base_type
)))
else
:
ret
=
pre_fixed_pow
(
expr
)
ret
=
pre_fixed_pow
(
expr
)
else
:
ret
=
pre_fixed_pow
(
sp
.
Pow
(
expr
.
base
,
cast_func
(
expr
.
exp
,
base_type
)))
try
:
try
:
number
=
float
(
ret
)
number
=
float
(
ret
)
...
...
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