Skip to main content

Mojo function

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:

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

Was this page helpful?