Skip to content

Commit c531c0d

Browse files
authored
Merge pull request #2271 from pbalcer/0.10.11
Candidate for the v0.10.11 release tag
2 parents 3b5fb34 + 62113c0 commit c531c0d

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)
7-
project(unified-runtime VERSION 0.10.10)
7+
project(unified-runtime VERSION 0.10.11)
88

99
# Check if unified runtime is built as a standalone project.
1010
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR UR_STANDALONE_BUILD)
@@ -133,7 +133,7 @@ if(UR_ENABLE_TRACING)
133133

134134
if (UR_BUILD_XPTI_LIBS)
135135
# fetch xpti proxy library for the tracing layer
136-
FetchContentSparse_Declare(xpti https://github.com/intel/llvm.git "sycl-nightly/20230703" "xpti")
136+
FetchContentSparse_Declare(xpti https://github.com/intel/llvm.git "nightly-2024-10-22" "xpti")
137137
FetchContent_MakeAvailable(xpti)
138138

139139
# set -fPIC for xpti since we are linking it with a shared library
@@ -145,7 +145,7 @@ if(UR_ENABLE_TRACING)
145145
set(XPTI_DIR ${xpti_SOURCE_DIR})
146146
set(XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests")
147147

148-
FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "sycl-nightly/20230703" "xptifw")
148+
FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "nightly-2024-10-22" "xptifw")
149149

150150
FetchContent_MakeAvailable(xptifw)
151151

examples/collector/collector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
125125
return;
126126
}
127127
if (std::string_view(stream_name) != UR_STREAM_NAME) {
128-
std::cout << "Invalid stream name: " << stream_name << ". Expected "
129-
<< UR_STREAM_NAME << ". Aborting." << std::endl;
128+
// we expect ur.call, but this can also be xpti.framework.
130129
return;
131130
}
132131

source/loader/layers/tracing/ur_tracing_layer.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "xpti/xpti_data_types.h"
1616
#include "xpti/xpti_trace_framework.h"
1717
#include <atomic>
18+
#include <cstdint>
1819
#include <optional>
1920
#include <sstream>
2021

@@ -59,6 +60,12 @@ void context_t::notify(uint16_t trace_type, uint32_t id, const char *name,
5960
}
6061

6162
uint64_t context_t::notify_begin(uint32_t id, const char *name, void *args) {
63+
// we use UINT64_MAX as a special value that means "tracing disabled",
64+
// so that we don't have to repeat this check in notify_end.
65+
if (!xptiCheckTraceEnabled(call_stream_id)) {
66+
return UINT64_MAX;
67+
}
68+
6269
if (auto loc = codelocData.get_codeloc()) {
6370
xpti::payload_t payload =
6471
xpti::payload_t(loc->functionName, loc->sourceFile, loc->lineNumber,
@@ -77,6 +84,10 @@ uint64_t context_t::notify_begin(uint32_t id, const char *name, void *args) {
7784

7885
void context_t::notify_end(uint32_t id, const char *name, void *args,
7986
ur_result_t *resultp, uint64_t instance) {
87+
if (instance == UINT64_MAX) { // tracing disabled
88+
return;
89+
}
90+
8091
notify((uint16_t)xpti::trace_point_type_t::function_with_args_end, id, name,
8192
args, resultp, instance);
8293
}

test/layers/tracing/test_collector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
4949
return;
5050
}
5151
if (std::string_view(stream_name) != UR_STREAM_NAME) {
52-
std::cout << "Invalid stream name: " << stream_name << ". Expected "
53-
<< UR_STREAM_NAME << ". Aborting." << std::endl;
52+
// we expect ur.call, but this can also be xpti.framework.
5453
return;
5554
}
5655

0 commit comments

Comments
 (0)