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
Commits
98f072ff
Commit
98f072ff
authored
4 years ago
by
Dominik Thoennes
Browse files
Options
Downloads
Patches
Plain Diff
some fixes for hyteg
parent
f8ea9fc4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/backends/cbackend.py
+4
-1
4 additions, 1 deletion
pystencils/backends/cbackend.py
pystencils/integer_functions.py
+5
-1
5 additions, 1 deletion
pystencils/integer_functions.py
with
9 additions
and
2 deletions
pystencils/backends/cbackend.py
+
4
−
1
View file @
98f072ff
...
...
@@ -228,7 +228,8 @@ class CBackend:
def
_print_LoopOverCoordinate
(
self
,
node
):
counter_symbol
=
node
.
loop_counter_name
start
=
f
"
int
{
counter_symbol
}
=
{
self
.
sympy_printer
.
doprint
(
node
.
start
)
}
"
condition
=
f
"
{
counter_symbol
}
<
{
self
.
sympy_printer
.
doprint
(
node
.
stop
)
}
"
condition
=
f
"
{
self
.
sympy_printer
.
doprint
(
node
.
relational
(
node
.
loop_counter_symbol
,
node
.
stop
))
}
"
#condition = f"{counter_symbol} < {self.sympy_printer.doprint(node.stop)}"
update
=
f
"
{
counter_symbol
}
+=
{
self
.
sympy_printer
.
doprint
(
node
.
step
)
}
"
loop_str
=
f
"
for (
{
start
}
;
{
condition
}
;
{
update
}
)
"
...
...
@@ -412,6 +413,8 @@ class CustomSympyPrinter(CCodePrinter):
return
f
"
(1 << (
{
self
.
_print
(
expr
.
args
[
0
])
}
))
"
elif
expr
.
func
==
int_div
:
return
f
"
((
{
self
.
_print
(
expr
.
args
[
0
])
}
) / (
{
self
.
_print
(
expr
.
args
[
1
])
}
))
"
elif
expr
.
func
==
post_increment
:
return
f
"
(
{
self
.
_print
(
expr
.
args
[
0
])
}
)
"
else
:
name
=
expr
.
name
if
hasattr
(
expr
,
'
name
'
)
else
expr
.
__class__
.
__name__
arg_str
=
'
,
'
.
join
(
self
.
_print
(
a
)
for
a
in
expr
.
args
)
...
...
This diff is collapsed.
Click to expand it.
pystencils/integer_functions.py
+
5
−
1
View file @
98f072ff
...
...
@@ -59,7 +59,11 @@ class int_div(IntegerFunctionTwoArgsMixIn):
# noinspection PyPep8Naming
class
int_power_of_2
(
IntegerFunctionTwoArgsMixIn
):
class
int_power_of_2
(
sp
.
Function
):
pass
# noinspection PyPep8Naming
class
post_increment
(
sp
.
Function
):
pass
...
...
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