组内协作(group)自动生成
只能在 group 模式的 Kernel 中使用:组内各 lane 交换数据、同步。
| 返回 | 函数 | 需要能力 |
|---|---|---|
T |
exchange (value: T, lane: Int) |
— |
Int |
lane () |
— |
exchange
Section titled “exchange”exchange(value: T, lane: Int) -> TWhat lane lane of the group (wrapped into it, so lane() + 1 and -1 go round) holds as value at this exchange. Every lane of the group meets there, so an exchange stands under no branch, loop count or until that turns on what a lane holds alone (its lane, its element, what it reads or was handed): what the whole group holds (params, literals, the domain) may steer one. Group only, from its body.
只能在 Kernel 主体中调用
lane() -> IntThis element’s place in its group, from 0 to the group’s size less one: element() % the size.
只能在 Kernel 主体中调用

