Usage Example - Usage Example - 5.3 English - 68552

AOCL API Guide (68552)

Document_ID
68552
Release_Date
2026-05-13
Version
5.3 English
#include "aocl_dlp.h"

// Convert float32 to bfloat16
float f32_value = 3.14159f;
aocl_bf16 bf16_value = (aocl_bf16)f32_value;

// Use in GEMM operations
aocl_bf16 *a_bf16, *b_bf16;
float *c_f32;

aocl_gemm_bf16bf16f32of32(
    'R', 'N', 'N', m, n, k,
    1.0f, a_bf16, lda, 'N',
    b_bf16, ldb, 'N',
    0.0f, c_f32, ldc, NULL
);