Mojo function
max
max[val_type: DType, simd_width: Int, //](val: SIMD[val_type, simd_width]) -> SIMD[val_type, simd_width]
Computes the maximum value across all lanes in a warp.
This is a convenience wrapper around lane_group_max that operates on the entire warp. It performs a parallel reduction using warp shuffle operations to find the global maximum 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 maximum.
Returns:
A SIMD value where all lanes contain the maximum value found across the entire warp.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!