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
87f5cfdd
Commit
87f5cfdd
authored
4 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Replaced all format strings with f-strings in test cases
parent
bced838a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pystencils_tests/test_blocking.py
+1
-1
1 addition, 1 deletion
pystencils_tests/test_blocking.py
pystencils_tests/test_interpolation.py
+2
-2
2 additions, 2 deletions
pystencils_tests/test_interpolation.py
pystencils_tests/test_loop_cutting.py
+1
-1
1 addition, 1 deletion
pystencils_tests/test_loop_cutting.py
with
4 additions
and
4 deletions
pystencils_tests/test_blocking.py
+
1
−
1
View file @
87f5cfdd
...
...
@@ -19,7 +19,7 @@ def check_equivalence(assignments, src_arr):
with_blocking
=
ps
.
create_kernel
(
assignments
,
cpu_blocking
=
(
8
,
16
,
4
),
cpu_openmp
=
openmp
,
cpu_vectorize_info
=
vectorization
).
compile
()
without_blocking
=
ps
.
create_kernel
(
assignments
).
compile
()
print
(
"
openmp {}, vectorization {
}
"
.
format
(
openmp
,
vectorization
)
)
print
(
f
"
openmp
{
openmp
}
, vectorization
{
vectorization
}
"
)
dst_arr
=
np
.
zeros_like
(
src_arr
)
ref_arr
=
np
.
zeros_like
(
src_arr
)
np
.
copyto
(
src_arr
,
np
.
random
.
rand
(
*
src_arr
.
shape
))
...
...
This diff is collapsed.
Click to expand it.
pystencils_tests/test_interpolation.py
+
2
−
2
View file @
87f5cfdd
...
...
@@ -125,7 +125,7 @@ def test_rotate_interpolation_gpu(dtype, address_mode, use_textures):
else
:
lenna_gpu
=
gpuarray
.
to_gpu
(
np
.
ascontiguousarray
(
lenna
,
dtype
))
x_f
,
y_f
=
pystencils
.
fields
(
'
x,y:
%s [2d]
'
%
type_map
[
dtype
],
ghost_layers
=
0
)
x_f
,
y_f
=
pystencils
.
fields
(
f
'
x,y:
{
type_map
[
dtype
]
}
[2d]
'
,
ghost_layers
=
0
)
transformed
=
scale
*
\
sympy
.
rot_axis3
(
rotation_angle
)[:
2
,
:
2
]
*
sympy
.
Matrix
((
x_
,
y_
))
-
sympy
.
Matrix
([
2
,
2
])
...
...
@@ -173,7 +173,7 @@ def test_shift_interpolation_gpu(address_mode, dtype, use_textures):
lenna_gpu
=
gpuarray
.
to_gpu
(
np
.
ascontiguousarray
(
lenna
,
dtype
))
x_f
,
y_f
=
pystencils
.
fields
(
'
x,y:
%s [2d]
'
%
type_map
[
dtype
],
ghost_layers
=
0
)
x_f
,
y_f
=
pystencils
.
fields
(
f
'
x,y:
{
type_map
[
dtype
]
}
[2d]
'
,
ghost_layers
=
0
)
if
use_textures
:
transformed
=
scale
*
sympy
.
rot_axis3
(
rotation_angle
)[:
2
,
:
2
]
*
sympy
.
Matrix
((
x_
,
y_
))
+
shift
...
...
This diff is collapsed.
Click to expand it.
pystencils_tests/test_loop_cutting.py
+
1
−
1
View file @
87f5cfdd
...
...
@@ -112,7 +112,7 @@ def test_staggered_iteration_manual():
def
test_staggered_gpu
():
dim
=
2
f
=
ps
.
fields
(
"
f: double[{dim}D]
"
.
format
(
dim
=
dim
)
)
f
=
ps
.
fields
(
f
"
f: double[
{
dim
}
D]
"
)
s
=
ps
.
fields
(
"
s({dim}): double[{dim}D]
"
.
format
(
dim
=
dim
),
field_type
=
FieldType
.
STAGGERED
)
expressions
=
[(
f
[
0
,
0
]
+
f
[
-
1
,
0
])
/
2
,
(
f
[
0
,
0
]
+
f
[
0
,
-
1
])
/
2
]
...
...
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