warp.utils.array_scan#

warp.utils.array_scan(in_array, out_array, inclusive=True)[source]#

Perform a scan (prefix sum) operation on an array.

This function computes the inclusive or exclusive scan of the input array and stores the result in the output array. The scan operation computes a running sum of elements in the array.

Parameters:
  • in_array (array) – Input array to scan. Must be of type int32 or float32.

  • out_array (array) – Output array to store scan results. Must match input array type and size.

  • inclusive (bool) – If True, performs an inclusive scan (includes current element in sum). If False, performs an exclusive scan (excludes current element).

Raises:

RuntimeError – If array storage devices don’t match, if storage size is insufficient, or if data types are unsupported.

Return type:

None