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
ebc36d2d
Commit
ebc36d2d
authored
1 year ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
temporarily remove modulo_floor
parent
df9b0a8e
No related branches found
No related tags found
No related merge requests found
Pipeline
#64763
failed
1 year ago
Stage: pretest
Stage: test
Stage: docs
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils/backend/kernelcreation/freeze.py
+1
-2
1 addition, 2 deletions
src/pystencils/backend/kernelcreation/freeze.py
tests/nbackend/kernelcreation/test_freeze.py
+2
-2
2 additions, 2 deletions
tests/nbackend/kernelcreation/test_freeze.py
with
3 additions
and
4 deletions
src/pystencils/backend/kernelcreation/freeze.py
+
1
−
2
View file @
ebc36d2d
...
@@ -332,9 +332,8 @@ class FreezeExpressions:
...
@@ -332,9 +332,8 @@ class FreezeExpressions:
return
PsBitwiseOr
(
*
args
)
return
PsBitwiseOr
(
*
args
)
case
integer_functions
.
int_power_of_2
():
case
integer_functions
.
int_power_of_2
():
return
PsLeftShift
(
PsExpression
.
make
(
PsConstant
(
1
)),
args
[
0
])
return
PsLeftShift
(
PsExpression
.
make
(
PsConstant
(
1
)),
args
[
0
])
case
integer_functions
.
modulo_floor
():
return
PsIntDiv
(
*
args
)
*
args
[
1
]
# TODO: what exactly are the semantics?
# TODO: what exactly are the semantics?
# case integer_functions.modulo_floor():
# case integer_functions.div_floor()
# case integer_functions.div_floor()
# TODO: requires if *expression*
# TODO: requires if *expression*
# case integer_functions.modulo_ceil():
# case integer_functions.modulo_ceil():
...
...
This diff is collapsed.
Click to expand it.
tests/nbackend/kernelcreation/test_freeze.py
+
2
−
2
View file @
ebc36d2d
...
@@ -132,7 +132,7 @@ def test_freeze_integer_functions():
...
@@ -132,7 +132,7 @@ def test_freeze_integer_functions():
asms
=
[
asms
=
[
Assignment
(
z
,
int_div
(
x
,
y
)),
Assignment
(
z
,
int_div
(
x
,
y
)),
Assignment
(
z
,
int_power_of_2
(
x
,
y
)),
Assignment
(
z
,
int_power_of_2
(
x
,
y
)),
Assignment
(
z
,
modulo_floor
(
x
,
y
)),
#
Assignment(z, modulo_floor(x, y)),
]
]
fasms
=
[
freeze
(
asm
)
for
asm
in
asms
]
fasms
=
[
freeze
(
asm
)
for
asm
in
asms
]
...
@@ -140,7 +140,7 @@ def test_freeze_integer_functions():
...
@@ -140,7 +140,7 @@ def test_freeze_integer_functions():
should
=
[
should
=
[
PsDeclaration
(
z2
,
PsIntDiv
(
x2
,
y2
)),
PsDeclaration
(
z2
,
PsIntDiv
(
x2
,
y2
)),
PsDeclaration
(
z2
,
PsLeftShift
(
PsExpression
.
make
(
PsConstant
(
1
)),
x2
)),
PsDeclaration
(
z2
,
PsLeftShift
(
PsExpression
.
make
(
PsConstant
(
1
)),
x2
)),
PsDeclaration
(
z2
,
PsMul
(
PsIntDiv
(
x2
,
y2
),
y2
)),
#
PsDeclaration(z2, PsMul(PsIntDiv(x2, y2), y2)),
]
]
for
fasm
,
correct
in
zip
(
fasms
,
should
):
for
fasm
,
correct
in
zip
(
fasms
,
should
):
...
...
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