|
1 | 1 | import itertools |
2 | 2 | import os |
| 3 | +import sys |
3 | 4 |
|
4 | 5 | if int(os.environ.get("TEST_CUPY_PYLOPS", 0)): |
5 | 6 | import cupy as np |
@@ -322,6 +323,8 @@ def test_unknown_engine(par): |
322 | 323 |
|
323 | 324 | @pytest.mark.parametrize("par", pars_fft_small_real) |
324 | 325 | 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") |
325 | 328 | np.random.seed(5) |
326 | 329 |
|
327 | 330 | if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"): |
@@ -399,6 +402,8 @@ def test_FFT_small_real(par): |
399 | 402 | ) |
400 | 403 | @pytest.mark.parametrize("par", pars_fft_random_real) |
401 | 404 | 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") |
402 | 407 | np.random.seed(5) |
403 | 408 |
|
404 | 409 | shape = par["shape"] |
@@ -455,6 +460,8 @@ def test_FFT_random_real(par): |
455 | 460 |
|
456 | 461 | @pytest.mark.parametrize("par", pars_fft_small_cpx) |
457 | 462 | 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") |
458 | 465 | np.random.seed(5) |
459 | 466 | dtype, decimal = par["dtype_precision"] |
460 | 467 | norm = par["norm"] |
@@ -527,6 +534,8 @@ def test_FFT_small_complex(par): |
527 | 534 |
|
528 | 535 | @pytest.mark.parametrize("par", pars_fft_random_cpx) |
529 | 536 | 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") |
530 | 539 | np.random.seed(5) |
531 | 540 | if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"): |
532 | 541 | shape = par["shape"] |
@@ -614,6 +623,8 @@ def test_FFT_random_complex(par): |
614 | 623 | ) |
615 | 624 | @pytest.mark.parametrize("par", pars_fft2d_random_real) |
616 | 625 | 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") |
617 | 628 | np.random.seed(5) |
618 | 629 | if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"): |
619 | 630 | shape = par["shape"] |
@@ -675,6 +686,8 @@ def test_FFT2D_random_real(par): |
675 | 686 |
|
676 | 687 | @pytest.mark.parametrize("par", pars_fft2d_random_cpx) |
677 | 688 | 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") |
678 | 691 | np.random.seed(5) |
679 | 692 | if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"): |
680 | 693 | shape = par["shape"] |
@@ -756,6 +769,8 @@ def test_FFT2D_random_complex(par): |
756 | 769 |
|
757 | 770 | @pytest.mark.parametrize("par", pars_fftnd_random_real) |
758 | 771 | 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") |
759 | 774 | np.random.seed(5) |
760 | 775 | if backend == "numpy" or (backend == "cupy" and par["engine"] == "numpy"): |
761 | 776 | shape = par["shape"] |
@@ -817,6 +832,8 @@ def test_FFTND_random_real(par): |
817 | 832 |
|
818 | 833 | @pytest.mark.parametrize("par", pars_fftnd_random_cpx) |
819 | 834 | 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") |
820 | 837 | np.random.seed(5) |
821 | 838 | shape = par["shape"] |
822 | 839 | dtype, decimal = par["dtype_precision"] |
@@ -893,6 +910,8 @@ def test_FFTND_random_complex(par): |
893 | 910 |
|
894 | 911 | @pytest.mark.parametrize("par", pars_fft2dnd_small_cpx) |
895 | 912 | 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") |
896 | 915 | np.random.seed(5) |
897 | 916 | dtype, decimal = par["dtype_precision"] |
898 | 917 | norm = par["norm"] |
@@ -943,6 +962,8 @@ def test_FFT2D_small_complex(par): |
943 | 962 |
|
944 | 963 | @pytest.mark.parametrize("par", pars_fft2dnd_small_cpx) |
945 | 964 | 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") |
946 | 967 | np.random.seed(5) |
947 | 968 | dtype, decimal = par["dtype_precision"] |
948 | 969 | norm = par["norm"] |
@@ -1018,6 +1039,8 @@ def test_FFTND_small_complex(par): |
1018 | 1039 | ], |
1019 | 1040 | ) |
1020 | 1041 | def test_FFT_1dsignal(par): |
| 1042 | + if par["engine"] == "mkl_fft" and sys.platform == "darwin": |
| 1043 | + pytest.skip("mkl_fft not supported on macOS") |
1021 | 1044 | np.random.seed(5) |
1022 | 1045 | """Dot-test and inversion for FFT operator for 1d signal""" |
1023 | 1046 | decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8 |
@@ -1135,6 +1158,8 @@ def test_FFT_2dsignal(par): |
1135 | 1158 | """Dot-test and inversion for fft operator for 2d signal |
1136 | 1159 | (fft on single dimension) |
1137 | 1160 | """ |
| 1161 | + if par["engine"] == "mkl_fft" and sys.platform == "darwin": |
| 1162 | + pytest.skip("mkl_fft not supported on macOS") |
1138 | 1163 | np.random.seed(5) |
1139 | 1164 | decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8 |
1140 | 1165 |
|
@@ -1350,6 +1375,8 @@ def test_FFT_3dsignal(par): |
1350 | 1375 | """Dot-test and inversion for fft operator for 3d signal |
1351 | 1376 | (fft on single dimension) |
1352 | 1377 | """ |
| 1378 | + if par["engine"] == "mkl_fft" and sys.platform == "darwin": |
| 1379 | + pytest.skip("mkl_fft not supported on macOS") |
1353 | 1380 | np.random.seed(5) |
1354 | 1381 | decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8 |
1355 | 1382 |
|
@@ -1576,6 +1603,8 @@ def test_FFT_3dsignal(par): |
1576 | 1603 | ) |
1577 | 1604 | def test_FFT2D(par): |
1578 | 1605 | """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") |
1579 | 1608 | np.random.seed(5) |
1580 | 1609 | decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8 |
1581 | 1610 |
|
@@ -1711,6 +1740,8 @@ def test_FFT2D(par): |
1711 | 1740 | ) |
1712 | 1741 | def test_FFT3D(par): |
1713 | 1742 | """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") |
1714 | 1745 | np.random.seed(5) |
1715 | 1746 | decimal = 3 if np.real(np.ones(1, par["dtype"])).dtype == np.float32 else 8 |
1716 | 1747 |
|
|
0 commit comments