Skip to content

Capsule deleters should service used renamed capsules too #568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dpctl/_sycl_context.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ cdef void _context_capsule_deleter(object o):
o, "SyclContextRef"
)
DPCTLContext_Delete(CRef)
elif pycapsule.PyCapsule_IsValid(o, "used_SyclContextRef"):
CRef = <DPCTLSyclContextRef> pycapsule.PyCapsule_GetPointer(
o, "used_SyclContextRef"
)
DPCTLContext_Delete(CRef)


cdef void _init_helper(_SyclContext context, DPCTLSyclContextRef CRef):
Expand Down
5 changes: 5 additions & 0 deletions dpctl/_sycl_event.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ cdef void _event_capsule_deleter(object o):
o, "SyclEventRef"
)
DPCTLEvent_Delete(ERef)
elif pycapsule.PyCapsule_IsValid(o, "used_SyclEventRef"):
ERef = <DPCTLSyclEventRef> pycapsule.PyCapsule_GetPointer(
o, "used_SyclEventRef"
)
DPCTLEvent_Delete(ERef)


cdef void _init_helper(_SyclEvent event, DPCTLSyclEventRef ERef):
Expand Down
5 changes: 5 additions & 0 deletions dpctl/_sycl_queue.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ cdef void _queue_capsule_deleter(object o):
o, "SyclQueueRef"
)
DPCTLQueue_Delete(QRef)
elif pycapsule.PyCapsule_IsValid(o, "used_SyclQueueRef"):
QRef = <DPCTLSyclQueueRef> pycapsule.PyCapsule_GetPointer(
o, "used_SyclQueueRef"
)
DPCTLQueue_Delete(QRef)


cdef class _SyclQueue:
Expand Down