Reordering Functions - Reordering Functions - 5.3 English - 68552

AOCL API Guide (68552)

Document_ID
68552
Release_Date
2026-05-13
Version
5.3 English
void aocl_reorder_f32f32f32of32(const char order, const char trans, const char mat_type, const float *input_buf_addr, float *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Performs reordering of the input matrix. Expanded from AOCL_DLP_GEMM_REORDER macro.

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

  • trans – [in] Transpose option for the matrix.

  • mat_type – [in] Type of the matrix (e.g., ‘A’ for matrix A, ‘B’ for matrix B).

  • input_buf_addr – [in] Pointer to the input matrix buffer.

  • reorder_buf_addr – [out] Pointer to the reordered matrix buffer.

  • k – [in] Number of rows in the matrix.

  • n – [in] Number of columns in the matrix.

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

  • metadata – [in] Metadata for the post-operations.

void aocl_reorder_f32f32f32of32_reference(const char order, const char trans, const char mat_type, const float *input_buf_addr, float *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_u8s8s32os32(const char order, const char trans, const char mat_type, const int8_t *input_buf_addr, int8_t *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_bf16bf16f32of32(const char order, const char trans, const char mat_type, const bfloat16 *input_buf_addr, bfloat16 *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_bf16bf16f32of32_reference(const char order, const char trans, const char mat_type, const bfloat16 *input_buf_addr, bfloat16 *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_s8s8s32os32(const char order, const char trans, const char mat_type, const int8_t *input_buf_addr, int8_t *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_u8s4s32os32(const char order, const char trans, const char mat_type, const int8_t *input_buf_addr, int8_t *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_bf16s4f32of32(const char order, const char trans, const char mat_type, const int8_t *input_buf_addr, int8_t *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

void aocl_reorder_s8s8s32os32_sym_quant(const char order, const char trans, const char mat_type, const int8_t *input_buf_addr, int8_t *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, DLP_SYMM_STAT_QUANT *symq_meta_data, dlp_metadata_t *metadata)#

Performs reordering of the input matrix for symmetric quantization. Expanded from AOCL_DLP_GEMM_REORDER_SYM_QUANT macro.

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

  • trans – [in] Transpose option for the matrix.

  • mat_type – [in] Type of the matrix (e.g., ‘A’ for matrix A, ‘B’ for matrix B).

  • input_buf_addr – [in] Pointer to the input matrix buffer.

  • reorder_buf_addr – [out] Pointer to the reordered matrix buffer.

  • k – [in] Number of rows in the matrix.

  • n – [in] Number of columns in the matrix.

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

  • symq_meta_data – [in] Metadata for symmetric quantization.

  • metadata – [in] Metadata for the post-operations.

void aocl_reorder_f32obf16(const char order, const char trans, const char mat_type, const float *input_buf_addr, bfloat16 *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Performs reordering of the input matrix for mixed precision DLP_GEMM. Expanded from AOCL_DLP_GEMM_REORDER_MXP macro.

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

  • trans – [in] Transpose option for the matrix.

  • mat_type – [in] Type of the matrix (e.g., ‘A’ for matrix A, ‘B’ for matrix B).

  • input_buf_addr – [in] Pointer to the input matrix buffer.

  • reorder_buf_addr – [out] Pointer to the reordered matrix buffer.

  • k – [in] Number of rows in the matrix.

  • n – [in] Number of columns in the matrix.

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

  • metadata – [in] Metadata for the post-operations.

void aocl_reorder_f16f16f16of16(const char order, const char trans, const char mat_type, const float16 *input_buf_addr, float16 *reorder_buf_addr, const md_t k, const md_t n, const md_t ldb, dlp_metadata_t *metadata)#

Reorders the input matrix into an optimized layout.

msz_t aocl_get_reorder_buf_size_f16f16f16of16(const char order, const char trans, const char mat_type, const md_t k, const md_t n, dlp_metadata_t *metadata)#

Returns buffer size (in bytes) for matrix reordering.