Skip to content

Commit 39056ea

Browse files
author
Pavel Samolysov
authored
[SYCL][XPTI] Fix compilation issue when building SYCL without XPTI (#5289)
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 26b058f commit 39056ea

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-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: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,17 @@ class XPTIRegistry {
9898
static void bufferAccessorNotification(void *UserObj, void *AccessorObj,
9999
uint32_t Target, uint32_t Mode,
100100
const detail::code_location &CodeLoc);
101-
static xpti::trace_event_data_t *
102-
createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
103-
const detail::code_location &CodeLoc,
104-
uint16_t TraceEventType);
105101

106102
private:
107103
std::unordered_set<std::string> MActiveStreams;
108104
std::once_flag MInitialized;
105+
106+
#ifdef XPTI_ENABLE_INSTRUMENTATION
107+
static xpti::trace_event_data_t *
108+
createTraceEvent(void *Obj, const char *ObjName, uint64_t &IId,
109+
const detail::code_location &CodeLoc,
110+
uint16_t TraceEventType);
111+
#endif // XPTI_ENABLE_INSTRUMENTATION
109112
};
110113
} // namespace detail
111114
} // namespace sycl

0 commit comments

Comments
 (0)