Skip to content

Commit 7e42ed9

Browse files
committed
Add check to skip mkl_fft on darwin
1 parent 406693e commit 7e42ed9

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

pytests/test_ffts.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import itertools
22
import os
3+
import sys
34

45
if int(os.environ.get("TEST_CUPY_PYLOPS", 0)):
56
import cupy as np
@@ -322,6 +323,8 @@ def test_unknown_engine(par):
322323

323324
@pytest.mark.parametrize("par", pars_fft_small_real)
324325
def test_FFT_small_real(par):
326+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
327+
pytest.skip("mkl_fft not supported on macOS")
325328
np.random.seed(5)
326329

327330
if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"):
@@ -399,6 +402,8 @@ def test_FFT_small_real(par):
399402
)
400403
@pytest.mark.parametrize("par", pars_fft_random_real)
401404
def test_FFT_random_real(par):
405+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
406+
pytest.skip("mkl_fft not supported on macOS")
402407
np.random.seed(5)
403408

404409
shape = par["shape"]
@@ -455,6 +460,8 @@ def test_FFT_random_real(par):
455460

456461
@pytest.mark.parametrize("par", pars_fft_small_cpx)
457462
def test_FFT_small_complex(par):
463+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
464+
pytest.skip("mkl_fft not supported on macOS")
458465
np.random.seed(5)
459466
dtype, decimal = par["dtype_precision"]
460467
norm = par["norm"]
@@ -527,6 +534,8 @@ def test_FFT_small_complex(par):
527534

528535
@pytest.mark.parametrize("par", pars_fft_random_cpx)
529536
def test_FFT_random_complex(par):
537+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
538+
pytest.skip("mkl_fft not supported on macOS")
530539
np.random.seed(5)
531540
if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"):
532541
shape = par["shape"]
@@ -614,6 +623,8 @@ def test_FFT_random_complex(par):
614623
)
615624
@pytest.mark.parametrize("par", pars_fft2d_random_real)
616625
def test_FFT2D_random_real(par):
626+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
627+
pytest.skip("mkl_fft not supported on macOS")
617628
np.random.seed(5)
618629
if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"):
619630
shape = par["shape"]
@@ -675,6 +686,8 @@ def test_FFT2D_random_real(par):
675686

676687
@pytest.mark.parametrize("par", pars_fft2d_random_cpx)
677688
def test_FFT2D_random_complex(par):
689+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
690+
pytest.skip("mkl_fft not supported on macOS")
678691
np.random.seed(5)
679692
if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"):
680693
shape = par["shape"]
@@ -756,6 +769,8 @@ def test_FFT2D_random_complex(par):
756769

757770
@pytest.mark.parametrize("par", pars_fftnd_random_real)
758771
def test_FFTND_random_real(par):
772+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
773+
pytest.skip("mkl_fft not supported on macOS")
759774
np.random.seed(5)
760775
if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"):
761776
shape = par["shape"]
@@ -817,6 +832,8 @@ def test_FFTND_random_real(par):
817832

818833
@pytest.mark.parametrize("par", pars_fftnd_random_cpx)
819834
def test_FFTND_random_complex(par):
835+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
836+
pytest.skip("mkl_fft not supported on macOS")
820837
np.random.seed(5)
821838
shape = par["shape"]
822839
dtype, decimal = par["dtype_precision"]
@@ -893,6 +910,8 @@ def test_FFTND_random_complex(par):
893910

894911
@pytest.mark.parametrize("par", pars_fft2dnd_small_cpx)
895912
def test_FFT2D_small_complex(par):
913+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
914+
pytest.skip("mkl_fft not supported on macOS")
896915
np.random.seed(5)
897916
dtype, decimal = par["dtype_precision"]
898917
norm = par["norm"]
@@ -943,6 +962,8 @@ def test_FFT2D_small_complex(par):
943962

944963
@pytest.mark.parametrize("par", pars_fft2dnd_small_cpx)
945964
def test_FFTND_small_complex(par):
965+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
966+
pytest.skip("mkl_fft not supported on macOS")
946967
np.random.seed(5)
947968
dtype, decimal = par["dtype_precision"]
948969
norm = par["norm"]
@@ -1018,6 +1039,8 @@ def test_FFTND_small_complex(par):
10181039
],
10191040
)
10201041
def test_FFT_1dsignal(par):
1042+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
1043+
pytest.skip("mkl_fft not supported on macOS")
10211044
np.random.seed(5)
10221045
"""Dot-test and inversion for FFT operator for 1d signal"""
10231046
decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8
@@ -1135,6 +1158,8 @@ def test_FFT_2dsignal(par):
11351158
"""Dot-test and inversion for fft operator for 2d signal
11361159
(fft on single dimension)
11371160
"""
1161+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
1162+
pytest.skip("mkl_fft not supported on macOS")
11381163
np.random.seed(5)
11391164
decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8
11401165

@@ -1350,6 +1375,8 @@ def test_FFT_3dsignal(par):
13501375
"""Dot-test and inversion for fft operator for 3d signal
13511376
(fft on single dimension)
13521377
"""
1378+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
1379+
pytest.skip("mkl_fft not supported on macOS")
13531380
np.random.seed(5)
13541381
decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8
13551382

@@ -1576,6 +1603,8 @@ def test_FFT_3dsignal(par):
15761603
)
15771604
def test_FFT2D(par):
15781605
"""Dot-test and inversion for FFT2D operator for 2d signal"""
1606+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
1607+
pytest.skip("mkl_fft not supported on macOS")
15791608
np.random.seed(5)
15801609
decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8
15811610

@@ -1711,6 +1740,8 @@ def test_FFT2D(par):
17111740
)
17121741
def test_FFT3D(par):
17131742
"""Dot-test and inversion for FFTND operator for 3d signal"""
1743+
if par["engine"] == "mkl_fft" and sys.platform == "darwin":
1744+
pytest.skip("mkl_fft not supported on macOS")
17141745
np.random.seed(5)
17151746
decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8
17161747

0 commit comments

Comments
 (0)