Skip to content

Commit 88d11b3

Browse files
committed
unmute tests
1 parent d1aa4c8 commit 88d11b3

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

tests/test_fft.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@
1313
get_all_dtypes,
1414
get_complex_dtypes,
1515
get_float_dtypes,
16-
is_cpu_device,
1716
)
1817

19-
# aspects of default device:
20-
_def_device = dpctl.SyclQueue().sycl_device
21-
_def_dev_has_fp64 = _def_device.has_aspect_fp64
22-
is_gpu_with_fp64 = not is_cpu_device() and _def_dev_has_fp64
23-
2418

2519
# TODO: `assert_dtype_allclose` calls in this file have `check_only_type_kind=True`
2620
# since stock NumPy is currently used in public CI for code coverege which
@@ -498,13 +492,13 @@ def test_fft_1D(self, dtype, n, norm):
498492
# but dpnp return float32 if input is float32
499493
assert_dtype_allclose(result, expected, check_only_type_kind=True)
500494

501-
@pytest.mark.skipif(is_gpu_with_fp64, reason="MKLD17702")
502495
@pytest.mark.parametrize("dtype", get_complex_dtypes())
503496
@pytest.mark.parametrize("n", [None, 5, 20])
504497
@pytest.mark.parametrize("norm", ["forward", "backward", "ortho"])
505498
def test_fft_1D_complex(self, dtype, n, norm):
506499
x = dpnp.linspace(-1, 1, 11)
507500
a = dpnp.sin(x) + 1j * dpnp.cos(x)
501+
a[0].imag = 0 # input should be complex Hermitian
508502
a = dpnp.asarray(a, dtype=dtype)
509503
a_np = dpnp.asnumpy(a)
510504

@@ -525,29 +519,37 @@ def test_fft_1D_on_2D_array(self, dtype, n, axis, norm, order):
525519
expected = numpy.fft.irfft(a_np, n=n, axis=axis, norm=norm)
526520
assert_dtype_allclose(result, expected, check_only_type_kind=True)
527521

528-
@pytest.mark.skipif(is_gpu_with_fp64, reason="MKLD17702")
529522
@pytest.mark.parametrize("dtype", get_complex_dtypes())
530523
@pytest.mark.parametrize("n", [None, 5, 8])
531524
@pytest.mark.parametrize("axis", [0, 1, 2])
532525
@pytest.mark.parametrize("norm", ["forward", "backward", "ortho"])
533526
@pytest.mark.parametrize("order", ["C", "F"])
534527
def test_fft_1D_on_3D_array(self, dtype, n, axis, norm, order):
535-
x1 = numpy.random.uniform(-10, 10, 24)
536-
x2 = numpy.random.uniform(-10, 10, 24)
528+
x1 = numpy.random.uniform(-10, 10, 36)
529+
x2 = numpy.random.uniform(-10, 10, 36)
537530
a_np = numpy.array(x1 + 1j * x2, dtype=dtype).reshape(
538-
2, 3, 4, order=order
531+
3, 3, 4, order=order
539532
)
533+
# each 1-D array of input should be complex Hermitian
534+
a_np[0].imag = 0
535+
a_np[:, 0, :].imag = 0
536+
a_np[..., 0].imag = 0
537+
a_np[..., -1].imag = 0 # Nyquist mode for 3rd dimension
538+
539+
a_np = numpy.array(x1, dtype=dtype).reshape(
540+
2, 3, 4, order=order
541+
) # input should be complex Hermitian
540542
a = dpnp.asarray(a_np)
541543

542544
result = dpnp.fft.irfft(a, n=n, axis=axis, norm=norm)
543545
expected = numpy.fft.irfft(a_np, n=n, axis=axis, norm=norm)
544546
assert_dtype_allclose(result, expected, check_only_type_kind=True)
545547

546-
@pytest.mark.skipif(is_gpu_with_fp64, reason="MKLD17702")
547548
@pytest.mark.parametrize("n", [None, 5, 20])
548549
def test_fft_usm_ndarray(self, n):
549550
x = dpt.linspace(-1, 1, 11)
550551
a = dpt.sin(x) + 1j * dpt.cos(x)
552+
a[0] = dpt.sin(x[0]) # input should be complex Hermitian
551553
a_usm = dpt.asarray(a, dtype=dpt.complex64)
552554
a_np = dpt.asnumpy(a_usm)
553555
out_shape = n if n is not None else 2 * (a_usm.shape[0] - 1)
@@ -558,13 +560,13 @@ def test_fft_usm_ndarray(self, n):
558560
expected = numpy.fft.irfft(a_np, n=n)
559561
assert_dtype_allclose(result, expected, check_only_type_kind=True)
560562

561-
@pytest.mark.skipif(is_gpu_with_fp64, reason="MKLD17702")
562563
@pytest.mark.parametrize("dtype", get_complex_dtypes())
563564
@pytest.mark.parametrize("n", [None, 5, 20])
564565
@pytest.mark.parametrize("norm", ["forward", "backward", "ortho"])
565566
def test_fft_1D_out(self, dtype, n, norm):
566567
x = dpnp.linspace(-1, 1, 11)
567568
a = dpnp.sin(x) + 1j * dpnp.cos(x)
569+
a[0].imag = 0 # input should be complex Hermitian
568570
a = dpnp.asarray(a, dtype=dtype)
569571
a_np = dpnp.asnumpy(a)
570572

tests/test_umath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def test_large_values(self, dtype):
313313
assert_dtype_allclose(result, expected)
314314

315315

316-
class TestLogaddexp:
316+
class TestLogAddExp:
317317
@pytest.mark.parametrize("dtype", get_all_dtypes(no_complex=True))
318318
def test_logaddexp(self, dtype):
319319
np_array1, np_array2, expected = _get_numpy_arrays_2in_1out(

0 commit comments

Comments
 (0)