Commit 0f4f61e
committed
Added property parent_device
This returns None for root devices, but returns a SyclDevice for
a sub-device.
Added cpdef method equals, and Python method __eq__
```
Python 3.7.9 (default, Mar 10 2021, 05:18:00)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import dpctl
In [2]: cpu_device = dpctl.SyclDevice("cpu")
In [3]: cpu_device == cpu_device
Out[3]: True
In [4]: cpu_device2 = dpctl.SyclDevice("cpu")
In [5]: cpu_device == cpu_device2
Out[5]: True
In [6]: [d1, d2, d3 ] =cpu_device.create_sub_devices(partition=4)
In [7]: d1.parent_device == cpu_device
Out[7]: True
In [8]: d2.parent_device == cpu_device
Out[8]: True
In [9]: d3.parent_device == cpu_device
Out[9]: True
```1 parent f10dc20 commit 0f4f61e
2 files changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
714 | 716 | | |
715 | 717 | | |
716 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
0 commit comments