warp.tile_argmin#

warp.tile_argmin(
a: Tile[Scalar, tuple[int, ...]],
) Tile[Int, tuple[Literal[1]]]#
  • Kernel

Cooperatively compute the index of the minimum element in the tile using all threads in the block.

Parameters:

a – The tile to compute the argmin from

Returns:

A single-element tile holding the index of the minimum value.

Example

@wp.kernel
def compute():

    t = wp.tile_arange(64, 128)
    s = wp.tile_argmin(t)

    print(s)


wp.launch_tiled(compute, dim=[1], inputs=[], block_dim=64)
[0] = tile(shape=(1), storage=register)