Skip to content

Fix incorrect tests in test_usm_ndarray_dlpack #1982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dpctl/tests/test_usm_ndarray_dlpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_dlpack_device(usm_type, all_root_devices):
assert type(dev) is tuple
assert len(dev) == 2
assert dev[0] == device_oneAPI
assert sycl_dev == all_root_devices[dev[1]]
assert dev[1] == sycl_dev.get_device_id()


def test_dlpack_exporter(typestr, usm_type, all_root_devices):
Expand Down Expand Up @@ -834,15 +834,15 @@ def test_sycl_device_to_dldevice(all_root_devices):
assert type(dev) is tuple
assert len(dev) == 2
assert dev[0] == device_oneAPI
assert dev[1] == all_root_devices.index(sycl_dev)
assert dev[1] == sycl_dev.get_device_id()


def test_dldevice_to_sycl_device(all_root_devices):
for sycl_dev in all_root_devices:
dldev = dpt.empty(0, device=sycl_dev).__dlpack_device__()
dev = dpt.dldevice_to_sycl_device(dldev)
assert type(dev) is dpctl.SyclDevice
assert dev == all_root_devices[dldev[1]]
assert dev.get_device_id() == sycl_dev.get_device_id()


def test_dldevice_conversion_arg_validation():
Expand Down
Loading