warp.tile_upper_solve#

warp.tile_upper_solve(
U: Tile[Float, tuple[int, int]],
z: Tile[Float, tuple[int, ...]],
) → Tile[Float, tuple[int, ...]]#
  • Kernel: true
  • Python: false
  • Differentiable: false

Solve U x = z for an upper-triangular U and return x in a new tile.

Only the upper triangle of U, including its diagonal, is read; the strictly lower triangle is ignored. U must be non-singular with nonzero diagonal entries.

This is a cooperative operation, so every thread in the block must call it.

The right-hand side may be a 1D tile with shape=(M,) or a 2D tile with shape=(M, NRHS), which solves for all NRHS columns at once. U and z must have the same dtype, either float32 or float64.

On CUDA devices, Warp uses cuSolverDx when it is built with libmathdx and warp.config.enable_mathdx_solver (or the enable_mathdx_solver module option) is True. Otherwise, and on the CPU, it uses a cooperative fallback implementation, which is slower than cuSolverDx on CUDA devices.

Parameters:
  • U – A square, non-singular, upper-triangular tile with shape=(M, M).

  • z – The right-hand side, a tile with shape=(M,) or shape=(M, NRHS).

Returns:

A new tile in shared memory with the same shape and dtype as z, holding the solution x of U x = z.

See tile_lower_solve() for a usage example.