aclGetRecentErrMsg

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function

Obtains and clears the error messages returned by other failed acl API calls in the same process or thread as this API.

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

You are advised to make a separate aclGetRecentErrMsg call upon each acl API call failure to facilitate troubleshooting. Otherwise, error messages may be stacked or lost. If aclGetRecentErrMsg has been called 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

1
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

API Call Example

For the API call example, see Obtaining Runtime Error Codes.