Error Handling

Error Handling#

HIP Runtime API Reference: Error Handling
Error Handling
Collaboration diagram for 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 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]hipErrorError code to convert to string.
[out]errorStringchar 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]hipErrorError code to convert to string.
[out]errorStringchar pointer to the NULL-terminated error string
Returns
hipSuccess, hipErrorInvalidValue
See also
hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t

◆ hipGetErrorName()

const char * hipGetErrorName ( hipError_t  hip_error)

Return hip error as text string form.

Parameters
hip_errorError 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
hipErrorError 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