From 4a1d5b54e7bbd9bb09d167219e854a0848382741 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 12 Dec 2019 11:47:12 -0500
Subject: [PATCH] P4 to Git Change 2044900 by
skudchad@skudchad_test2_win_opencl on 2019/12/12 11:42:43
SWDEV-203814 - Add cases to handle char* and char** for tracehelper
ReviewBoardURL = http://ocltc.amd.com/reviews/r/18384/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/trace_helper.h#4 edit
[ROCm/hip commit: ec54afaa3283a5cc3295340531451c34cf9ba7af]
---
projects/hip/api/hip/trace_helper.h | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/projects/hip/api/hip/trace_helper.h b/projects/hip/api/hip/trace_helper.h
index 3f87fbe1b3..650ee89422 100644
--- a/projects/hip/api/hip/trace_helper.h
+++ b/projects/hip/api/hip/trace_helper.h
@@ -113,6 +113,27 @@ inline std::string ToHexString(T v) {
return ss.str();
};
+template
+inline std::string ToString(T* v) {
+ std::ostringstream ss;
+ if (v == NULL) {
+ ss << "char array:";
+ } else {
+ ss << v;
+ }
+ return ss.str();
+};
+
+template
+inline std::string ToString(T** v) {
+ std::ostringstream ss;
+ if (v == NULL) {
+ ss << "char array:";
+ } else {
+ ss << v;
+ }
+ return ss.str();
+};
//---
// Template overloads for ToString to handle specific types
@@ -125,11 +146,6 @@ inline std::string ToString(T v) {
return ss.str();
};
-template <>
-inline std::string ToString(const char* v) {
- return ToHexString(v);
-};
-
template <>
inline std::string ToString(hipFunction_t v) {
std::ostringstream ss;