Skip to content

[SYCL] Fix traceKernel function to avoid temporary string creation #17868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/source/detail/kernel_program_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ class KernelProgramCache {

// Sends message to std:cerr stream when SYCL_CACHE_TRACE environemnt is
// set.
static inline void traceKernel(const std::string &Msg,
const std::string &KernelName,
static inline void traceKernel(std::string_view Msg,
std::string_view KernelName,
bool IsKernelFastCache = false) {
if (!SYCLConfig<SYCL_CACHE_TRACE>::isTraceInMemCache())
return;

std::string Identifier =
"[IsFastCache: " + std::to_string(IsKernelFastCache) +
"][Key:{Name = " + KernelName + "}]: ";
"][Key:{Name = " + KernelName.data() + "}]: ";

std::cerr << "[In-Memory Cache][Thread Id:" << std::this_thread::get_id()
<< "][Kernel Cache]" << Identifier << Msg << std::endl;
Expand Down