Skip to content
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: 2 additions & 1 deletion sycl/source/detail/graph/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,9 @@ exec_graph_impl::enqueueNodeDirect(const sycl::context &Ctx,
const bool xptiEnabled = xptiTraceEnabled();
xpti_td *CmdTraceEvent = nullptr;
uint64_t InstanceID = 0;
auto StreamID = detail::getActiveXPTIStreamID();
uint8_t StreamID = 0;
if (xptiEnabled) {
StreamID = detail::getActiveXPTIStreamID();
sycl::detail::CGExecKernel *CGExec =
static_cast<sycl::detail::CGExecKernel *>(Node.MCommandGroup.get());
sycl::detail::code_location CodeLoc(CGExec->MFileName.c_str(),
Expand Down
17 changes: 12 additions & 5 deletions sycl/source/detail/queue_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,12 @@ EventImplPtr queue_impl::submit_kernel_scheduler_bypass(
#ifdef XPTI_ENABLE_INSTRUMENTATION
xpti_td *CmdTraceEvent = nullptr;
uint64_t InstanceID = 0;
auto StreamID = detail::getActiveXPTIStreamID();
uint8_t StreamID = 0;
// Only enable instrumentation if there are subscribes to the SYCL
// stream
const bool xptiEnabled = xptiCheckTraceEnabled(StreamID);
const bool xptiEnabled = xptiTraceEnabled();
if (xptiEnabled) {
StreamID = detail::getActiveXPTIStreamID();
std::tie(CmdTraceEvent, InstanceID) = emitKernelInstrumentationData(
StreamID, KernelImplPtr, CodeLoc, IsTopCodeLoc,
*KData.getDeviceKernelInfoPtr(), this, KData.getNDRDesc(),
Expand Down Expand Up @@ -843,8 +844,12 @@ void queue_impl::wait(const detail::code_location &CodeLoc) {
void *TelemetryEvent = nullptr;
uint64_t IId;
std::string Name;
auto StreamID = detail::getActiveXPTIStreamID();
TelemetryEvent = instrumentationProlog(CodeLoc, Name, StreamID, IId);
uint8_t StreamID = 0;
const bool xptiEnabled = xptiTraceEnabled();
if (xptiEnabled) {
StreamID = detail::getActiveXPTIStreamID();
TelemetryEvent = instrumentationProlog(CodeLoc, Name, StreamID, IId);
}
#endif

if (!MGraph.expired()) {
Expand Down Expand Up @@ -926,7 +931,9 @@ void queue_impl::wait(const detail::code_location &CodeLoc) {
#ifdef XPTI_ENABLE_INSTRUMENTATION
// There is an early return in instrumentationEpilog() if no subscribers are
// subscribing to queue.wait().
instrumentationEpilog(TelemetryEvent, Name, StreamID, IId);
if (xptiEnabled) {
instrumentationEpilog(TelemetryEvent, Name, StreamID, IId);
}
#endif
}

Expand Down