Skip to main content

Mojo function

get_min_max_value

get_min_max_value[vec_size: Int, block_size: Int, dtype: DType](in_data: UnsafePointer[Scalar[dtype]], row_idx: Int, d: Int) -> Tuple[Float32, Float32]

Compute the minimum and maximum values from input data using block reduction.

Parameters:

  • ​vec_size (Int): Number of elements each thread processes per iteration (vectorization width).
  • ​block_size (Int): Number of threads per block.
  • ​dtype (DType): The dtype of the input data.

Args:

  • ​in_data (UnsafePointer[Scalar[dtype]]): Pointer to input data buffer.
  • ​row_idx (Int): Row index for the current block (for 2D data access).
  • ​d (Int): Total number of elements in the row.

Returns:

Tuple[Float32, Float32]: Tuple containing [min_val, max_val].