@@ -62,7 +62,7 @@ def test_array_from_numpy_broad_cast(self, xp, dtype, order):
6262 @testing .for_orders ("CFAK" , name = "src_order" )
6363 @testing .for_orders ("CFAK" , name = "dst_order" )
6464 @testing .for_all_dtypes ()
65- @testing .numpy_cupy_array_equal ()
65+ @testing .numpy_cupy_array_equal (strides_check = True )
6666 def test_array_from_list_of_numpy (self , xp , dtype , src_order , dst_order ):
6767 # compares numpy.array(<list of numpy.ndarray>) with
6868 # cupy.array(<list of numpy.ndarray>)
@@ -75,7 +75,7 @@ def test_array_from_list_of_numpy(self, xp, dtype, src_order, dst_order):
7575 @testing .for_orders ("CFAK" , name = "src_order" )
7676 @testing .for_orders ("CFAK" , name = "dst_order" )
7777 @testing .for_all_dtypes ()
78- @testing .numpy_cupy_array_equal ()
78+ @testing .numpy_cupy_array_equal (strides_check = True )
7979 def test_array_from_list_of_numpy_view (
8080 self , xp , dtype , src_order , dst_order
8181 ):
@@ -93,7 +93,7 @@ def test_array_from_list_of_numpy_view(
9393
9494 @testing .for_orders ("CFAK" )
9595 @testing .for_all_dtypes ()
96- @testing .numpy_cupy_array_equal ()
96+ @testing .numpy_cupy_array_equal (strides_check = True )
9797 def test_array_from_list_of_numpy_scalar (self , xp , dtype , order ):
9898 # compares numpy.array(<list of numpy.ndarray>) with
9999 # cupy.array(<list of numpy.ndarray>)
@@ -103,7 +103,7 @@ def test_array_from_list_of_numpy_scalar(self, xp, dtype, order):
103103 @testing .for_orders ("CFAK" , name = "src_order" )
104104 @testing .for_orders ("CFAK" , name = "dst_order" )
105105 @testing .for_all_dtypes ()
106- @testing .numpy_cupy_array_equal ()
106+ @testing .numpy_cupy_array_equal (strides_check = True )
107107 def test_array_from_nested_list_of_numpy (
108108 self , xp , dtype , src_order , dst_order
109109 ):
@@ -118,7 +118,9 @@ def test_array_from_nested_list_of_numpy(
118118 @testing .for_orders ("CFAK" , name = "src_order" )
119119 @testing .for_orders ("CFAK" , name = "dst_order" )
120120 @testing .for_all_dtypes_combination (names = ("dtype1" , "dtype2" ))
121- @testing .numpy_cupy_array_equal (type_check = has_support_aspect64 ())
121+ @testing .numpy_cupy_array_equal (
122+ type_check = has_support_aspect64 (), strides_check = True
123+ )
122124 def test_array_from_list_of_cupy (
123125 self , xp , dtype1 , dtype2 , src_order , dst_order
124126 ):
@@ -133,7 +135,7 @@ def test_array_from_list_of_cupy(
133135 @testing .for_orders ("CFAK" , name = "src_order" )
134136 @testing .for_orders ("CFAK" , name = "dst_order" )
135137 @testing .for_all_dtypes ()
136- @testing .numpy_cupy_array_equal ()
138+ @testing .numpy_cupy_array_equal (strides_check = True )
137139 def test_array_from_list_of_cupy_view (
138140 self , xp , dtype , src_order , dst_order
139141 ):
@@ -152,7 +154,7 @@ def test_array_from_list_of_cupy_view(
152154 @testing .for_orders ("CFAK" , name = "src_order" )
153155 @testing .for_orders ("CFAK" , name = "dst_order" )
154156 @testing .for_all_dtypes ()
155- @testing .numpy_cupy_array_equal ()
157+ @testing .numpy_cupy_array_equal (strides_check = True )
156158 def test_array_from_nested_list_of_cupy (
157159 self , xp , dtype , src_order , dst_order
158160 ):
@@ -166,7 +168,7 @@ def test_array_from_nested_list_of_cupy(
166168
167169 @testing .for_orders ("CFAK" )
168170 @testing .for_all_dtypes ()
169- @testing .numpy_cupy_array_equal ()
171+ @testing .numpy_cupy_array_equal (strides_check = True )
170172 def test_array_from_list_of_cupy_scalar (self , xp , dtype , order ):
171173 # compares numpy.array(<list of numpy.ndarray>) with
172174 # cupy.array(<list of cupy.ndarray>)
@@ -240,7 +242,7 @@ def test_array_copy_with_dtype_being_none(self, xp, order):
240242 @testing .for_orders ("CFAK" , name = "dst_order" )
241243 @testing .for_all_dtypes (name = "dtype1" , no_complex = True )
242244 @testing .for_all_dtypes (name = "dtype2" )
243- @testing .numpy_cupy_array_equal ()
245+ @testing .numpy_cupy_array_equal (strides_check = True )
244246 def test_array_copy_list_of_numpy_with_dtype (
245247 self , xp , dtype1 , dtype2 , src_order , dst_order
246248 ):
@@ -256,7 +258,7 @@ def test_array_copy_list_of_numpy_with_dtype(
256258 @testing .for_orders ("CFAK" , name = "dst_order" )
257259 @testing .for_all_dtypes (name = "dtype1" , no_complex = True )
258260 @testing .for_all_dtypes (name = "dtype2" )
259- @testing .numpy_cupy_array_equal ()
261+ @testing .numpy_cupy_array_equal (strides_check = True )
260262 def test_array_copy_list_of_numpy_with_dtype_char (
261263 self , xp , dtype1 , dtype2 , src_order , dst_order
262264 ):
@@ -272,7 +274,7 @@ def test_array_copy_list_of_numpy_with_dtype_char(
272274 @testing .for_orders ("CFAK" , name = "dst_order" )
273275 @testing .for_all_dtypes (name = "dtype1" , no_complex = True )
274276 @testing .for_all_dtypes (name = "dtype2" )
275- @testing .numpy_cupy_array_equal ()
277+ @testing .numpy_cupy_array_equal (strides_check = True )
276278 def test_array_copy_list_of_cupy_with_dtype (
277279 self , xp , dtype1 , dtype2 , src_order , dst_order
278280 ):
@@ -288,7 +290,7 @@ def test_array_copy_list_of_cupy_with_dtype(
288290 @testing .for_orders ("CFAK" , name = "dst_order" )
289291 @testing .for_all_dtypes (name = "dtype1" , no_complex = True )
290292 @testing .for_all_dtypes (name = "dtype2" )
291- @testing .numpy_cupy_array_equal ()
293+ @testing .numpy_cupy_array_equal (strides_check = True )
292294 def test_array_copy_list_of_cupy_with_dtype_char (
293295 self , xp , dtype1 , dtype2 , src_order , dst_order
294296 ):
@@ -656,7 +658,7 @@ def test_with_strides(self, dtype):
656658 DummyObjectWithCudaArrayInterface (a , self .ver , self .strides )
657659 )
658660 assert a .strides == b .strides
659- assert a .nbytes == b .nbytes
661+ assert a .nbytes == b .data . mem . size
660662
661663 @testing .for_all_dtypes ()
662664 def test_with_zero_size_array (self , dtype ):
@@ -665,7 +667,8 @@ def test_with_zero_size_array(self, dtype):
665667 DummyObjectWithCudaArrayInterface (a , self .ver , self .strides )
666668 )
667669 assert a .strides == b .strides
668- assert a .nbytes == b .nbytes
670+ assert a .nbytes == b .data .mem .size
671+ assert a .data .ptr == 0
669672 assert a .size == 0
670673
671674 @testing .for_all_dtypes ()
@@ -724,7 +727,7 @@ def test_with_over_size_array(self):
724727 testing .assert_array_equal (a , b )
725728
726729
727- class DummyObjectWithCudaArrayInterface ( object ) :
730+ class DummyObjectWithCudaArrayInterface :
728731 def __init__ (self , a , ver , include_strides = False , mask = None , stream = None ):
729732 assert ver in tuple (range (max_cuda_array_interface_version + 1 ))
730733 self .a = None
@@ -834,7 +837,7 @@ def test_cupy_array(self, dtype):
834837 is_copied = not (
835838 (actual is a )
836839 or (self .xp is cupy )
837- and (a .get_array (). _pointer == actual .get_array (). _pointer )
840+ and (a .data . ptr == actual .data . ptr )
838841 )
839842 assert should_copy == is_copied
840843
0 commit comments