diff --git a/hipamd/api/hip/hip_device_runtime.cpp b/hipamd/api/hip/hip_device_runtime.cpp index 87a149a10a..f5e75d316b 100644 --- a/hipamd/api/hip/hip_device_runtime.cpp +++ b/hipamd/api/hip/hip_device_runtime.cpp @@ -155,7 +155,9 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) //FIXME: should we cache the props, or just select from deviceHandle->info_? hipDeviceProp_t prop = {0}; hipError_t err = hipGetDeviceProperties(&prop, device); - if (err != hipSuccess) HIP_RETURN(err); + if (err != hipSuccess) { + HIP_RETURN(err); + } switch (attr) { case hipDeviceAttributeMaxThreadsPerBlock: diff --git a/hipamd/api/hip/hip_internal.hpp b/hipamd/api/hip/hip_internal.hpp index a8a9c3eeb3..472051a379 100644 --- a/hipamd/api/hip/hip_internal.hpp +++ b/hipamd/api/hip/hip_internal.hpp @@ -67,7 +67,7 @@ extern amd::Memory* getMemoryObject(const void* ptr, size_t& offset); #define HIP_RETURN(ret) \ hip::g_lastError = ret; \ - return ret; \ + return hip::g_lastError; \ #endif // HIP_SRC_HIP_INTERNAL_H