Skip to main content
Log in

Mojo function

min

min[val_type: DType, simd_width: Int, //](val: SIMD[val_type, simd_width]) -> SIMD[val_type, simd_width]

Computes the minimum value across all lanes in a warp.

This is a convenience wrapper around lane_group_min that operates on the entire warp. It performs a parallel reduction using warp shuffle operations to find the global minimum value across all lanes in the warp.

Parameters:

  • val_type (DType): The data type of the SIMD elements (e.g. float32, int32).
  • simd_width (Int): The number of elements in the SIMD vector.

Args:

  • val (SIMD[val_type, simd_width]): The SIMD value to reduce. Each lane contributes its value to find the minimum.

Returns:

A SIMD value where all lanes contain the minimum value found across the entire warp. The minimum value is broadcast to all lanes.