From 3dfbd7f2a86c33c7e5d77be836110c6c0b2dd0c7 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Thu, 9 Nov 2023 04:28:36 +0000 Subject: [PATCH] SWDEV-388256 - Add hipExtGetLastError Change-Id: I588f155b2755306e452501d565a1fac17f0a90ce --- include/hip/hip_runtime_api.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/hip/hip_runtime_api.h b/include/hip/hip_runtime_api.h index 070a172d35..658481634a 100644 --- a/include/hip/hip_runtime_api.h +++ b/include/hip/hip_runtime_api.h @@ -2137,6 +2137,20 @@ hipError_t hipFuncSetSharedMemConfig(const void* func, hipSharedMemConfig config * @see hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t */ hipError_t hipGetLastError(void); + +/** + * @brief 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 hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t + */ +hipError_t hipExtGetLastError(void); + /** * @brief Return last error returned by any HIP runtime API call. *