Skip to content
Merged
Changes from 1 commit
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
Next Next commit
avoid adding potentially problematic __dict__ to every child class
  • Loading branch information
leofang committed Oct 8, 2025
commit f3c9d0f277d90e21c75aefbbc82dfd40e85bf96e
7 changes: 2 additions & 5 deletions cuda_core/cuda/core/experimental/_memory.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ cdef class _cyMemoryResource:

class MemoryResourceAttributes(abc.ABC):

__slots__ = ()

@property
@abc.abstractmethod
def is_device_accessible(self) -> bool:
Expand Down Expand Up @@ -107,8 +109,6 @@ cdef class Buffer(_cyBuffer, MemoryResourceAttributes):

Support for data interchange mechanisms are provided by DLPack.
"""
cdef dict __dict__ # required if inheriting from both Cython/Python classes

def __cinit__(self):
self._ptr = 0
self._size = 0
Expand Down Expand Up @@ -369,8 +369,6 @@ cdef class MemoryResource(_cyMemoryResource, MemoryResourceAttributes, abc.ABC):
hold a reference to self, the buffer properties are retrieved simply by looking up the underlying
memory resource's respective property.)
"""
cdef dict __dict__ # required if inheriting from both Cython/Python classes

cdef void _deallocate(self, intptr_t ptr, size_t size, cyStream stream) noexcept:
self.deallocate(ptr, size, stream)

Expand Down Expand Up @@ -675,7 +673,6 @@ cdef class DeviceMemoryResource(MemoryResource):
bint _is_mapped
object _uuid
IPCAllocationHandle _alloc_handle
dict __dict__ # required if inheriting from both Cython/Python classes
object __weakref__

def __cinit__(self):
Expand Down