Skip to content

Commit 5179c06

Browse files
Update fft tests to run on CUDA
1 parent b217cc5 commit 5179c06

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

dpnp/tests/test_fft.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
get_all_dtypes,
1414
get_complex_dtypes,
1515
get_float_dtypes,
16+
is_cuda_device,
1617
)
1718

1819

@@ -470,6 +471,13 @@ def setup_method(self):
470471
@pytest.mark.parametrize("norm", ["forward", "backward", "ortho"])
471472
@pytest.mark.parametrize("order", ["C", "F"])
472473
def test_fftn(self, dtype, axes, norm, order):
474+
if is_cuda_device():
475+
if order == "C" and axes == (0, 1, 2):
476+
pass
477+
elif order == "F" and axes == (-1, -4, -2):
478+
pass
479+
else:
480+
pytest.skip("SAT-7587")
473481
x1 = numpy.random.uniform(-10, 10, 120)
474482
x2 = numpy.random.uniform(-10, 10, 120)
475483
a_np = numpy.array(x1 + 1j * x2, dtype=dtype).reshape(
@@ -512,6 +520,9 @@ def test_fftn_repeated_axes(self, axes):
512520
@pytest.mark.parametrize("axes", [(2, 3, 3, 2), (0, 0, 3, 3)])
513521
@pytest.mark.parametrize("s", [(5, 4, 3, 3), (7, 8, 10, 9)])
514522
def test_fftn_repeated_axes_with_s(self, axes, s):
523+
if is_cuda_device():
524+
if axes == (0, 0, 3, 3) and s == (7, 8, 10, 9):
525+
pytest.skip("SAT-7587")
515526
x1 = numpy.random.uniform(-10, 10, 120)
516527
x2 = numpy.random.uniform(-10, 10, 120)
517528
a_np = numpy.array(x1 + 1j * x2, dtype=numpy.complex64).reshape(
@@ -535,6 +546,11 @@ def test_fftn_repeated_axes_with_s(self, axes, s):
535546
@pytest.mark.parametrize("axes", [(0, 1, 2, 3), (1, 2, 1, 2), (2, 2, 2, 3)])
536547
@pytest.mark.parametrize("s", [(2, 3, 4, 5), (5, 4, 7, 8), (2, 5, 1, 2)])
537548
def test_fftn_out(self, axes, s):
549+
if is_cuda_device():
550+
if axes == (0, 1, 2, 3):
551+
pytest.skip("SAT-7587")
552+
elif s == (2, 5, 1, 2) and axes in [(1, 2, 1, 2), (2, 2, 2, 3)]:
553+
pytest.skip("SAT-7587")
538554
x1 = numpy.random.uniform(-10, 10, 120)
539555
x2 = numpy.random.uniform(-10, 10, 120)
540556
a_np = numpy.array(x1 + 1j * x2, dtype=numpy.complex64).reshape(
@@ -1141,6 +1157,9 @@ def test_rfftn_repeated_axes_with_s(self, axes, s):
11411157
@pytest.mark.parametrize("axes", [(0, 1, 2, 3), (1, 2, 1, 2), (2, 2, 2, 3)])
11421158
@pytest.mark.parametrize("s", [(2, 3, 4, 5), (5, 6, 7, 9), (2, 5, 1, 2)])
11431159
def test_rfftn_out(self, axes, s):
1160+
if is_cuda_device():
1161+
if axes == (0, 1, 2, 3) and s == (2, 5, 1, 2):
1162+
pytest.skip("SAT-7587")
11441163
x1 = numpy.random.uniform(-10, 10, 120)
11451164
a_np = numpy.array(x1, dtype=numpy.float32).reshape(2, 3, 4, 5)
11461165
a = dpnp.asarray(a_np)

dpnp/tests/third_party/cupy/fft_tests/test_fft.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
import dpnp as cupy
7-
from dpnp.tests.helper import has_support_aspect64
7+
from dpnp.tests.helper import has_support_aspect64, is_cuda_device
88
from dpnp.tests.third_party.cupy import testing
99

1010

@@ -162,6 +162,8 @@ class TestFft2:
162162
type_check=has_support_aspect64(),
163163
)
164164
def test_fft2(self, xp, dtype, order):
165+
if is_cuda_device() and self.shape == (2, 3, 4, 5):
166+
pytest.skip("SAT-7587")
165167
a = testing.shaped_random(self.shape, xp, dtype)
166168
if order == "F":
167169
a = xp.asfortranarray(a)
@@ -186,6 +188,8 @@ def test_fft2(self, xp, dtype, order):
186188
type_check=has_support_aspect64(),
187189
)
188190
def test_ifft2(self, xp, dtype, order):
191+
if is_cuda_device() and self.shape == (2, 3, 4, 5):
192+
pytest.skip("SAT-7587")
189193
a = testing.shaped_random(self.shape, xp, dtype)
190194
if order == "F":
191195
a = xp.asfortranarray(a)
@@ -249,6 +253,8 @@ class TestFftn:
249253
type_check=has_support_aspect64(),
250254
)
251255
def test_fftn(self, xp, dtype, order):
256+
if is_cuda_device() and self.shape == (2, 3, 4, 5):
257+
pytest.skip("SAT-7587")
252258
a = testing.shaped_random(self.shape, xp, dtype)
253259
if order == "F":
254260
a = xp.asfortranarray(a)
@@ -273,6 +279,8 @@ def test_fftn(self, xp, dtype, order):
273279
type_check=has_support_aspect64(),
274280
)
275281
def test_ifftn(self, xp, dtype, order):
282+
if is_cuda_device() and self.shape == (2, 3, 4, 5):
283+
pytest.skip("SAT-7587")
276284
a = testing.shaped_random(self.shape, xp, dtype)
277285
if order == "F":
278286
a = xp.asfortranarray(a)

0 commit comments

Comments
 (0)