Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
pypocketfft
Commits
d5334da6
Commit
d5334da6
authored
Nov 04, 2019
by
Martin Reinecke
Browse files
revert a few changes in test codes
parent
08c85d30
Changes
2
Hide whitespace changes
Inline
Side-by-side
bench.py
View file @
d5334da6
...
...
@@ -107,7 +107,7 @@ def bench_nd(ndim, nmax, ntry, tp, funcs, nrepeat, ttl="", filename=""):
plt
.
show
()
funcs
=
(
measure_pypocketfft
,
measure_fftw
_np_interface
)
funcs
=
(
measure_pypocketfft
,
measure_fftw
)
ttl
=
"pypocketfft/FFTW()"
bench_nd
(
1
,
8192
,
100
,
"c16"
,
funcs
,
10
,
ttl
,
"1d.png"
)
bench_nd
(
2
,
2048
,
100
,
"c16"
,
funcs
,
2
,
ttl
,
"2d.png"
)
...
...
stress.py
View file @
d5334da6
...
...
@@ -2,8 +2,6 @@ import numpy as np
import
pypocketfft
np
.
random
.
seed
(
42
)
def
_l2error
(
a
,
b
,
axes
):
return
np
.
sqrt
(
np
.
sum
(
np
.
abs
(
a
-
b
)
**
2
)
/
np
.
sum
(
np
.
abs
(
a
)
**
2
))
/
np
.
log2
(
np
.
max
([
2
,
np
.
prod
(
np
.
take
(
a
.
shape
,
axes
))]))
...
...
@@ -28,7 +26,7 @@ def irfftn(a, axes=None, lastsize=0, inorm=0, nthreads=1):
inorm
=
inorm
,
nthreads
=
nthreads
)
nthreads
=
1
nthreads
=
0
def
update_err
(
err
,
name
,
value
):
...
...
@@ -42,9 +40,9 @@ def update_err(err, name, value):
def
test
(
err
):
ndim
=
3
#
np.random.randint(1, 5)
ndim
=
np
.
random
.
randint
(
1
,
5
)
axlen
=
int
((
2
**
20
)
**
(
1.
/
ndim
))
shape
=
(
np
.
random
.
randint
(
1
,
axlen
,
ndim
)
//
2
)
*
2
+
1
shape
=
np
.
random
.
randint
(
1
,
axlen
,
ndim
)
axes
=
np
.
arange
(
ndim
)
np
.
random
.
shuffle
(
axes
)
nax
=
np
.
random
.
randint
(
1
,
ndim
+
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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