Sets an exception callback function. This API is synchronous.
Example use case: Before the aclopExecuteV2 call, call aclrtSetExceptionInfoCallback to set an exception callback function. When operator execution on the device fails, the system passes a pointer to the aclrtExceptionInfo struct that contains the task ID, stream ID, thread ID, device ID, and error code to the exception callback function and executes the callback function.
aclError aclrtSetExceptionInfoCallback(aclrtExceptionInfoCallback callback)
Parameter |
Input/Output |
Description |
|---|---|---|
callback |
Input |
Callback function. Prototype: typedef void (*aclrtExceptionInfoCallback)(aclrtExceptionInfo *exceptionInfo); |
0 on success; else, failure.
For the API call example, see AI Core Troubleshooting.