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: ec54afaa32]
This commit is contained in:
@@ -113,6 +113,27 @@ inline std::string ToHexString(T v) {
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline std::string ToString(T* v) {
|
||||
std::ostringstream ss;
|
||||
if (v == NULL) {
|
||||
ss << "char array:<null>";
|
||||
} else {
|
||||
ss << v;
|
||||
}
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline std::string ToString(T** v) {
|
||||
std::ostringstream ss;
|
||||
if (v == NULL) {
|
||||
ss << "char array:<null>";
|
||||
} 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<const void*>(v);
|
||||
};
|
||||
|
||||
template <>
|
||||
inline std::string ToString(hipFunction_t v) {
|
||||
std::ostringstream ss;
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user