IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

get_min_max_value

def 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].