From ad4ae89d130db39abe2cb08f014c2882eaa7891d Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 15 Aug 2018 14:13:08 -0400
Subject: [PATCH] P4 to Git Change 1594075 by skudchad@skudchad-lnx on
2018/08/15 14:00:33
SWDEV-145570 - [HIP] Fix some test failures
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#14 edit
---
hipamd/api/hip/hip_device_runtime.cpp | 4 +++-
hipamd/api/hip/hip_internal.hpp | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
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