Synopsis
int dpuSetExceptionMode
(
int mode
)
Arguments
- mode
- The exception handling mode for runtime N2Cube to be specified. Available
values include:
- N2CUBE_EXCEPTION_MODE_PRINT_AND_EXIT
- N2CUBE_EXCEPTION_MODE_RET_ERR_CODE
Description
Set the exception handling mode for edge DPU runtime N2Cube. It will affect all the APIs included in the libn2cube library.
If N2CUBE_EXCEPTION_MODE_PRINT_AND_EXIT is specified, the invoked N2Cube APIs will output the error message and terminate the running of DPU application when any error occurs. It is the default mode for N2Cube APIs.
If N2CUBE_EXCEPTION_MODE_RET_ERR_CODE is specified, the invoked N2Cube APIs only return error code in case of errors. The callers need to take charge of the following exception handling process, such as logging the error message with API dpuGetExceptionMessage(), resource release, etc.
Returns
0 on success, or negative value in case of failure.
Include File
n2cube.h
Availability
Vitis AI v1.0