Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
12 changes: 3 additions & 9 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 Expand Up @@ -1010,9 +1007,7 @@ class LegacyPinnedMemoryResource(MemoryResource):
APIs.
"""

def __init__(self):
# TODO: support flags from cuMemHostAlloc?
self._handle = None
# TODO: support creating this MR with flags that are later passed to cuMemHostAlloc?

def allocate(self, size_t size, stream: Stream = None) -> Buffer:
"""Allocate a buffer of the requested size.
Expand Down Expand Up @@ -1071,7 +1066,6 @@ class _SynchronousMemoryResource(MemoryResource):
__slots__ = ("_dev_id",)

def __init__(self, device_id : int | Device):
self._handle = None
self._dev_id = getattr(device_id, 'device_id', device_id)

def allocate(self, size, stream=None) -> Buffer:
Expand Down
Loading