Skip to content

Commit da988f9

Browse files
author
Diptorup Deb
authored
Use default device for slicing test case instead of gpu device. (#460)
1 parent 6b16ee9 commit da988f9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

dpctl/tensor/_device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def create_device(cls, dev):
4040
Creates instance of Device from argument.
4141
4242
Args:
43-
device: None, :class:`.Device`, :class:`dpctl.SyclQueue`, or
44-
a :class:`dpctl.SyclDevice` corresponding to a root
45-
SYCL device.
43+
dev: None, :class:`.Device`, :class:`dpctl.SyclQueue`, or
44+
a :class:`dpctl.SyclDevice` corresponding to a root SYCL
45+
device.
4646
Raises:
4747
ValueError: if an instance of :class:`dpctl.SycDevice` corresponding
4848
to a sub-device was specified as the argument

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ def _to_numpy(usm_ary):
175175

176176
def test_slice_constructor_1d():
177177
Xh = np.arange(37, dtype="i4")
178-
Xusm = _from_numpy(Xh, device="gpu", usm_type="device")
178+
default_device = dpctl.select_default_device()
179+
Xusm = _from_numpy(Xh, device=default_device, usm_type="device")
179180
for ind in [
180181
slice(1, None, 2),
181182
slice(0, None, 3),
@@ -193,7 +194,8 @@ def test_slice_constructor_1d():
193194

194195
def test_slice_constructor_3d():
195196
Xh = np.empty((37, 24, 35), dtype="i4")
196-
Xusm = _from_numpy(Xh, device="gpu", usm_type="device")
197+
default_device = dpctl.select_default_device()
198+
Xusm = _from_numpy(Xh, device=default_device, usm_type="device")
197199
for ind in [
198200
slice(1, None, 2),
199201
slice(0, None, 3),

0 commit comments

Comments
 (0)