From 2ff0c7c7bf19074e4e3123f5f92d940ca5edd976 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Sun, 3 Oct 2021 21:56:21 -0700 Subject: [PATCH] Revert "SWDEV-252801 - Fix hipGetLastError/hipPeekAtLastError" Temporarily reverting to resolve promotion issues. This reverts commit b36803746b7c72f1d2bf1666006d396b08e312ec. Change-Id: I578d1d627e4b9779b146bf2827894522d6673d13 [ROCm/clr commit: ce0995e799139e48e64c51f49a37e82351686fa8] --- projects/clr/hipamd/src/hip_internal.hpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/projects/clr/hipamd/src/hip_internal.hpp b/projects/clr/hipamd/src/hip_internal.hpp index eccb87e0ce..437a0c9d05 100644 --- a/projects/clr/hipamd/src/hip_internal.hpp +++ b/projects/clr/hipamd/src/hip_internal.hpp @@ -97,22 +97,16 @@ typedef struct ihipIpcEventHandle_st { HIP_INIT() \ HIP_CB_SPAWNER_OBJECT(cid); -#define HIP_RETURN_DURATION(ret, ...) \ - hipError_t _lastError = (ret); \ - if (_lastError != hipSuccess) { \ - hip::g_lastError = _lastError; \ - } \ +#define HIP_RETURN_DURATION(ret, ...) \ + hip::g_lastError = ret; \ HIPPrintDuration(amd::LOG_INFO, amd::LOG_API, &startTimeUs, "%s: Returned %s : %s", \ - __func__, hipGetErrorName(_lastError), ToString( __VA_ARGS__ ).c_str()); \ - return _lastError; + __func__, hipGetErrorName(hip::g_lastError), ToString( __VA_ARGS__ ).c_str()); \ + return hip::g_lastError; #define HIP_RETURN(ret, ...) \ - hipError_t _lastError = (ret); \ - if (_lastError != hipSuccess) { \ - hip::g_lastError = _lastError; \ - } \ - HIP_ERROR_PRINT(_lastError, __VA_ARGS__) \ - return _lastError; + hip::g_lastError = ret; \ + HIP_ERROR_PRINT(hip::g_lastError, __VA_ARGS__) \ + return hip::g_lastError; #define HIP_RETURN_ONFAIL(func) \ do { \