From bf6eaefef0ded52417faf67dad709ab12fb21f9c Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 26 Jul 2022 15:07:42 +0530 Subject: [PATCH] SWDEV-343380 - Added hipDrvGetErrorName/String (#2825) Change-Id: I1f6df9e801d02e56635c6e9546b71e08b31ea7ce [ROCm/hip commit: e411ebc467afd5503bb829ad2da6c71c43db420f] --- projects/hip/include/hip/hip_runtime_api.h | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index 53d88f65aa..55b430aada 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -1842,7 +1842,7 @@ hipError_t hipGetLastError(void); */ hipError_t hipPeekAtLastError(void); /** - * @brief Return name of the specified error code in text form. + * @brief Return hip error as text string form. * * @param hip_error Error code to convert to name. * @return const char pointer to the NULL-terminated error name @@ -1856,11 +1856,29 @@ const char* hipGetErrorName(hipError_t hip_error); * @param hipError Error code to convert to string. * @return const char pointer to the NULL-terminated error string * - * @warning : on HCC, this function returns the name of the error (same as hipGetErrorName) - * * @see hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t */ const char* hipGetErrorString(hipError_t hipError); +/** + * @brief Return hip error as text string form. + * + * @param [in] hipError Error code to convert to string. + * @param [out] const char pointer to the NULL-terminated error string + * @return #hipSuccess, #hipErrorInvalidValue + * + * @see hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t + */ +hipError_t hipDrvGetErrorName(hipError_t hipError, const char** errorString); +/** + * @brief Return handy text string message to explain the error which occurred + * + * @param [in] hipError Error code to convert to string. + * @param [out] const char pointer to the NULL-terminated error string + * @return #hipSuccess, #hipErrorInvalidValue + * + * @see hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t + */ +hipError_t hipDrvGetErrorString(hipError_t hipError, const char** errorString); // end doxygen Error /** * @}