◆ __init__()
def polygraphy.util.cuda.DeviceBuffer.__init__ |
( |
|
self, |
|
|
|
shape = None , |
|
|
|
dtype = None |
|
) |
| |
Represents a buffer on the GPU.
Args:
shape (Tuple[int]): The initial shape of the buffer.
dtype (numpy.dtype): The data type of the buffer.
◆ address()
def polygraphy.util.cuda.DeviceBuffer.address |
( |
|
self | ) |
|
◆ allocate()
def polygraphy.util.cuda.DeviceBuffer.allocate |
( |
|
self, |
|
|
|
nbytes |
|
) |
| |
◆ free()
def polygraphy.util.cuda.DeviceBuffer.free |
( |
|
self | ) |
|
◆ resize()
def polygraphy.util.cuda.DeviceBuffer.resize |
( |
|
self, |
|
|
|
shape |
|
) |
| |
◆ _check_dtype_matches()
def polygraphy.util.cuda.DeviceBuffer._check_dtype_matches |
( |
|
self, |
|
|
|
host_buffer |
|
) |
| |
|
private |
◆ copy_from()
def polygraphy.util.cuda.DeviceBuffer.copy_from |
( |
|
self, |
|
|
|
host_buffer, |
|
|
|
stream = None |
|
) |
| |
◆ copy_to()
def polygraphy.util.cuda.DeviceBuffer.copy_to |
( |
|
self, |
|
|
|
host_buffer, |
|
|
|
stream = None |
|
) |
| |
Copies from this device buffer to the provided host buffer.
Host buffer must be contiguous in memory (see np.ascontiguousarray).
Args:
host_buffer (numpy.ndarray): The host buffer to copy into.
stream (Stream):
A Stream instance (see util/cuda.py). Performs a synchronous copy if no stream is provided.
Returns:
numpy.ndarray: The host buffer, possibly reallocated if the provided buffer was too small.
◆ __str__()
def polygraphy.util.cuda.DeviceBuffer.__str__ |
( |
|
self | ) |
|
◆ shape
polygraphy.util.cuda.DeviceBuffer.shape |
◆ dtype
polygraphy.util.cuda.DeviceBuffer.dtype |
◆ allocated_nbytes
polygraphy.util.cuda.DeviceBuffer.allocated_nbytes |
◆ _ptr
polygraphy.util.cuda.DeviceBuffer._ptr |
|
private |
The documentation for this class was generated from the following file: