@@ -514,14 +514,14 @@ def test_copy(self, xp, dtype, order):
514514 a [1 ] = 1
515515 return b
516516
517- @pytest .mark .skip ("`device` argument isn't supported" )
518517 @testing .for_CF_orders ()
519518 @testing .for_all_dtypes ()
520519 def test_copy_multigpu (self , dtype , order ):
521- with cuda .Device (0 ):
522- src = cupy .random .uniform (- 1 , 1 , (2 , 3 )).astype (dtype )
523- with cuda .Device (1 ):
524- dst = cupy .copy (src , order )
520+ q1 = dpctl .SyclQueue ()
521+ q2 = dpctl .SyclQueue ()
522+
523+ src = cupy .random .uniform (- 1 , 1 , (2 , 3 ), device = q1 ).astype (dtype )
524+ dst = cupy .copy (src , order , device = q2 )
525525 testing .assert_allclose (src , dst , rtol = 0 , atol = 0 )
526526
527527 @testing .for_CF_orders ()
@@ -804,10 +804,13 @@ def test_cupy_array(self, dtype):
804804 assert a .shape == shape
805805
806806
807- # TODO: ndmin=3 is removed since it needs ndarray.base
808807@testing .parameterize (
809808 * testing .product (
810- {"ndmin" : [0 , 1 , 2 ], "copy" : [True , False , None ], "xp" : [numpy , cupy ]}
809+ {
810+ "ndmin" : [0 , 1 , 2 , 3 ],
811+ "copy" : [True , False , None ],
812+ "xp" : [numpy , cupy ],
813+ }
811814 )
812815)
813816class TestArrayCopy (unittest .TestCase ):
@@ -823,8 +826,8 @@ def test_cupy_array(self, dtype):
823826 # TODO(Kenta Oono): Better determination of copy.
824827 is_copied = not (
825828 (actual is a )
826- # or (actual.base is a )
827- # or (actual.base is a.base and a.base is not None )
829+ or (self . xp is cupy )
830+ and ( a . get_array (). _pointer == actual . get_array (). _pointer )
828831 )
829832 assert should_copy == is_copied
830833
0 commit comments