Skip to content

Commit f8bef52

Browse files
author
Pavel Samolysov
committed
[SYCL][XPTI] Fix compilation issue when building SYCL without XPTI
Also the XPTIRegistry::createTraceEvent static method has been moved into the private part of the class since it is used in the class only. Closes #5274
1 parent 38fd188 commit f8bef52

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

sycl/source/detail/xpti_registry.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
__SYCL_INLINE_NAMESPACE(cl) {
1717
namespace sycl {
1818
namespace detail {
19+
#ifdef XPTI_ENABLE_INSTRUMENTATION
1920
xpti::trace_event_data_t *
2021
XPTIRegistry::createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
2122
const detail::code_location &CodeLoc,
@@ -39,6 +40,8 @@ XPTIRegistry::createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
3940
return xptiMakeEvent(Name.c_str(), &Payload, TraceEventType, xpti_at::active,
4041
&IId);
4142
}
43+
#endif // XPTI_ENABLE_INSTRUMENTATION
44+
4245
void XPTIRegistry::bufferConstructorNotification(
4346
void *UserObj, const detail::code_location &CodeLoc) {
4447
(void)UserObj;

sycl/source/detail/xpti_registry.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,16 @@ class XPTIRegistry {
9898
static void bufferAccessorNotification(void *UserObj, void *AccessorObj,
9999
uint32_t Target, uint32_t Mode,
100100
const detail::code_location &CodeLoc);
101+
private:
102+
std::unordered_set<std::string> MActiveStreams;
103+
std::once_flag MInitialized;
104+
105+
#ifdef XPTI_ENABLE_INSTRUMENTATION
101106
static xpti::trace_event_data_t *
102107
createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
103108
const detail::code_location &CodeLoc,
104109
uint16_t TraceEventType);
105-
106-
private:
107-
std::unordered_set<std::string> MActiveStreams;
108-
std::once_flag MInitialized;
110+
#endif // XPTI_ENABLE_INSTRUMENTATION
109111
};
110112
} // namespace detail
111113
} // namespace sycl

0 commit comments

Comments
 (0)