x.__dlpack_device__() returns ID of the parent device#1560
x.__dlpack_device__() returns ID of the parent device#1560oleksandr-pavlyk merged 5 commits intomasterfrom
Conversation
It gives ID (position in `sycl::device::get_devices()`) for the root device that the array allocation device descends from for sub-devices, or ID of the allocation device is that device is a root device.
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
|
Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_20 ran successfully. |
|
Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_23 ran successfully. |
|
Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_24 ran successfully. |
|
Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_26 ran successfully. |
|
I have verified that this change allows one to share data allocated on the tile, if driver is used in legacy composite device-hierarchy. Newly added test passes for both default and legacy device-hierarchy modes. @ndgrigorian This PR is ready for final review. |
ndgrigorian
left a comment
There was a problem hiding this comment.
These changes LGTM, thank you @oleksandr-pavlyk !
Backport gh-1560 to 0.16.x maintenance branch
x.__dlpack_device__()returns ID of the parent device, if allocation device is not a root device.It gives ID (position in
sycl::device::get_devices()) for the root device that the array allocation device descends from for sub-devices, or ID of the allocation device is that device is a root device.This allows sharing through DLPack of allocation on sub-devices, as long as default platform context for the platform the device is from was used in allocation.