Mojo function
shuffle_down
shuffle_down[type: DType, simd_width: Int, //](val: SIMD[type, simd_width], offset: SIMD[uint32, 1]) -> SIMD[type, simd_width]
Copies values from other lanes in the warp.
Exchange a value between threads within a warp by copying from a thread with higher lane id relative to the caller without the use of shared memory.
Parameters:
- type (
DType
): The type of the simd value. - simd_width (
Int
): The width of the simd value.
Args:
- val (
SIMD[type, simd_width]
): The value to be shuffled. - offset (
SIMD[uint32, 1]
): The offset warp lane ID.
Returns:
The value at the specified offset.
shuffle_down[type: DType, simd_width: Int, //](mask: UInt, val: SIMD[type, simd_width], offset: SIMD[uint32, 1]) -> SIMD[type, simd_width]
Copies values from other lanes in the warp.
Exchange a value between threads within a warp by copying from a thread with higher lane id relative to the caller without the use of shared memory.
Parameters:
- type (
DType
): The type of the simd value. - simd_width (
Int
): The width of the simd value.
Args:
- mask (
UInt
): The mask of the warp lanes. - val (
SIMD[type, simd_width]
): The value to be shuffled. - offset (
SIMD[uint32, 1]
): The offset warp lane ID.
Returns:
The value at the specified offset.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!