Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Add tests for dpctl.SyclPlatform.get_composite_devices
  • Loading branch information
ndgrigorian committed Mar 31, 2025
commit 9cb7b50ad71ccf6afb936c51c3a0fbbbe8875c26
3 changes: 2 additions & 1 deletion dpctl/tests/test_sycl_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ def test_get_component_devices_from_composite():
devices = dpctl.get_devices()
composite_devices = dpctl.get_composite_devices()
for Cd in composite_devices:
component_devices = Cd.component_devices
component_devices = Cd.component_devices()
for d in component_devices:
Comment thread
ndgrigorian marked this conversation as resolved.
# component devices are root devices
assert d in devices
17 changes: 17 additions & 0 deletions dpctl/tests/test_sycl_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,20 @@ def test_platform_get_devices_enum_device_type():
devices = p.get_devices(device_type=dty)
if len(devices):
assert (d.device_type == dty for d in devices)


def test_platform_get_composite_devices():
platforms = dpctl.get_platforms()
if platforms:
for p in platforms:
composite_devices = p.get_composite_devices()
if not composite_devices:
pass
devices = p.get_devices()
for Cd in composite_devices:
assert Cd.has_aspect_is_composite
component_devices = Cd.component_devices()
# all component devices are root devices
assert all(d in devices for d in component_devices)
else:
pytest.skip("No platforms available")