Skip to content

Commit 32b3654

Browse files
Merge pull request #16 from IntelPython/scipy_workaround
Enable MKL in SciPy
2 parents a752870 + a744f80 commit 32b3654

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 (ImportError, ModuleNotFoundError, ValueError):
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)