You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit feb85c7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: cuda_core/cuda/core/_memoryview.pyx
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -152,18 +152,28 @@ cdef class StridedMemoryView:
152
152
153
153
@classmethod
154
154
deffrom_dlpack(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView:
155
+
"""Create a view from an object supporting the `DLPack <https://dmlc.github.io/dlpack/latest/>`_ protocol.
156
+
157
+
Parameters
158
+
----------
159
+
obj : object
160
+
An object implementing the `DLPack <https://dmlc.github.io/dlpack/latest/>`_ protocol
161
+
(via ``__dlpack__``).
162
+
stream_ptr : int, optional
163
+
Stream pointer for synchronization. If ``None``, no synchronization is performed.
def from_cuda_array_interface(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView:
161
-
"""Create a view from an object supporting the ``__cuda_array_interface__`` protocol.
171
+
"""Create a view from an object supporting the `__cuda_array_interface__ <https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html>`_ protocol.
162
172
163
173
Parameters
164
174
----------
165
175
obj : object
166
-
An object implementing the ``__cuda_array_interface__`` protocol.
176
+
An object implementing the `__cuda_array_interface__ <https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html>`_ protocol.
167
177
stream_ptr : int, optional
168
178
Stream pointer for synchronization. If ``None``, no synchronization is performed.
169
179
"""
@@ -173,12 +183,12 @@ cdef class StridedMemoryView:
"""Create a view from an object supporting the ``__array_interface__`` protocol.
186
+
"""Create a view from an object supporting the `__array_interface__ <https://numpy.org/doc/stable/reference/arrays.interface.html>`_ protocol.
177
187
178
188
Parameters
179
189
----------
180
190
obj : object
181
-
An object implementing the ``__array_interface__`` protocol (e.g., a numpy array).
191
+
An object implementing the `__array_interface__ <https://numpy.org/doc/stable/reference/arrays.interface.html>`_ protocol (e.g., a numpy array).
0 commit comments