From 5d87b2f50d521465858df22c0d2c96a6d815df7e Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Thu, 1 Sep 2016 13:58:54 -0500 Subject: [PATCH] improve debug for event Change-Id: If6c0e25729d9964cbe5967833247a6d791d575a0 [ROCm/clr commit: 8a4900b67976fa73556a02b78de8bbe1b17fd999] --- projects/clr/hipamd/include/hcc_detail/hip_hcc.h | 7 +++++++ projects/clr/hipamd/include/hcc_detail/trace_helper.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/include/hcc_detail/hip_hcc.h b/projects/clr/hipamd/include/hcc_detail/hip_hcc.h index fb10af1106..216e81c67f 100644 --- a/projects/clr/hipamd/include/hcc_detail/hip_hcc.h +++ b/projects/clr/hipamd/include/hcc_detail/hip_hcc.h @@ -715,5 +715,12 @@ inline std::ostream & operator<<(std::ostream& os, const dim3& s) return os; } +// Stream printf functions: +inline std::ostream& operator<<(std::ostream& os, const hipEvent_t& e) +{ + os << "event:" << std::hex << static_cast (e); + return os; +} + #endif diff --git a/projects/clr/hipamd/include/hcc_detail/trace_helper.h b/projects/clr/hipamd/include/hcc_detail/trace_helper.h index 3740d8b9a7..7a8f1106f0 100644 --- a/projects/clr/hipamd/include/hcc_detail/trace_helper.h +++ b/projects/clr/hipamd/include/hcc_detail/trace_helper.h @@ -63,7 +63,9 @@ inline std::string ToString(T v) template <> inline std::string ToString(hipEvent_t v) { - return ToString(&v); + std::ostringstream ss; + ss << v; + return ss.str(); };