Skip to content

Commit cead9a7

Browse files
Merge branch 'master' into correlate_fft
2 parents ad361dd + 2ac196c commit cead9a7

File tree

8 files changed

+56
-24
lines changed

8 files changed

+56
-24
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
181181
# https://github.com/marketplace/actions/doxygen-action
182182
- name: Build backend docs
183-
uses: mattnotmitt/doxygen-action@cbe72c8e402e8a3faa1f0b247ef90aa6c8e4ce74 # v1.9.8
183+
uses: mattnotmitt/doxygen-action@b84fe17600245bb5db3d6c247cc274ea98c15a3b # v1.12
184184
with:
185185
working-directory: 'dpnp/backend/doc'
186186

@@ -266,6 +266,7 @@ jobs:
266266
- name: Modify the comment with URL to official documentation
267267
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
268268
with:
269+
message-id: url_to_docs
269270
find: |
270271
View rendered docs @.+
271272
replace: |

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
71+
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
7272
with:
7373
sarif_file: results.sarif

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030

3131
- name: Set up python
32-
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
32+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
3333
with:
3434
python-version: '3.13'
3535

dpnp/tests/third_party/cupy/core_tests/test_nep50_examples.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pytest
33

44
import dpnp as cp
5+
from dpnp.tests.helper import has_support_aspect64
56
from dpnp.tests.third_party.cupy import testing
67

78
# TODO: remove once all dtype aliases added
@@ -15,8 +16,6 @@
1516
"uint8(1) + 2",
1617
"array([1], uint8) + int64(1)",
1718
"array([1], uint8) + array(1, int64)",
18-
"array([1.], float32) + float64(1.)",
19-
"array([1.], float32) + array(1., float64)",
2019
"array([1], uint8) + 1",
2120
"array([1], uint8) + 200",
2221
"array([100], uint8) + 200",
@@ -25,7 +24,6 @@
2524
"uint8(100) + 200",
2625
"float32(1) + 3e100",
2726
"array([1.0], float32) + 1e-14 == 1.0",
28-
"array([0.1], float32) == float64(0.1)",
2927
"array(1.0, float32) + 1e-14 == 1.0",
3028
"array([1.], float32) + 3",
3129
"array([1.], float32) + int64(3)",
@@ -42,25 +40,34 @@
4240
"1.0 + array([1, 2, 3], int8)",
4341
"array([1], float32) + 1j",
4442
]
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+
]
4549

4650

4751
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
4852
@testing.with_requires("numpy>=2.0")
4953
@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+
)
5157
def test_nep50_examples(xp, example):
5258
dct = {
5359
"array": xp.array,
5460
"uint8": xp.uint8,
5561
"int64": xp.int64,
5662
"float32": xp.float32,
57-
"float64": xp.float64,
5863
"int16": xp.int16,
5964
"bool_": xp.bool_,
6065
"int32": xp.int32,
6166
"complex64": xp.complex64,
6267
"int8": xp.int8,
6368
}
69+
if has_support_aspect64():
70+
dct["float64"] = xp.float64
6471

6572
if isinstance(example, tuple):
6673
example, mesg = example

dpnp/tests/third_party/cupy/linalg_tests/test_product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class TestLinalgCrossProduct(unittest.TestCase):
172172

173173
@testing.with_requires("numpy>=2.0")
174174
@testing.for_all_dtypes_combination(["dtype_a", "dtype_b"])
175-
@testing.numpy_cupy_allclose()
175+
@testing.numpy_cupy_allclose(type_check=has_support_aspect64())
176176
def test_cross(self, xp, dtype_a, dtype_b):
177177
if dtype_a == dtype_b == numpy.bool_:
178178
# cross does not support bool-bool inputs.

dpnp/tests/third_party/cupy/math_tests/test_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def test_fabs(self, xp, dtype):
198198

199199
@testing.with_requires("numpy>=2.0")
200200
@testing.for_all_dtypes(no_complex=True)
201-
@testing.numpy_cupy_allclose(atol=1e-5)
201+
@testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64())
202202
def test_fabs_negative(self, xp, dtype):
203203
if numpy.issubdtype(dtype, numpy.unsignedinteger):
204204
pytest.skip("trying to set negative value to unsigned integer")

dpnp/tests/third_party/cupy/math_tests/test_sumprod.py

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,51 +1162,75 @@ def test_ediff1d_ed2(self, xp, dtype):
11621162
class TestTrapezoid:
11631163

