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

apple_matmul

def apple_matmul[*, transpose_b: Bool = False, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None] = None](cblas_gemm_fn: def(_CBLASOrder, _CBLASTranspose, _CBLASTranspose, Int32, Int32, Int32, Float32, Pointer[Float32, ImmutAnyOrigin, _safe=False], Int32, Pointer[Float32, ImmutAnyOrigin, _safe=False], Int32, Float32, Pointer[Float32, MutAnyOrigin, _safe=False], Int32) thin -> None, c: TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, address_space=b.address_space, linear_idx_type=b.linear_idx_type])

Performs a single-precision matmul via a pre-loaded cblas_sgemm function pointer.

Delegates to the Apple Accelerate cblas_sgemm routine using the supplied function handle, then applies the optional epilogue to the output tile. Requires all operands to be DType.float32.

Parameters:

Args:

def apple_matmul[*, transpose_b: Bool = False, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None] = None](c: TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, address_space=b.address_space, linear_idx_type=b.linear_idx_type])

Performs a single-precision matmul via the Apple Accelerate library.

Loads cblas_sgemm from the Accelerate framework and delegates to apple_matmul with the function handle. Requires all operands to be DType.float32.

Parameters:

Args:

Was this page helpful?