aclGetRecentErrMsg

Description

Obtains and clears the error message returned by other AscendCL API call failure in the process or thread.

The err_msg_mode configuration item in the aclInit API determines whether to obtain the process-level or thread-level error description. The thread-level error description is obtained by default.

You are advised to make a separate aclGetRecentErrMsg call on each AscendCL API call failure to facilitate troubleshooting. Otherwise, error messages may be stacked or lost. If aclGetRecentErrMsg has been called for multiple times in a process or thread, only the error message string pointer returned by the most recent call is valid. Do not use those returned by the previous calls as this will result in unauthorized memory access.

Prototype

const char *aclGetRecentErrMsg()

Parameters

None

Returns

Success: a pointer to the error message string. If multiple error messages are obtained, the latest error message is displayed on the top.

Failure: nullptr