11641164
@testing.for_all_dtypes()
1165-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1165+
@testing.numpy_cupy_allclose(
1166+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1167+
type_check=has_support_aspect64(),
1168+
)
11661169
def test_trapz_1dim(self, xp, dtype):
11671170
a = testing.shaped_arange((5,), xp, dtype)
11681171
return xp.trapezoid(a)
11691172

11701173
@testing.for_all_dtypes()
1171-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1174+
@testing.numpy_cupy_allclose(
1175+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1176+
type_check=has_support_aspect64(),
1177+
)
11721178
def test_trapz_1dim_with_x(self, xp, dtype):
11731179
a = testing.shaped_arange((5,), xp, dtype)
11741180
x = testing.shaped_arange((5,), xp, dtype)
11751181
return xp.trapezoid(a, x=x)
11761182

11771183
@testing.for_all_dtypes()
1178-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1184+
@testing.numpy_cupy_allclose(
1185+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1186+
type_check=has_support_aspect64(),
1187+
)
11791188
def test_trapz_1dim_with_dx(self, xp, dtype):
11801189
a = testing.shaped_arange((5,), xp, dtype)
11811190
return xp.trapezoid(a, dx=0.1)
11821191

11831192
@testing.for_all_dtypes()
1184-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1193+
@testing.numpy_cupy_allclose(
1194+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1195+
type_check=has_support_aspect64(),
1196+
)
11851197
def test_trapz_2dim_without_axis(self, xp, dtype):
11861198
a = testing.shaped_arange((4, 5), xp, dtype)
11871199
return xp.trapezoid(a)
11881200

11891201
@testing.for_all_dtypes()
1190-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1202+
@testing.numpy_cupy_allclose(
1203+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1204+
type_check=has_support_aspect64(),
1205+
)
11911206
def test_trapz_2dim_with_axis(self, xp, dtype):
11921207
a = testing.shaped_arange((4, 5), xp, dtype)
11931208
return xp.trapezoid(a, axis=-2)
11941209

11951210
@testing.for_all_dtypes()
1196-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1211+
@testing.numpy_cupy_allclose(
1212+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1213+
type_check=has_support_aspect64(),
1214+
)
11971215
def test_trapz_2dim_with_x_and_axis(self, xp, dtype):
11981216
a = testing.shaped_arange((4, 5), xp, dtype)
11991217
x = testing.shaped_arange((5,), xp, dtype)
12001218
return xp.trapezoid(a, x=x, axis=1)
12011219

12021220
@testing.for_all_dtypes()
1203-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1221+
@testing.numpy_cupy_allclose(
1222+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1223+
type_check=has_support_aspect64(),
1224+
)
12041225
def test_trapz_2dim_with_dx_and_axis(self, xp, dtype):
12051226
a = testing.shaped_arange((4, 5), xp, dtype)
12061227
return xp.trapezoid(a, dx=0.1, axis=1)
12071228

12081229
@testing.for_all_dtypes()
1209-
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-1, "default": 1e-7})
1230+
@testing.numpy_cupy_allclose(
1231+
rtol={numpy.float16: 1e-1, "default": 1e-7},
1232+
type_check=has_support_aspect64(),
1233+
)
12101234
def test_trapz_1dim_with_x_and_dx(self, xp, dtype):
12111235
a = testing.shaped_arange((5,), xp, dtype)
12121236
x = testing.shaped_arange((5,), xp, dtype)

dpnp/tests/third_party/cupy/testing/_loops.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,12 @@ def numpy_cupy_allclose(
583583
# When `type_check` is `False`, cupy result and numpy result may have
584584
# different dtypes so we can not determine the dtype to use from the
585585
# tolerance associations.
586-
if not type_check:
587-
if isinstance(rtol, dict) or isinstance(atol, dict):
588-
raise TypeError(
589-
"When `type_check` is `False`, `rtol` and `atol` "
590-
"must be supplied as float."
591-
)
586+
# if not type_check:
587+
# if isinstance(rtol, dict) or isinstance(atol, dict):
588+
# raise TypeError(
589+
# "When `type_check` is `False`, `rtol` and `atol` "
590+
# "must be supplied as float."
591+
# )
592592

593593
def check_func(c, n):
594594
rtol1, atol1 = _resolve_tolerance(type_check, c, rtol, atol)

0 commit comments

Comments
 (0)