gpumemoryview#
- class pylibcudf.gpumemoryview.gpumemoryview(obj)#
Minimal representation of a memory buffer.
This class aspires to be a GPU equivalent of
memoryviewfor any objects exposing a CUDA Array Interface. It will be expanded to encompass more memoryview functionality over time.Attributes
gpumemoryview.size: int
cai
nbytes
obj
ptr
Methods
byte_slice(self, s)Return a byte-range sub-view of this buffer.
- byte_slice(self, s: slice) gpumemoryview#
Return a byte-range sub-view of this buffer.
- Parameters:
- sslice
Byte-based slice.
- Returns:
- gpumemoryview
A
|u1view of the requested byte range. The returned view holds a reference to the parent buffer, keeping it alive.
- Raises:
- TypeError
If
sis not a slice.- ValueError
If the slice step is not 1. Out-of-range or reversed ranges return a zero-length view rather than raising.
- size#
gpumemoryview.size: int
Size of the memory region in bytes (Span protocol).
This is an alias for nbytes to satisfy the Span protocol.