Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
pystencils
Commits
87f5cfdd
Commit
87f5cfdd
authored
Jun 19, 2020
by
Markus Holzer
Browse files
Replaced all format strings with f-strings in test cases
parent
bced838a
Pipeline
#24533
passed with stage
in 10 minutes and 47 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pystencils_tests/test_blocking.py
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
))
...
...
pystencils_tests/test_interpolation.py
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
...
...
pystencils_tests/test_loop_cutting.py
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
]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment