Skip to content

Commit 8a31ffa

Browse files
committed
Avoid temporary object creation when do tracing
1 parent 704d56e commit 8a31ffa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sycl/source/detail/kernel_program_cache.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ class KernelProgramCache {
328328

329329
// Sends message to std:cerr stream when SYCL_CACHE_TRACE environemnt is
330330
// set.
331-
static inline void traceProgram(const std::string &Msg,
331+
template <typename MsgType>
332+
static inline void traceProgram(const MsgType &Msg,
332333
const ProgramCacheKeyT &CacheKey) {
333334
if (!SYCLConfig<SYCL_CACHE_TRACE>::isTraceInMemCache())
334335
return;
@@ -362,8 +363,9 @@ class KernelProgramCache {
362363

363364
// Sends message to std:cerr stream when SYCL_CACHE_TRACE environemnt is
364365
// set.
365-
static inline void traceKernel(std::string_view Msg,
366-
std::string_view KernelName,
366+
template <typename MsgType>
367+
static inline void traceKernel(const MsgType &Msg,
368+
KernelNameStrRefT KernelName,
367369
bool IsFastKernelCache = false) {
368370
if (!SYCLConfig<SYCL_CACHE_TRACE>::isTraceInMemCache())
369371
return;

0 commit comments

Comments
 (0)