Skip to content

Commit 39a86fd

Browse files
authored
Merge pull request #182 from leofang/exporting_obj
Rename `StridedMemoryView.obj` to `StridedMemoryView.exporting_obj`
2 parents 8c841cd + edf0bb7 commit 39a86fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cuda_core/cuda/core/experimental/_memoryview.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cdef class StridedMemoryView:
2929
device_id: int = None # -1 for CPU
3030
device_accessible: bool = None
3131
readonly: bool = None
32-
obj: Any = None
32+
exporting_obj: Any = None
3333

3434
def __init__(self, obj=None, stream_ptr=None):
3535
if obj is not None:
@@ -50,7 +50,7 @@ cdef class StridedMemoryView:
5050
+ f" device_id={self.device_id},\n"
5151
+ f" device_accessible={self.device_accessible},\n"
5252
+ f" readonly={self.readonly},\n"
53-
+ f" obj={get_simple_repr(self.obj)})")
53+
+ f" exporting_obj={get_simple_repr(self.exporting_obj)})")
5454

5555

5656
cdef str get_simple_repr(obj):
@@ -173,7 +173,7 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None):
173173
buf.device_id = device_id
174174
buf.device_accessible = device_accessible
175175
buf.readonly = is_readonly
176-
buf.obj = obj
176+
buf.exporting_obj = obj
177177

178178
cdef const char* used_name = (
179179
DLPACK_VERSIONED_TENSOR_USED_NAME if versioned else DLPACK_TENSOR_USED_NAME)
@@ -252,7 +252,7 @@ cdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None):
252252
raise BufferError("stream=None is ambiguous with view()")
253253

254254
cdef StridedMemoryView buf = StridedMemoryView() if view is None else view
255-
buf.obj = obj
255+
buf.exporting_obj = obj
256256
buf.ptr, buf.readonly = cai_data["data"]
257257
buf.shape = cai_data["shape"]
258258
# TODO: this only works for built-in numeric types

0 commit comments

Comments
 (0)