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)Wraps
srcin anwarp.arrayif it is not already one and copies the contents toself.contiguous()Returns 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()Returns 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()Returns a flattened list of items in the array as a Python list.
mark_init()Resets this array's read flag
mark_read()Marks 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()Converts 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)Returns a reshaped array.
to(device[, requires_grad])Returns a Warp array with this array's data moved to the specified device, no-op if already on device.
transpose([axes])Returns an zero-copy view of the array with axes transposed.
view(dtype)Returns a zero-copy view of this array's memory with a different data type.
zero_()Zeroes-out the array entries.
Attributes
gradrequires_grad