Skip to content

Commit ad67495

Browse files
committed
modify related tests to work without float64 support
1 parent a9d0346 commit ad67495

File tree

3 files changed

+13
-30
lines changed

3 files changed

+13
-30
lines changed

tests/skipped_tests_gpu_no_fp64.tbl

-26
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,6 @@ tests/test_umath.py::TestArctan2::test_invalid_shape[(2,2)]
497497

498498
tests/test_umath.py::TestSqrt::test_sqrt_complex[complex64]
499499

500-
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRound_param_0_{decimals=-2}::test_round_out
501-
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRound_param_1_{decimals=-1}::test_round_out
502-
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRound_param_2_{decimals=0}::test_round_out
503-
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRound_param_3_{decimals=1}::test_round_out
504-
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRound_param_4_{decimals=2}::test_round_out
505-
506500
tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_arange_no_dtype_float
507501
tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_linspace_array_start_stop
508502
tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_linspace_float_overflow
@@ -1189,26 +1183,6 @@ tests/third_party/cupy/math_tests/test_arithmetic.py::TestArithmeticBinary2_para
11891183
tests/third_party/cupy/math_tests/test_arithmetic.py::TestArithmeticBinary2_param_1824_{arg1=-2.0, arg2=array([-3, -2, -1, 1, 2, 3]), dtype=float64, name='fmod', use_dtype=True}::test_binary
11901184
tests/third_party/cupy/math_tests/test_arithmetic.py::TestArithmeticBinary2_param_1825_{arg1=-2.0, arg2=array([-3, -2, -1, 1, 2, 3]), dtype=float64, name='fmod', use_dtype=False}::test_binary
11911185

1192-
tests/third_party/cupy/math_tests/test_rounding.py::TestRound_param_0_{decimals=-2}::test_round_out
1193-
tests/third_party/cupy/math_tests/test_rounding.py::TestRound_param_1_{decimals=-1}::test_round_out
1194-
tests/third_party/cupy/math_tests/test_rounding.py::TestRound_param_2_{decimals=0}::test_round_out
1195-
tests/third_party/cupy/math_tests/test_rounding.py::TestRound_param_3_{decimals=1}::test_round_out
1196-
tests/third_party/cupy/math_tests/test_rounding.py::TestRound_param_4_{decimals=2}::test_round_out
1197-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_0_{decimals=-100}::test_round_large
1198-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_0_{decimals=-100}::test_round_small
1199-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_1_{decimals=-99}::test_round_large
1200-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_1_{decimals=-99}::test_round_small
1201-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_2_{decimals=-90}::test_round_large
1202-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_2_{decimals=-90}::test_round_small
1203-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_3_{decimals=0}::test_round_large
1204-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_3_{decimals=0}::test_round_small
1205-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_4_{decimals=90}::test_round_large
1206-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_4_{decimals=90}::test_round_small
1207-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_5_{decimals=99}::test_round_large
1208-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_5_{decimals=99}::test_round_small
1209-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_6_{decimals=100}::test_round_large
1210-
tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_6_{decimals=100}::test_round_small
1211-
12121186
tests/third_party/cupy/math_tests/test_explog.py::TestExplog::test_exp
12131187
tests/third_party/cupy/math_tests/test_explog.py::TestExplog::test_exp2
12141188
tests/third_party/cupy/math_tests/test_explog.py::TestExplog::test_expm1

tests/third_party/cupy/core_tests/test_ndarray_math.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55

66
import dpnp as cupy
7+
from tests.helper import has_support_aspect64
78
from tests.third_party.cupy import testing
89

910

@@ -34,7 +35,8 @@ def test_round(self, xp, dtype):
3435

3536
@testing.numpy_cupy_array_equal()
3637
def test_round_out(self, xp):
37-
a = testing.shaped_random(self.shape, xp, scale=100, dtype="d")
38+
dtype = "d" if has_support_aspect64() else "f"
39+
a = testing.shaped_random(self.shape, xp, scale=100, dtype=dtype)
3840
out = xp.empty_like(a)
3941
a.round(self.decimals, out)
4042
return out

tests/third_party/cupy/math_tests/test_rounding.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def test_round(self, xp, dtype):
103103

104104
@testing.numpy_cupy_array_equal()
105105
def test_round_out(self, xp):
106-
a = testing.shaped_random(self.shape, xp, scale=100, dtype="d")
106+
dtype = "d" if has_support_aspect64() else "f"
107+
a = testing.shaped_random(self.shape, xp, scale=100, dtype=dtype)
107108
out = xp.empty_like(a)
108109
xp.around(a, self.decimals, out)
109110
return out
@@ -120,13 +121,19 @@ def test_round_out(self, xp):
120121
class TestRoundExtreme(unittest.TestCase):
121122
shape = (20,)
122123

123-
@testing.for_dtypes([numpy.float64, numpy.complex128])
124+
dtype_ = (
125+
[numpy.float64, numpy.complex128]
126+
if has_support_aspect64()
127+
else [numpy.float32, numpy.complex64]
128+
)
129+
130+
@testing.for_dtypes(dtype_)
124131
@testing.numpy_cupy_allclose()
125132
def test_round_large(self, xp, dtype):
126133
a = testing.shaped_random(self.shape, xp, scale=1e100, dtype=dtype)
127134
return xp.around(a, self.decimals)
128135

129-
@testing.for_dtypes([numpy.float64, numpy.complex128])
136+
@testing.for_dtypes(dtype_)
130137
@testing.numpy_cupy_allclose()
131138
def test_round_small(self, xp, dtype):
132139
a = testing.shaped_random(self.shape, xp, scale=1e-100, dtype=dtype)

0 commit comments

Comments
 (0)