Commit e1189e5
committed
SyclEvent deleter no longer waits
Added _host_task_utils.hpp file that provides function to
submit host task to decrement reference count for each
Python object passed to one gated by passed event references.
Host task is submitted to sycl::queue behind the given QRef.
SyclQueue.submit changes the mechanism by which it ensures that
Python objects (and memory they hold) that the kernel works on
are not GC collected before the kernel completes its execution.
We used to store reference to arguments in the SyclEvent object
returned by SyclQueue.submit. To avoid GC-ing kernel arguments
before kernel completes execution, deleter of SyclEvent has to
call `SyclEvent.wait`.
With this PR `SyclQueue.submit` increments reference counts of
arguments after submission, then schedules a host task on the same
queue, dependent on the kernel event, which aquires GIL and
decrements reference counts.
After this change the SyclEven.__dealloc__ no longer has to wait.
It also no longer needs to store args attribute. This is now
deperecated and will be removed.1 parent 05a5abd commit e1189e5
File tree
4 files changed
+66
-4
lines changed- dpctl
4 files changed
+66
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
714 | 720 | | |
715 | 721 | | |
716 | 722 | | |
717 | | - | |
| 723 | + | |
718 | 724 | | |
719 | 725 | | |
720 | 726 | | |
721 | 727 | | |
722 | 728 | | |
| 729 | + | |
| 730 | + | |
723 | 731 | | |
724 | 732 | | |
725 | 733 | | |
| |||
820 | 828 | | |
821 | 829 | | |
822 | 830 | | |
823 | | - | |
824 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
825 | 843 | | |
826 | 844 | | |
827 | 845 | | |
| |||
0 commit comments