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
Stephan Seitz
pystencils
Commits
3664c9da
Commit
3664c9da
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Fix CBackends _print_Function for functions that don't have names
Like LLVM backend's pointer_arithmetic_func
parent
e1b452f7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/backends/cbackend.py
+3
-1
3 additions, 1 deletion
pystencils/backends/cbackend.py
with
3 additions
and
1 deletion
pystencils/backends/cbackend.py
+
3
−
1
View file @
3664c9da
...
...
@@ -5,6 +5,7 @@ import numpy as np
import
sympy
as
sp
from
sympy.core
import
S
from
sympy.printing.ccode
import
C89CodePrinter
from
pystencils.astnodes
import
KernelFunction
,
Node
from
pystencils.cpu.vectorization
import
vec_all
,
vec_any
from
pystencils.data_types
import
(
...
...
@@ -385,8 +386,9 @@ class CustomSympyPrinter(CCodePrinter):
elif
expr
.
func
==
int_div
:
return
"
((%s) / (%s))
"
%
(
self
.
_print
(
expr
.
args
[
0
]),
self
.
_print
(
expr
.
args
[
1
]))
else
:
name
=
expr
.
name
if
hasattr
(
expr
,
'
name
'
)
else
expr
.
__class__
.
__name__
arg_str
=
'
,
'
.
join
(
self
.
_print
(
a
)
for
a
in
expr
.
args
)
return
f
'
{
expr
.
name
}
(
{
arg_str
}
)
'
return
f
'
{
name
}
(
{
arg_str
}
)
'
def
_typed_number
(
self
,
number
,
dtype
):
res
=
self
.
_print
(
number
)
...
...
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