From 6fe93da01424a72f77ff8bcb3482e5f739d2efc4 Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Mon, 8 Feb 2016 21:45:49 -0600 Subject: [PATCH] in HIPCHECK, only run command once even if error occurs [ROCm/clr commit: c482a3f45641d36e09cc6f9c083b4cd60dc2110b] --- projects/clr/hipamd/tests/src/test_common.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/clr/hipamd/tests/src/test_common.h b/projects/clr/hipamd/tests/src/test_common.h index 891fe381d2..ac89459956 100644 --- a/projects/clr/hipamd/tests/src/test_common.h +++ b/projects/clr/hipamd/tests/src/test_common.h @@ -29,12 +29,15 @@ #define HIPCHECK(error) \ - if (error != hipSuccess) { \ +{\ + hipError_t localError = error; \ + if (localError != hipSuccess) { \ printf("%serror: '%s'(%d) at %s:%d%s\n", \ - KRED,hipGetErrorString(error), error,\ + KRED,hipGetErrorString(localError), localError,\ __FILE__, __LINE__,KNRM); \ failed("API returned error code.");\ - } + }\ +} #define HIPASSERT(condition) \ if (! (condition) ) { \