Skip to content

[SYCL][NFC]Lowers overhead of making plugin calls #3982

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
Jun 24, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/detail/pi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ template <PiApiKind PiApiOffset> struct PiFuncInfo {};
#define _PI_API(api) \
template <> struct PiFuncInfo<PiApiKind::api> { \
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; \
} \
Expand Down
8 changes: 4 additions & 4 deletions sycl/source/detail/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> 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...);
Expand All @@ -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;
}
Expand Down