Skip to main content
Version: 1.0

permlane_swap

permlane_swap[dtype: DType, //, stride: Int](val1: Scalar[dtype], val2: Scalar[dtype]) -> SIMD[dtype, 2]

Swaps values between lanes using AMD permlane swap instruction.

Parameters:

  • dtype (DType): Data type of the values (must be 32-bit type).
  • stride (Int): Swap stride (must be 16 or 32).

Args:

  • val1 (Scalar): First value to swap.
  • val2 (Scalar): Second value to swap.

Returns:

SIMD: SIMD vector containing the swapped values.