Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
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
pycodegen
lbmpy
Commits
4203fa7f
Commit
4203fa7f
authored
5 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Removed hash equivalence test
parent
f6a9b096
No related branches found
No related tags found
No related merge requests found
Pipeline
#19054
failed
5 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy_tests/test_code_hashequivalence.py
+0
-14
0 additions, 14 deletions
lbmpy_tests/test_code_hashequivalence.py
with
0 additions
and
14 deletions
lbmpy_tests/test_code_hashequivalence.py
+
0
−
14
View file @
4203fa7f
from
hashlib
import
sha256
from
lbmpy.creationfunctions
import
create_lb_ast
from
pystencils.backends.cbackend
import
generate_c
from
pystencils.llvm.llvmjit
import
generate_llvm
def
test_hash_equivalence
():
"""
This test should ensure that if the Python interpreter is called multiple times to generated the same method
exactly the same code (not only functionally equivalent code) should be produced.
Due to undefined order in sets and dicts this may no be the case.
"""
ref_value
=
"
902be811a587c52e24ce03ec78d3defbb87d58eaaafbb9b47f823b960319e4be
"
ast
=
create_lb_ast
(
stencil
=
'
D3Q19
'
,
method
=
'
srt
'
,
optimization
=
{
'
openmp
'
:
False
})
code
=
generate_c
(
ast
)
hash_value
=
sha256
(
code
.
encode
()).
hexdigest
()
assert
hash_value
==
ref_value
def
test_hash_equivalence_llvm
():
ref_value
=
"
6db6ed9e2cbd05edae8fcaeb8168e3178dd578c2681133f3ae9228b23d2be432
"
ast
=
create_lb_ast
(
stencil
=
'
D3Q19
'
,
method
=
'
srt
'
,
optimization
=
{
'
target
'
:
'
llvm
'
})
...
...
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