Xfail some conditions of signal tests
@@ -5,6 +5,7 @@ import pytest
import numpy as np
import cupy
+from cupy.cuda import runtime
from cupy import testing
import cupyx.scipy.signal
@@ -60,22 +61,33 @@ class TestFFTConvolve(unittest.TestCase):
tols = {np.float32: 1e-3, np.complex64: 1e-3,
np.float16: 1e-3, 'default': 1e-8}
+ def _hip_skip_invalid_condition(self):
+ invalid_condition = [('full', 4), ('full', 5), ('full', 10),
+ ('same', 3), ('same', 4), ('same', 5), ('same', 10),
+ ('valid', 10)]
+ if (runtime.is_hip and self.size1 == (3, 4, 10)
+ and (self.mode, self.size2) in invalid_condition):
+ pytest.xfail('ROCm/HIP may have a bug')
+
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(atol=tols, rtol=tols, scipy_name='scp',
accept_error=ValueError)
def test_fftconvolve(self, xp, scp, dtype):
+ self._hip_skip_invalid_condition()
return self._filter('fftconvolve', dtype, xp, scp)
@testing.for_all_dtypes(no_bool=True)
@testing.numpy_cupy_allclose(atol=tols, rtol=tols, scipy_name='scp',
accept_error=ValueError)
def test_convolve_fft(self, xp, scp, dtype):
+ self._hip_skip_invalid_condition()
return self._filter('convolve', dtype, xp, scp, method='fft')
@testing.for_all_dtypes(no_bool=True)
@testing.numpy_cupy_allclose(atol=tols, rtol=tols, scipy_name='scp',
accept_error=ValueError)
def test_correlate_fft(self, xp, scp, dtype):
+ self._hip_skip_invalid_condition()
return self._filter('correlate', dtype, xp, scp, method='fft')
@@ -94,6 +106,8 @@ class TestOAConvolve(unittest.TestCase):
@testing.numpy_cupy_allclose(atol=tols, rtol=tols, scipy_name='scp',
accept_error=ValueError)
def test_oaconvolve(self, xp, scp, dtype):
+ if runtime.is_hip and self.size2 in [5, None]:
+ pytest.xfail('ROCm/HIP may have a bug')
in1 = testing.shaped_random(self.size1, xp, dtype)
shape2 = self.size1 if self.size2 is None else (self.size2,)*in1.ndim
in2 = testing.shaped_random(shape2, xp, dtype)
