Error Handling#
Functions | |
hipError_t | hipGetLastError (void) |
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess. | |
hipError_t | hipExtGetLastError (void) |
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess. | |
hipError_t | hipPeekAtLastError (void) |
Return last error returned by any HIP runtime API call. | |
const char * | hipGetErrorName (hipError_t hip_error) |
Return hip error as text string form. | |
const char * | hipGetErrorString (hipError_t hipError) |
Return handy text string message to explain the error which occurred. | |
hipError_t | hipDrvGetErrorName (hipError_t hipError, const char **errorString) |
Return hip error as text string form. | |
hipError_t | hipDrvGetErrorString (hipError_t hipError, const char **errorString) |
Return handy text string message to explain the error which occurred. | |
Detailed Description
This section describes the error handling functions of HIP runtime API.
Function Documentation
◆ hipDrvGetErrorName()
hipError_t hipDrvGetErrorName | ( | hipError_t | hipError, |
const char ** | errorString | ||
) |
Return hip error as text string form.
- Parameters
-
[in] hipError Error code to convert to string. [out] errorString char pointer to the NULL-terminated error string
- Returns
- hipSuccess, hipErrorInvalidValue
- See also
- hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t
◆ hipDrvGetErrorString()
hipError_t hipDrvGetErrorString | ( | hipError_t | hipError, |
const char ** | errorString | ||
) |
Return handy text string message to explain the error which occurred.
- Parameters
-
[in] hipError Error code to convert to string. [out] errorString char pointer to the NULL-terminated error string
- Returns
- hipSuccess, hipErrorInvalidValue
- See also
- hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t
◆ hipExtGetLastError()
hipError_t hipExtGetLastError | ( | void | ) |
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess.
- Returns
- return code from last HIP called from the active host thread
Returns the last error that has been returned by any of the runtime calls in the same host thread, and then resets the saved error to hipSuccess.
- See also
- hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t
◆ hipGetErrorName()
const char * hipGetErrorName | ( | hipError_t | hip_error | ) |
Return hip error as text string form.
- Parameters
-
hip_error Error code to convert to name.
- Returns
- const char pointer to the NULL-terminated error name
- See also
- hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t
◆ hipGetErrorString()
const char * hipGetErrorString | ( | hipError_t | hipError | ) |
Return handy text string message to explain the error which occurred.
- Parameters
-
hipError Error code to convert to string.
- Returns
- const char pointer to the NULL-terminated error string
- See also
- hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t
◆ hipGetLastError()
hipError_t hipGetLastError | ( | void | ) |
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess.
- Returns
- return code from last HIP called from the active host thread
Returns the last error that has been returned by any of the runtime calls in the same host thread, and then resets the saved error to hipSuccess.
- See also
- hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t
◆ hipPeekAtLastError()
hipError_t hipPeekAtLastError | ( | void | ) |
Return last error returned by any HIP runtime API call.
- Returns
- hipSuccess
Returns the last error that has been returned by any of the runtime calls in the same host thread. Unlike hipGetLastError, this function does not reset the saved error code.
- See also
- hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t