diff --git a/sycl/include/CL/sycl/detail/pi.hpp b/sycl/include/CL/sycl/detail/pi.hpp index 3b82ff2bc658d..858cfdbdeff1c 100644 --- a/sycl/include/CL/sycl/detail/pi.hpp +++ b/sycl/include/CL/sycl/detail/pi.hpp @@ -163,7 +163,7 @@ template struct PiFuncInfo {}; #define _PI_API(api) \ template <> struct PiFuncInfo { \ using FuncPtrT = decltype(&::api); \ - inline std::string getFuncName() { return #api; } \ + inline const char *getFuncName() { return #api; } \ inline FuncPtrT getFuncPtr(PiPlugin MPlugin) { \ return MPlugin.PiFunctionTable.api; \ } \ diff --git a/sycl/source/detail/plugin.hpp b/sycl/source/detail/plugin.hpp index 3480ac81f643e..4027bcefc759d 100644 --- a/sycl/source/detail/plugin.hpp +++ b/sycl/source/detail/plugin.hpp @@ -73,13 +73,13 @@ class plugin { // Emit a function_begin trace for the PI API before the call is executed. // If arguments need to be captured, then a data structure can be sent in // the per_instance_user_data field. - std::string PIFnName = PiCallInfo.getFuncName(); - uint64_t CorrelationID = pi::emitFunctionBeginTrace(PIFnName.c_str()); + const char *PIFnName = PiCallInfo.getFuncName(); + uint64_t CorrelationID = pi::emitFunctionBeginTrace(PIFnName); #endif RT::PiResult R; if (pi::trace(pi::TraceLevel::PI_TRACE_CALLS)) { std::lock_guard Guard(*TracingMutex); - std::string FnName = PiCallInfo.getFuncName(); + const char *FnName = PiCallInfo.getFuncName(); std::cout << "---> " << FnName << "(" << std::endl; RT::printArgs(Args...); R = PiCallInfo.getFuncPtr(MPlugin)(Args...); @@ -92,7 +92,7 @@ class plugin { } #ifdef XPTI_ENABLE_INSTRUMENTATION // Close the function begin with a call to function end - pi::emitFunctionEndTrace(CorrelationID, PIFnName.c_str()); + pi::emitFunctionEndTrace(CorrelationID, PIFnName); #endif return R; }