pyarrow.cuda.HostBuffer¶
-
class
pyarrow.cuda.HostBuffer¶ Bases:
pyarrow.lib.BufferDevice-accessible CPU memory created using cudaHostAlloc.
To create a HostBuffer instance, use
cuda.new_host_buffer(<nbytes>)
-
__init__(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(*args, **kwargs)Initialize self.
equals(self, Buffer other)Determine if two buffers contain exactly the same data.
hex(self)Compute hexadecimal representation of the buffer.
slice(self[, offset, length])Slice this buffer.
to_pybytes(self)Return this buffer as a Python bytes object.
Attributes
The buffer’s address, as an integer.
Whether the buffer is CPU-accessible.
Whether the buffer is mutable.
-
address¶ The buffer’s address, as an integer.
The returned address may point to CPU or device memory. Use is_cpu() to disambiguate.
-
equals(self, Buffer other)¶ Determine if two buffers contain exactly the same data.
- Parameters
other (Buffer) –
- Returns
are_equal (True if buffer contents and size are equal)
-
hex(self)¶ Compute hexadecimal representation of the buffer.
- Returns
bytes
-
is_cpu¶ Whether the buffer is CPU-accessible.
-
is_mutable¶ Whether the buffer is mutable.
-
parent¶
-
size¶
-
slice(self, offset=0, length=None)¶ Slice this buffer. Memory is not copied.
You can also use the Python slice notation
buffer[start:stop].- Parameters
offset (int, default 0) – Offset from start of buffer to slice.
length (int, default None) – Length of slice (default is until end of Buffer starting from offset).
- Returns
sliced (Buffer) – A logical view over this buffer.
-
to_pybytes(self)¶ Return this buffer as a Python bytes object. Memory is copied.
-