warp.fixedarray#
- class warp.fixedarray(*args, **kwargs)[source]#
A fixed-size, stack allocated, array containing values of the same type.
Only used during codegen, and for type hints, but otherwise not intended to be used at the Python scope.
Methods
__init__([dtype, shape])assign(src)Wrap
srcin anwarp.arrayif it is not already one and copy the contents toself.contiguous()Return a contiguous array with this array's data.
cptr()Return a ctypes cast of the array address.
fill_(value)Set all array entries to value
flatten()Return a zero-copy view of the array collapsed to 1-D.
ipc_handle()Return an IPC handle of the array as a 64-byte
bytesobjectlist()Return a flattened list of items in the array as a Python list.
mark_init()Reset this array's read flag.
mark_read()Mark this array as having been read from in a kernel or recorded function on the tape.
mark_write(**kwargs)Detect if we are writing to an array that has already been read from.
numpy()Convert the array to a
numpy.ndarray(aliasing memory through the array interface protocol) If the array is on the GPU, a synchronous device-to-host copy (on the CUDA default stream) will be automatically performed to ensure that any outstanding work is completed.reshape(shape)Return a reshaped array.
to(device[, requires_grad])Return a Warp array with this array's data moved to the specified device, no-op if already on device.
transpose([axes])Return a zero-copy view of the array with axes transposed.
view(dtype)Return a zero-copy view of this array's memory with a different data type.
zero_()Zero out the array entries.
Attributes
gradrequires_grad