Skip to content

Commit 0a35e9c

Browse files
Do not use async_dec_ref in submit method
Instead delegated the task of Python object life-time management to the user via use of _submit_keep_args_alive method
1 parent 5b5363e commit 0a35e9c

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -905,23 +905,6 @@ cdef class SyclQueue(_SyclQueue):
905905
raise SyclKernelSubmitError(
906906
"Kernel submission to Sycl queue failed."
907907
)
908-
# increment reference counts to list of arguments
909-
Py_INCREF(args)
910-
911-
# schedule decrement
912-
args_raw = <PyObject *>args
913-
914-
ret = -1
915-
htERef = async_dec_ref(self.get_queue_ref(), &args_raw, 1, &Eref, 1, &ret)
916-
if ret:
917-
# async task submission failed, decrement ref counts and wait
918-
Py_DECREF(args)
919-
with nogil:
920-
DPCTLEvent_Wait(Eref)
921-
DPCTLEvent_Wait(htERef)
922-
923-
# we are not returning host-task event at the moment
924-
DPCTLEvent_Delete(htERef)
925908

926909
return SyclEvent._create(Eref)
927910

0 commit comments

Comments
 (0)