8.7.2. Error Handling - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

AOCL-DLP uses the dlp_metadata_t structure for error handling. Errors are reported through the error_hndl field within the metadata structure.

Error Handling Mechanism:

// Allocate and initialize metadata structure
dlp_metadata_t* metadata = (dlp_metadata_t*)malloc(sizeof(dlp_metadata_t));
memset(metadata, 0, sizeof(dlp_metadata_t));

// Perform GEMM operation
aocl_gemm_f32f32f32of32(
    'R', 'N', 'N', m, n, k,
    1.0f, a, lda, 'N',
    b, ldb, 'N',
    0.0f, c, ldc,
    metadata
);

// Check for errors
if (metadata->error_hndl.error_code != 0) {
    fprintf(stderr, "Error code: %d\n", metadata->error_hndl.error_code);
    // Handle error appropriately
}

// Clean up
free(metadata);

Common Error Scenarios:

  • Invalid matrix dimensions

  • Incorrect data type specifications

  • Post-operation configuration errors

  • Memory allocation failures