File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
cuda_core/cuda/core/experimental Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -583,7 +583,7 @@ class DeviceMemoryResourceAttributes:
583583# This enables buffer serialization, as buffers can reduce to a pair
584584# of comprising the memory resource UUID (the key into this registry)
585585# and the serialized buffer descriptor.
586- _ipc_registry = {}
586+ cdef object _ipc_registry = weakref.WeakValueDictionary()
587587
588588
589589cdef class DeviceMemoryResource(MemoryResource):
@@ -756,8 +756,6 @@ cdef class DeviceMemoryResource(MemoryResource):
756756 with nogil:
757757 HANDLE_RETURN(cydriver.cuMemPoolDestroy(self ._mempool_handle))
758758 finally :
759- if self .is_mapped:
760- self .unregister()
761759 self ._dev_id = cydriver.CU_DEVICE_INVALID
762760 self ._mempool_handle = NULL
763761 self ._attributes = None
@@ -803,13 +801,6 @@ cdef class DeviceMemoryResource(MemoryResource):
803801 self._uuid = uuid
804802 return self
805803
806- def unregister(self ):
807- """ Unregister this mapped memory resource."""
808- assert self .is_mapped
809- if _ipc_registry is not None : # can occur during shutdown catastrophe
810- with contextlib.suppress(KeyError ):
811- del _ipc_registry[self .uuid]
812-
813804 @property
814805 def uuid(self ) -> Optional[uuid.UUID]:
815806 """
You can’t perform that action at this time.
0 commit comments