Mojo function
shuffle_xor
shuffle_xor[type: DType, simd_width: Int, //](val: SIMD[type, simd_width], offset: SIMD[uint32, 1]) -> SIMD[type, simd_width]
Copies values from between lanes (butterfly pattern).
Exchange a value between threads within a warp by copying from a thread based on the bitwise xor of the offset with the thread's own lane id.
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 lane based on bitwise XOR of own lane id.
shuffle_xor[type: DType, simd_width: Int, //](mask: UInt, val: SIMD[type, simd_width], offset: SIMD[uint32, 1]) -> SIMD[type, simd_width]
Copies values from between lanes (butterfly pattern).
Exchange a value between threads within a warp by copying from a thread based on the bitwise xor of the offset with the thread's own lane id.
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 lane based on bitwise XOR of own lane id.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!