Skip to content

Commit 57c78bc

Browse files
authored
Enable MKL in SciPy
Enable MKL in SciPy in case of presence of mkl_fft package in the environment
1 parent 509fccd commit 57c78bc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fft_bench.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
import re
1313
import sys
1414

15+
try: # Workaround for disabled mkl_fft in latest Intel SciPy
16+
import mkl_fft
17+
import mkl_fft._scipy_fft_backend as sfbn
18+
scipy.fft.set_global_backend(sfbn)
19+
except:
20+
print("Unable to use mkl_fft as scipy.fft backend")
21+
1522
# Mark which FFT submodules are available...
1623
fft_modules = {'numpy.fft': np.fft, 'scipy.fft': scipy.fft}
1724

0 commit comments

Comments
 (0)