From 37b73bb99ef2b3f8740f82cafa633bc4d9c40636 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 22 Dec 2025 14:05:19 -0500 Subject: [PATCH 1/2] Fix #1417: Fix test for Numpy 2.4.0 --- cuda_core/tests/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/tests/test_utils.py b/cuda_core/tests/test_utils.py index c778a9e493..107852d623 100644 --- a/cuda_core/tests/test_utils.py +++ b/cuda_core/tests/test_utils.py @@ -96,7 +96,7 @@ def _check_view(self, view, in_arr): assert view.size == in_arr.size strides_in_counts = convert_strides_to_counts(in_arr.strides, in_arr.dtype.itemsize) if in_arr.flags.c_contiguous: - assert view.strides is None + assert view.strides is None or view.strides == strides_in_counts else: assert view.strides == strides_in_counts assert view.dtype == in_arr.dtype From 0b734fa5b997dab3e65aab8106ae3b1107780f3f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 22 Dec 2025 14:09:29 -0500 Subject: [PATCH 2/2] Slightly improve logic --- cuda_core/tests/test_utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cuda_core/tests/test_utils.py b/cuda_core/tests/test_utils.py index 107852d623..a9ed0566be 100644 --- a/cuda_core/tests/test_utils.py +++ b/cuda_core/tests/test_utils.py @@ -95,10 +95,7 @@ def _check_view(self, view, in_arr): assert view.shape == in_arr.shape assert view.size == in_arr.size strides_in_counts = convert_strides_to_counts(in_arr.strides, in_arr.dtype.itemsize) - if in_arr.flags.c_contiguous: - assert view.strides is None or view.strides == strides_in_counts - else: - assert view.strides == strides_in_counts + assert (in_arr.flags.c_contiguous and view.strides is None) or view.strides == strides_in_counts assert view.dtype == in_arr.dtype assert view.device_id == -1 assert view.is_device_accessible is False