From 66bd811c0d83c1b3d7334c109e54e85b56669637 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Mon, 21 Nov 2016 18:07:01 -0600 Subject: [PATCH] fixed error output for hipDeviceGetAttribute Change-Id: I1e343a4e4e20e1a550d419f701cc1e60e9d03af4 [ROCm/clr commit: 912426716b17cdd643062d37d81ce2c343bf1363] --- projects/clr/hipamd/src/hip_device.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/src/hip_device.cpp b/projects/clr/hipamd/src/hip_device.cpp index 5bf7c5bf4e..51fd5e4f81 100644 --- a/projects/clr/hipamd/src/hip_device.cpp +++ b/projects/clr/hipamd/src/hip_device.cpp @@ -174,7 +174,9 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) hipError_t e = hipSuccess; - if(pi != nullptr) { + if(pi == nullptr) { + return ihipLogStatus(hipErrorInvalidValue); + } auto * hipDevice = ihipGetDevice(device); hipDeviceProp_t *prop = &hipDevice->_props; @@ -236,9 +238,6 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) } else { e = hipErrorInvalidDevice; } - }else{ - e = hipErrorInvalidDevice; - } return ihipLogStatus(e); }