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