Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candidate for the v0.10.11 release tag #2271

Merged
merged 2 commits into from
Oct 31, 2024
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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)
project(unified-runtime VERSION 0.10.10)
project(unified-runtime VERSION 0.10.11)

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

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

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

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

FetchContent_MakeAvailable(xptifw)

Expand Down
3 changes: 1 addition & 2 deletions examples/collector/collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
return;
}
if (std::string_view(stream_name) != UR_STREAM_NAME) {
std::cout << "Invalid stream name: " << stream_name << ". Expected "
<< UR_STREAM_NAME << ". Aborting." << std::endl;
// we expect ur.call, but this can also be xpti.framework.
return;
}

Expand Down
11 changes: 11 additions & 0 deletions source/loader/layers/tracing/ur_tracing_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "xpti/xpti_data_types.h"
#include "xpti/xpti_trace_framework.h"
#include <atomic>
#include <cstdint>
#include <optional>
#include <sstream>

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

uint64_t context_t::notify_begin(uint32_t id, const char *name, void *args) {
// we use UINT64_MAX as a special value that means "tracing disabled",
// so that we don't have to repeat this check in notify_end.
if (!xptiCheckTraceEnabled(call_stream_id)) {
return UINT64_MAX;
}

if (auto loc = codelocData.get_codeloc()) {
xpti::payload_t payload =
xpti::payload_t(loc->functionName, loc->sourceFile, loc->lineNumber,
Expand All @@ -77,6 +84,10 @@ uint64_t context_t::notify_begin(uint32_t id, const char *name, void *args) {

void context_t::notify_end(uint32_t id, const char *name, void *args,
ur_result_t *resultp, uint64_t instance) {
if (instance == UINT64_MAX) { // tracing disabled
return;
}

notify((uint16_t)xpti::trace_point_type_t::function_with_args_end, id, name,
args, resultp, instance);
}
Expand Down
3 changes: 1 addition & 2 deletions test/layers/tracing/test_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
return;
}
if (std::string_view(stream_name) != UR_STREAM_NAME) {
std::cout << "Invalid stream name: " << stream_name << ". Expected "
<< UR_STREAM_NAME << ". Aborting." << std::endl;
// we expect ur.call, but this can also be xpti.framework.
return;
}

Expand Down
Loading