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
break_into_powers_of_two
def break_into_powers_of_two[origins: OriginSet, //, func: def[pow_two: Int, offset: Int]() capturing thin -> None, N: Int, *, max_value: Int = Int(128)]()
Calls func for each power-of-two-sized chunk of N, plus a final pow_two=0 call for pipeline cleanup.
Parameters:
- βorigins (
OriginSet): Origin set captured by the callback (inferred). - βfunc (
def[pow_two: Int, offset: Int]() capturing thin -> None): Callback invoked once per power-of-two chunk with the chunk size and starting offset, plus a finalpow_two=0cleanup call. - βN (
Int): Total size to decompose into power-of-two chunks. - βmax_value (
Int): Upper bound on the largest power-of-two chunk size (defaults to 128).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!