Skip to content

Commit 1640998

Browse files
committed
cleanup inline comments, address pr comments.
1 parent 53b809c commit 1640998

4 files changed

Lines changed: 5 additions & 30 deletions

File tree

benchmarks/benchmarks/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def _make_input(rng, shape, dtype):
99
"""Return an array of *shape* and *dtype*.
1010
1111
Complex dtypes get non-zero imaginary parts for a realistic signal.
12-
*shape* may be an int (1-D) or a tuple.
12+
`shape` may be an int (1-D) or a tuple.
1313
"""
1414
dt = np.dtype(dtype)
1515
s = (shape,) if isinstance(shape, int) else shape
@@ -22,7 +22,7 @@ class BenchC2C:
2222
"""Base setup for complex-to-complex benchmarks.
2323
2424
Subclasses define params, param_names, and time_* / peakmem_* methods.
25-
Extra positional params (e.g. module) are accepted and ignored.
25+
Other positional params are ignored.
2626
"""
2727

2828
def setup(self, shape, dtype, *_):

benchmarks/benchmarks/bench_fft1d.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ class BenchFFT1D(BenchC2C):
2121

2222
def setup(self, n, dtype):
2323
super().setup(n, dtype)
24-
# Prime the MKL DFTI descriptor cache so the first measured
25-
# iteration doesn't pay the one-time descriptor-creation cost.
26-
# ASV's warmup_time (default 0.1s) would normally cover this,
27-
# but doing it explicitly removes the dependency on that default.
24+
# prime MKL DFTI descriptor cache
2825
mkl_fft.fft(self.x)
2926
mkl_fft.ifft(self.x)
3027

@@ -48,7 +45,6 @@ class BenchRFFT1D(BenchR2C):
4845

4946
def setup(self, n, dtype):
5047
super().setup(n, dtype)
51-
# Prime the DFTI descriptor cache (see BenchFFT1D.setup).
5248
mkl_fft.rfft(self.x_real)
5349
mkl_fft.irfft(self.x_complex, n=n)
5450

@@ -76,7 +72,6 @@ class BenchFFT1DNonPow2(BenchC2C):
7672

7773
def setup(self, n, dtype):
7874
super().setup(n, dtype)
79-
# Prime the DFTI descriptor cache (see BenchFFT1D.setup).
8075
mkl_fft.fft(self.x)
8176
mkl_fft.ifft(self.x)
8277

@@ -100,7 +95,6 @@ class BenchRFFT1DNonPow2(BenchR2C):
10095

10196
def setup(self, n, dtype):
10297
super().setup(n, dtype)
103-
# Prime the DFTI descriptor cache (see BenchFFT1D.setup).
10498
mkl_fft.rfft(self.x_real)
10599
mkl_fft.irfft(self.x_complex, n=n)
106100

benchmarks/benchmarks/bench_fftnd.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ class BenchFFT2D(BenchC2C):
2828

2929
def setup(self, shape, dtype):
3030
super().setup(shape, dtype)
31-
# Prime the MKL DFTI descriptor cache so the first measured
32-
# iteration doesn't pay the one-time descriptor-creation cost.
33-
# ASV's warmup_time (default 0.1s) would normally cover this,
34-
# but doing it explicitly removes the dependency on that default.
31+
# Prime MKL DFTI descriptor cache
3532
mkl_fft.fft2(self.x)
3633
mkl_fft.ifft2(self.x)
3734

@@ -55,7 +52,6 @@ class BenchRFFT2D(BenchR2C):
5552

5653
def setup(self, shape, dtype):
5754
super().setup(shape, dtype)
58-
# Prime the DFTI descriptor cache (see BenchFFT2D.setup).
5955
mkl_fft.rfft2(self.x_real)
6056
mkl_fft.irfft2(self.x_complex, s=shape)
6157

@@ -88,7 +84,6 @@ class BenchFFT2DNonPow2(BenchC2C):
8884

8985
def setup(self, shape, dtype):
9086
super().setup(shape, dtype)
91-
# Prime the DFTI descriptor cache (see BenchFFT2D.setup).
9287
mkl_fft.fft2(self.x)
9388
mkl_fft.ifft2(self.x)
9489

@@ -115,7 +110,6 @@ class BenchFFTnD(BenchC2C):
115110

