Skip to content

Commit 90bbdec

Browse files
authored
[SYCL] Fix missing xpti ifdefs (#18217)
This fixes the build with `SYCL_ENABLE_XPTI_TRACING=OFF`.
1 parent 19668be commit 90bbdec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

sycl/source/detail/graph_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,17 @@ graph_impl::add(std::function<void(handler &)> CGF,
500500
(void)Args;
501501
sycl::handler Handler{shared_from_this()};
502502

503-
// save code location if one was set in TLS.
504-
// idealy it would be nice to capture user's call code location
503+
#if XPTI_ENABLE_INSTRUMENTATION
504+
// Save code location if one was set in TLS.
505+
// Ideally it would be nice to capture user's call code location
505506
// by adding a parameter to the graph.add function, but this will
506507
// break the API. At least capture code location from TLS, user
507508
// can set it before calling graph.add
508509
if (xptiTraceEnabled()) {
509510
sycl::detail::tls_code_loc_t Tls;
510511
Handler.saveCodeLoc(Tls.query(), Tls.isToplevel());
511512
}
513+
#endif
512514

513515
CGF(Handler);
514516

sycl/source/detail/queue_impl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,12 @@ event queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
321321
handler Handler(Self, PrimaryQueue.get(), SecondaryQueue.get(),
322322
CallerNeedsEvent);
323323
auto &HandlerImpl = detail::getSyclObjImpl(Handler);
324+
325+
#if XPTI_ENABLE_INSTRUMENTATION
324326
if (xptiTraceEnabled()) {
325327
Handler.saveCodeLoc(Loc, IsTopCodeLoc);
326328
}
329+
#endif
327330

328331
{
329332
NestedCallsTracker tracker;

0 commit comments

Comments
 (0)