IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

num_matrix_reg

def num_matrix_reg[dim_1: Int, dim_2: Int]() -> Int

Calculates the number of matrix registers required per thread.

Determines how many registers each thread in a warp needs to store a matrix of the given dimensions. This is calculated by dividing the total number of elements (dim_1 * dim_2) by the warp size, as the matrix is distributed across all threads in the warp.

Parameters:

  • dim_1 (Int): First dimension of the matrix.
  • dim_2 (Int): Second dimension of the matrix.

Returns:

Int: The number of matrix registers needed per thread.

Was this page helpful?