IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0b1
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

is_contiguous_dim

is_contiguous_dim(layout: Layout, dim: Int) -> Bool

Checks if a flat layout is contiguous in a specific dimension.

This function checks if a flat layout is contiguous in a specified dimension, considering both positive strides and zero strides with a single element. The latter case is necessary for coalesced layouts.

Args:

  • layout (Layout): The layout to check.
  • dim (Int): The dimension to check.

Returns:

Bool: True if the layout is contiguous in the specified dimension, False otherwise.