Skip to content

Commit 53bebfd

Browse files
committed
Update tests to work without fp64 support
1 parent 0081f4c commit 53bebfd

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ def test_strides_is_given_but_order_is_invalid(self):
108108
def test_order(self):
109109
shape = (2, 3, 4)
110110
a = cupy.ndarray(shape, order="F")
111-
a_cpu = numpy.ndarray(shape, order="F")
111+
a_cpu = numpy.ndarray(shape, order="F", dtype=a.dtype)
112112
assert a.strides == a_cpu.strides
113113
assert a.flags.f_contiguous
114114
assert not a.flags.c_contiguous
115115

116116
def test_order_none(self):
117117
shape = (2, 3, 4)
118118
a = cupy.ndarray(shape, order=None)
119-
a_cpu = numpy.ndarray(shape, order=None)
119+
a_cpu = numpy.ndarray(shape, order=None, dtype=a.dtype)
120120
assert a.flags.c_contiguous == a_cpu.flags.c_contiguous
121121
assert a.flags.f_contiguous == a_cpu.flags.f_contiguous
122122
assert a.strides == a_cpu.strides

dpnp/tests/third_party/cupy/creation_tests/test_basic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ def test_ones_like_subok(self):
270270
],
271271
)
272272
def test_ndarray_strides(self, shape, strides):
273-
a = cupy.ndarray(shape, strides=strides, dtype="float64")
273+
a = cupy.ndarray(
274+
shape, strides=strides, dtype=cupy.default_float_type()
275+
)
274276
assert cupy.byte_bounds(a)[0] == a.data.ptr
275277
assert cupy.byte_bounds(a)[1] - a.data.ptr <= a.data.size
276278

dpnp/tests/third_party/cupy/creation_tests/test_from_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_array_from_nested_list_of_numpy(
131131
@testing.for_orders("CFAK", name="dst_order")
132132
@testing.for_all_dtypes_combination(names=("dtype1", "dtype2"))
133133
@testing.numpy_cupy_array_equal(
134-
type_check=has_support_aspect64(), strides_check=True
134+
type_check=has_support_aspect64(), strides_check=has_support_aspect64()
135135
)
136136
def test_array_from_list_of_cupy(
137137
self, xp, dtype1, dtype2, src_order, dst_order

0 commit comments

Comments
 (0)