Float16 GEMM - Float16 GEMM - 5.3 English - 68552

AOCL API Guide (68552)

Document_ID
68552
Release_Date
2026-05-13
Version
5.3 English
void aocl_gemm_f16f16f16of16(const char order, const char transa, const char transb, const md_t m, const md_t n, const md_t k, const float16 alpha, const float16 *a, const md_t lda, const char mem_format_a, const float16 *b, const md_t ldb, const char mem_format_b, const float16 beta, float16 *c, const md_t ldc, dlp_metadata_t *metadata)#

FP16xFP16 GEMM with native FP16 accumulation and FP16 output.

Uses native FP16 FMA operations for both accumulation and output. Provides maximum performance but with lower precision than F32 accumulation.

Note: alpha and beta are float16 (NATIVE_FP16) so the JIT kernel can consume them directly via vpbroadcastw + vmulph without a runtime widen. This matches the FP16-end-to-end character of this API.

Parameters:
  • order – [in] Memory layout (row-major or column-major).

  • transa – [in] Transpose option for matrix A.

  • transb – [in] Transpose option for matrix B.

  • m – [in] Row dimensions.

  • n – [in] Column dimensions.

  • k – [in] Inner dimensions.

  • alpha – [in] Scalar multiplier for the product of matrices A and B (FP16).

  • a – [in] Pointer to matrix A (FP16).

  • lda – [in] Leading dimension of matrix A.

  • mem_format_a – [in] Memory format of matrix A.

  • b – [in] Pointer to matrix B (FP16).

  • ldb – [in] Leading dimension of matrix B.

  • mem_format_b – [in] Memory format of matrix B.

  • beta – [in] Scalar multiplier for matrix C (FP16).

  • c – [inout] Pointer to matrix C (FP16 output).

  • ldc – [in] Leading dimension of matrix C.

  • metadata – [in] Pointer to post-operation structures.