116111
def setup(self, shape, dtype):
117112
super().setup(shape, dtype)
118-
# Prime the DFTI descriptor cache (see BenchFFT2D.setup).
119113
mkl_fft.fftn(self.x)
120114
mkl_fft.ifftn(self.x)
121115

@@ -139,7 +133,6 @@ class BenchRFFTnD(BenchR2C):
139133

140134
def setup(self, shape, dtype):
141135
super().setup(shape, dtype)
142-
# Prime the DFTI descriptor cache (see BenchFFT2D.setup).
143136
mkl_fft.rfftn(self.x_real)
144137
mkl_fft.irfftn(self.x_complex, s=shape)
145138

@@ -171,7 +164,6 @@ class BenchFFTnDNonPow2(BenchC2C):
171164

172165
def setup(self, shape, dtype):
173166
super().setup(shape, dtype)
174-
# Prime the DFTI descriptor cache (see BenchFFT2D.setup).
175167
mkl_fft.fftn(self.x)
176168
mkl_fft.ifftn(self.x)
177169

benchmarks/benchmarks/bench_interfaces.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ def setup(self, n, dtype, module):
4949
mod = _MODULE_MAP[module]
5050
self.fft = mod.fft
5151
self.ifft = mod.ifft
52-
# Prime the MKL DFTI descriptor cache so the first measured
53-
# iteration doesn't pay the one-time descriptor-creation cost.
54-
# ASV's warmup_time (default 0.1s) would normally cover this,
55-
# but doing it explicitly removes the dependency on that default.
52+
# Prime MKL DFTI descriptor cache
5653
self.fft(self.x)
5754
self.ifft(self.x)
5855

@@ -79,7 +76,6 @@ def setup(self, n, dtype, module):
7976
mod = _MODULE_MAP[module]
8077
self.rfft = mod.rfft
8178
self.irfft = mod.irfft
82-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
8379
self.rfft(self.x_real)
8480
self.irfft(self.x_complex, n=n)
8581

@@ -112,7 +108,6 @@ def setup(self, n, dtype, module):
112108
mod = _MODULE_MAP[module]
113109
self.hfft = mod.hfft
114110
self.ihfft = mod.ihfft
115-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
116111
self.hfft(self.x_complex, n=n)
117112
self.ihfft(self.x_real)
118113

@@ -139,7 +134,6 @@ def setup(self, shape, dtype, module):
139134
mod = _MODULE_MAP[module]
140135
self.fft2 = mod.fft2
141136
self.ifft2 = mod.ifft2
142-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
143137
self.fft2(self.x)
144138
self.ifft2(self.x)
145139

@@ -166,7 +160,6 @@ def setup(self, shape, dtype, module):
166160
mod = _MODULE_MAP[module]
167161
self.rfft2 = mod.rfft2
168162
self.irfft2 = mod.irfft2
169-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
170163
self.rfft2(self.x_real)
171164
self.irfft2(self.x_complex, s=shape)
172165

@@ -198,7 +191,6 @@ def setup(self, shape, dtype, module):
198191
mod = _MODULE_MAP[module]
199192
self.hfft2 = mod.hfft2
200193
self.ihfft2 = mod.ihfft2
201-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
202194
self.hfft2(self.x_complex, s=shape)
203195
self.ihfft2(self.x_real)
204196

@@ -225,7 +217,6 @@ def setup(self, shape, dtype, module):
225217
mod = _MODULE_MAP[module]
226218
self.fftn = mod.fftn
227219
self.ifftn = mod.ifftn
228-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
229220
self.fftn(self.x)
230221
self.ifftn(self.x)
231222

@@ -252,7 +243,6 @@ def setup(self, shape, dtype, module):
252243
mod = _MODULE_MAP[module]
253244
self.rfftn = mod.rfftn
254245
self.irfftn = mod.irfftn
255-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
256246
self.rfftn(self.x_real)
257247
self.irfftn(self.x_complex, s=shape)
258248

@@ -284,7 +274,6 @@ def setup(self, shape, dtype, module):
284274
mod = _MODULE_MAP[module]
285275
self.hfftn = mod.hfftn
286276
self.ihfftn = mod.ihfftn
287-
# Prime the DFTI descriptor cache (see BenchC2C1D.setup).
288277
self.hfftn(self.x_complex, s=shape)
289278
self.ihfftn(self.x_real)
290279

0 commit comments

Comments
 (0)