Skip to content

Commit 99201d7

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 109e7a6 commit 99201d7

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
@@ -918,23 +918,6 @@ cdef class SyclQueue(_SyclQueue):
918918
raise SyclKernelSubmitError(
919919
"Kernel submission to Sycl queue failed."
920920
)
921-
# increment reference counts to list of arguments
922-
Py_INCREF(args)
923-
924-
# schedule decrement
925-
args_raw = <PyObject *>args
926-
927-
ret = -1
928-
htERef = async_dec_ref(self.get_queue_ref(), &args_raw, 1, &Eref, 1, &ret)
929-
if ret:
930-
# async task submission failed, decrement ref counts and wait
931-
Py_DECREF(args)
932-
with nogil:
933-
DPCTLEvent_Wait(Eref)
934-
DPCTLEvent_Wait(htERef)
935-
936-
# we are not returning host-task event at the moment
937-
DPCTLEvent_Delete(htERef)
938921

939922
return SyclEvent._create(Eref)
940923

0 commit comments

Comments
 (0)