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
merge
def merge[dtype: DType, out_idx_type: DType](mut buf_keys: TileTensor[dtype, Engine=buf_keys.Engine, address_space=buf_keys.address_space, linear_idx_type=buf_keys.linear_idx_type], mut buf_ids: TileTensor[out_idx_type, Engine=buf_ids.Engine, address_space=buf_ids.address_space, linear_idx_type=buf_ids.linear_idx_type], start: Int, mid: Int, end: Int)
Merge two sorted subarrays into one sorted array.
Parameters:
- dtype (
DType): Element type ofbuf_keys(inferred). - out_idx_type (
DType): Element type ofbuf_ids(inferred).
Args:
- buf_keys (
TileTensor[dtype, Engine=buf_keys.Engine, address_space=buf_keys.address_space, linear_idx_type=buf_keys.linear_idx_type]): Rank-2 keys holding two adjacent sorted subranges that are merged in place in descending order. - buf_ids (
TileTensor[out_idx_type, Engine=buf_ids.Engine, address_space=buf_ids.address_space, linear_idx_type=buf_ids.linear_idx_type]): Rank-2 indices carried alongsidebuf_keysso each key retains its original position. - start (
Int): Inclusive start index of the left sorted subrange. - mid (
Int): Exclusive end of the left subrange and inclusive start of the right subrange. - end (
Int): Exclusive end index of the right sorted subrange.