From 42a04159d818fc12f270dd95bba3e03ff3faa19d Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 11 Sep 2018 18:34:50 -0400 Subject: [PATCH] P4 to Git Change 1604468 by skudchad@skudchad_test2_win_opencl on 2018/09/11 18:28:45 SWDEV-145570 - [HIP] - Assert functionality for error != hipSuccess with LOG_LEVEL=3 ReviewBoardURL = http://ocltc.amd.com/reviews/r/15793/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/debug.hpp#8 edit [ROCm/clr commit: 832753f4d33899e6a6152e1f04bb0c4b47a84656] --- projects/clr/rocclr/runtime/utils/debug.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/projects/clr/rocclr/runtime/utils/debug.hpp b/projects/clr/rocclr/runtime/utils/debug.hpp index c018d92752..d21f2d89f2 100644 --- a/projects/clr/rocclr/runtime/utils/debug.hpp +++ b/projects/clr/rocclr/runtime/utils/debug.hpp @@ -127,6 +127,17 @@ inline void warning(const char* msg) { amd::report_warning(msg); } } \ } while (false) +#ifdef DEBUG +#define LogGuarantee(cond, level, msg) \ + do { \ + if (LOG_LEVEL >= level) { \ + guarantee(cond); \ + } \ + } while (false) +#else // !DEBUG +#define LogGuarantee(cond, level, msg) (void)(0) +#endif // !DEBUG + #define LogInfo(msg) Log(amd::LOG_INFO, msg) #define LogError(msg) Log(amd::LOG_ERROR, msg) #define LogWarning(msg) Log(amd::LOG_WARNING, msg) @@ -140,4 +151,6 @@ inline void warning(const char* msg) { amd::report_warning(msg); } #define LogPrintfWarning(format, ...) Logf(amd::LOG_WARNING, format, __VA_ARGS__) #define LogPrintfInfo(format, ...) Logf(amd::LOG_INFO, format, __VA_ARGS__) +#define DebugInfoGuarantee(cond) LogGuarantee(cond, amd::LOG_INFO, "Warning") + #endif /*DEBUG_HPP_*/