|
2 | 2 | import pytest |
3 | 3 |
|
4 | 4 | import dpnp as cp |
| 5 | +from dpnp.tests.helper import has_support_aspect64 |
5 | 6 | from dpnp.tests.third_party.cupy import testing |
6 | 7 |
|
7 | 8 | # TODO: remove once all dtype aliases added |
|
15 | 16 | "uint8(1) + 2", |
16 | 17 | "array([1], uint8) + int64(1)", |
17 | 18 | "array([1], uint8) + array(1, int64)", |
18 | | - "array([1.], float32) + float64(1.)", |
19 | | - "array([1.], float32) + array(1., float64)", |
20 | 19 | "array([1], uint8) + 1", |
21 | 20 | "array([1], uint8) + 200", |
22 | 21 | "array([100], uint8) + 200", |
|
25 | 24 | "uint8(100) + 200", |
26 | 25 | "float32(1) + 3e100", |
27 | 26 | "array([1.0], float32) + 1e-14 == 1.0", |
28 | | - "array([0.1], float32) == float64(0.1)", |
29 | 27 | "array(1.0, float32) + 1e-14 == 1.0", |
30 | 28 | "array([1.], float32) + 3", |
31 | 29 | "array([1.], float32) + int64(3)", |
|
42 | 40 | "1.0 + array([1, 2, 3], int8)", |
43 | 41 | "array([1], float32) + 1j", |
44 | 42 | ] |
| 43 | +if has_support_aspect64(): |
| 44 | + examples += [ |
| 45 | + "array([1.], float32) + float64(1.)", |
| 46 | + "array([1.], float32) + array(1., float64)", |
| 47 | + "array([0.1], float32) == float64(0.1)", |
| 48 | + ] |
45 | 49 |
|
46 | 50 |
|
47 | 51 | @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
48 | 52 | @testing.with_requires("numpy>=2.0") |
49 | 53 | @pytest.mark.parametrize("example", examples) |
50 | | -@testing.numpy_cupy_allclose(atol=1e-15, accept_error=OverflowError) |
| 54 | +@testing.numpy_cupy_allclose( |
| 55 | + atol=1e-15, accept_error=OverflowError, type_check=has_support_aspect64() |
| 56 | +) |
51 | 57 | def test_nep50_examples(xp, example): |
52 | 58 | dct = { |
53 | 59 | "array": xp.array, |
54 | 60 | "uint8": xp.uint8, |
55 | 61 | "int64": xp.int64, |
56 | 62 | "float32": xp.float32, |
57 | | - "float64": xp.float64, |
58 | 63 | "int16": xp.int16, |
59 | 64 | "bool_": xp.bool_, |
60 | 65 | "int32": xp.int32, |
61 | 66 | "complex64": xp.complex64, |
62 | 67 | "int8": xp.int8, |
63 | 68 | } |
| 69 | + if has_support_aspect64(): |
| 70 | + dct["float64"] = xp.float64 |
64 | 71 |
|
65 | 72 | if isinstance(example, tuple): |
66 | 73 | example, mesg = example |
|
0 commit comments