Skip to content

Commit da6b33a

Browse files
authored
[SYCL] Avoid saving code location if XPTI is disabled (#18005)
1 parent 62e74fa commit da6b33a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sycl/source/detail/graph_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,10 @@ graph_impl::add(std::function<void(handler &)> CGF,
505505
// by adding a parameter to the graph.add function, but this will
506506
// break the API. At least capture code location from TLS, user
507507
// can set it before calling graph.add
508-
sycl::detail::tls_code_loc_t Tls;
509-
Handler.saveCodeLoc(Tls.query(), Tls.isToplevel());
508+
if (xptiTraceEnabled()) {
509+
sycl::detail::tls_code_loc_t Tls;
510+
Handler.saveCodeLoc(Tls.query(), Tls.isToplevel());
511+
}
510512

511513
CGF(Handler);
512514

sycl/source/detail/queue_impl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ event queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
362362
const SubmissionInfo &SubmitInfo) {
363363
handler Handler(Self, PrimaryQueue, SecondaryQueue, CallerNeedsEvent);
364364
auto &HandlerImpl = detail::getSyclObjImpl(Handler);
365-
Handler.saveCodeLoc(Loc, IsTopCodeLoc);
365+
if (xptiTraceEnabled()) {
366+
Handler.saveCodeLoc(Loc, IsTopCodeLoc);
367+
}
366368

367369
{
368370
NestedCallsTracker tracker;

0 commit comments

Comments
 (0)