Skip to content

[SYCL][XPTI] Fix compilation issue when building SYCL without XPTI #5289

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 2 commits into from Jan 12, 2022
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
3 changes: 3 additions & 0 deletions sycl/source/detail/xpti_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
__SYCL_INLINE_NAMESPACE(cl) {
namespace sycl {
namespace detail {
#ifdef XPTI_ENABLE_INSTRUMENTATION
xpti::trace_event_data_t *
XPTIRegistry::createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
const detail::code_location &CodeLoc,
Expand All @@ -39,6 +40,8 @@ XPTIRegistry::createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
return xptiMakeEvent(Name.c_str(), &Payload, TraceEventType, xpti_at::active,
&IId);
}
#endif // XPTI_ENABLE_INSTRUMENTATION

void XPTIRegistry::bufferConstructorNotification(
void *UserObj, const detail::code_location &CodeLoc) {
(void)UserObj;
Expand Down
11 changes: 7 additions & 4 deletions sycl/source/detail/xpti_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,17 @@ class XPTIRegistry {
static void bufferAccessorNotification(void *UserObj, void *AccessorObj,
uint32_t Target, uint32_t Mode,
const detail::code_location &CodeLoc);
static xpti::trace_event_data_t *
createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
const detail::code_location &CodeLoc,
uint16_t TraceEventType);

private:
std::unordered_set<std::string> MActiveStreams;
std::once_flag MInitialized;

#ifdef XPTI_ENABLE_INSTRUMENTATION
static xpti::trace_event_data_t *
createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
const detail::code_location &CodeLoc,
uint16_t TraceEventType);
#endif // XPTI_ENABLE_INSTRUMENTATION
};
} // namespace detail
} // namespace sycl
Expand Down