diff --git a/hipamd/include/hcc_detail/trace_helper.h b/hipamd/include/hcc_detail/trace_helper.h index 1275016188..35a8b80c0c 100644 --- a/hipamd/include/hcc_detail/trace_helper.h +++ b/hipamd/include/hcc_detail/trace_helper.h @@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - +#pragma once #include #include @@ -35,7 +35,7 @@ THE SOFTWARE. // Building block functions: template -std::string ToHexString(T v) +inline std::string ToHexString(T v) { std::ostringstream ss; ss << "0x" << std::hex << v; @@ -47,7 +47,7 @@ std::string ToHexString(T v) // Template overloads for ToString to handle various types: // Note these use C++11 variadic templates template -std::string ToString(T v) { +inline std::string ToString(T v) { std::ostringstream ss; ss << v; return ss.str(); @@ -55,7 +55,7 @@ std::string ToString(T v) { template <> -std::string ToString(hipMemcpyKind v) { +inline std::string ToString(hipMemcpyKind v) { switch(v) { CASE_STR(hipMemcpyHostToHost); CASE_STR(hipMemcpyHostToDevice); @@ -68,13 +68,13 @@ std::string ToString(hipMemcpyKind v) { template <> -std::string ToString(hipError_t v) { +inline std::string ToString(hipError_t v) { return ihipErrorString(v); }; // Catch empty arguments case -std::string ToString() { +inline std::string ToString() { return (""); } @@ -83,6 +83,6 @@ std::string ToString() { // C++11 variadic template - peels off first argument, converts to string, and calls itself again to peel the next arg. // Strings are automatically separated by comma+space. template -std::string ToString(T first, Args... args) { +inline std::string ToString(T first, Args... args) { return ToString(first) + ", " + ToString(args...) ; }