IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

hmul2_bf16x8_by_scalar

def hmul2_bf16x8_by_scalar[out_dtype: DType](packed: SIMD[DType.uint32, SIMDLength(4)], scale_bf16: UInt32) -> SIMD[DType.uint32, SIMDLength(4)]

Multiply 8 packed bf16 values (in 4 uint32 registers) by a bf16x2 scalar broadcast.

Parameters:

  • โ€‹out_dtype (DType): Element type of the packed bf16 values (bfloat16).

Args:

  • โ€‹packed (SIMD[DType.uint32, SIMDLength(4)]): Four uint32 registers holding the eight packed bf16 values to scale.
  • โ€‹scale_bf16 (UInt32): Bf16x2 scalar broadcast in a uint32, as produced by e8m0_to_bf16_broadcast.

Returns:

SIMD[DType.uint32, SIMDLength(4)]

Was this page helpful?