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).
align_up
align_up(value: Int, alignment: Int) -> Int
Returns the closest multiple of alignment that is greater than or equal to value.
Args:
Returns:
Int: Closest multiple of the alignment that is greater than or equal to the
input value. In other words, ceiling(value / alignment) * alignment.
align_up[dtype: DType, width: Int, //](value: SIMD[dtype, width], alignment: SIMD[dtype, width]) -> SIMD[dtype, width] where dtype.is_integral()
Returns the closest multiple of alignment that is greater than or equal to value, elementwise.
Parameters:
- dtype (
DType): Thedtypeof the input SIMD vector. - width (
Int): The width of the input and output SIMD vector.
Args:
- value (
SIMD[dtype, width]): The value to align. - alignment (
SIMD[dtype, width]): Value to align to.
Returns:
SIMD[dtype, width]: Closest multiple of the alignment that is greater than or equal to the
input value. In other words, ceiling(value / alignment) * alignment.